Merge pull request #1926 from zoddicus/fixChromiumRoll

Remove unnecessary semi-colons and add warning about them
This commit is contained in:
John Kessenich 2019-10-12 01:55:15 -06:00 committed by GitHub
commit a100258857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 17 deletions

View File

@ -168,6 +168,7 @@ source_set("glslang_sources") {
"-Wno-unused-variable", "-Wno-unused-variable",
"-Wno-missing-field-initializers", "-Wno-missing-field-initializers",
"-Wno-newline-eof", "-Wno-newline-eof",
"-Wextra-semi",
] ]
} }
if (is_win && !is_clang) { if (is_win && !is_clang) {

View File

@ -90,12 +90,12 @@ endif(WIN32)
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs
-Wunused-parameter -Wunused-value -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable -fno-exceptions) -Wunused-parameter -Wunused-value -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable -fno-exceptions)
add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over. add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over.
add_compile_options(-fno-rtti) add_compile_options(-fno-rtti)
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
add_compile_options(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs add_compile_options(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs
-Wunused-parameter -Wunused-value -Wunused-variable) -Wunused-parameter -Wunused-value -Wunused-variable -Wextra-semi)
add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over. add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over.
add_compile_options(-fno-rtti) add_compile_options(-fno-rtti)
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC") elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")

View File

@ -100,11 +100,11 @@ struct OpDecorations {
spv::Decoration precision; spv::Decoration precision;
#ifdef GLSLANG_WEB #ifdef GLSLANG_WEB
void addNoContraction(spv::Builder&, spv::Id) const { }; void addNoContraction(spv::Builder&, spv::Id) const { }
void addNonUniform(spv::Builder&, spv::Id) const { }; void addNonUniform(spv::Builder&, spv::Id) const { }
#else #else
void addNoContraction(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, noContraction); }; void addNoContraction(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, noContraction); }
void addNonUniform(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, nonUniform); }; void addNonUniform(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, nonUniform); }
protected: protected:
spv::Decoration noContraction; spv::Decoration noContraction;
spv::Decoration nonUniform; spv::Decoration nonUniform;

View File

@ -135,8 +135,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool isYuv() const { return yuv; } bool isYuv() const { return yuv; }
#endif #endif
void setCombined(bool c) { combined = c; } void setCombined(bool c) { combined = c; }
void setBasicType(TBasicType t) { type = t; }; void setBasicType(TBasicType t) { type = t; }
TBasicType getBasicType() const { return type; }; TBasicType getBasicType() const { return type; }
bool isShadow() const { return shadow; } bool isShadow() const { return shadow; }
bool isArrayed() const { return arrayed; } bool isArrayed() const { return arrayed; }

View File

@ -283,7 +283,7 @@ public:
const TString* entryPoint = nullptr); const TString* entryPoint = nullptr);
virtual ~TParseContext(); virtual ~TParseContext();
bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); }; bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); }
void setPrecisionDefaults(); void setPrecisionDefaults();
void setLimits(const TBuiltInResource&) override; void setLimits(const TBuiltInResource&) override;

View File

@ -114,7 +114,7 @@ public:
bool doAutoLocationMapping() const; bool doAutoLocationMapping() const;
TSlotSet::iterator findSlot(int set, int slot); TSlotSet::iterator findSlot(int set, int slot);
bool checkEmpty(int set, int slot); bool checkEmpty(int set, int slot);
bool validateInOut(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; }; bool validateInOut(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; }
int reserveSlot(int set, int slot, int size = 1); int reserveSlot(int set, int slot, int size = 1);
int getFreeSlot(int set, int base, int size = 1); int getFreeSlot(int set, int base, int size = 1);
int resolveSet(EShLanguage /*stage*/, TVarEntryInfo& ent) override; int resolveSet(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
@ -125,7 +125,7 @@ public:
void addStage(EShLanguage stage) override { void addStage(EShLanguage stage) override {
if (stage < EShLangCount) if (stage < EShLangCount)
stageMask[stage] = true; stageMask[stage] = true;
}; }
uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage); uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage);
TSlotSetMap slots; TSlotSetMap slots;
@ -191,7 +191,7 @@ public:
typedef std::map<TString, int> TVarSlotMap; // <resourceName, location/binding> typedef std::map<TString, int> TVarSlotMap; // <resourceName, location/binding>
typedef std::map<int, TVarSlotMap> TSlotMap; // <resourceKey, TVarSlotMap> typedef std::map<int, TVarSlotMap> TSlotMap; // <resourceKey, TVarSlotMap>
TDefaultGlslIoResolver(const TIntermediate& intermediate); TDefaultGlslIoResolver(const TIntermediate& intermediate);
bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; }; bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; }
TResourceType getResourceType(const glslang::TType& type) override; TResourceType getResourceType(const glslang::TType& type) override;
int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override; int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override;
int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override; int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
@ -209,7 +209,7 @@ public:
int buildStorageKey(EShLanguage stage, TStorageQualifier type) { int buildStorageKey(EShLanguage stage, TStorageQualifier type) {
assert(static_cast<uint32_t>(stage) <= 0x0000ffff && static_cast<uint32_t>(type) <= 0x0000ffff); assert(static_cast<uint32_t>(stage) <= 0x0000ffff && static_cast<uint32_t>(type) <= 0x0000ffff);
return (stage << 16) | type; return (stage << 16) | type;
}; }
protected: protected:
// Use for mark pre stage, to get more interface symbol information. // Use for mark pre stage, to get more interface symbol information.
@ -242,7 +242,7 @@ struct TVarLivePair : std::pair<const TString, TVarEntryInfo> {
const_cast<TString&>(first) = _Right.first; const_cast<TString&>(first) = _Right.first;
second = _Right.second; second = _Right.second;
return (*this); return (*this);
}; }
}; };
typedef std::vector<TVarLivePair> TVarLiveVector; typedef std::vector<TVarLivePair> TVarLiveVector;
@ -253,7 +253,7 @@ public:
virtual ~TIoMapper() {} virtual ~TIoMapper() {}
// grow the reflection stage by stage // grow the reflection stage by stage
bool virtual addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*); bool virtual addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*);
bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; }; bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; }
}; };
// I/O mapper for OpenGL // I/O mapper for OpenGL

View File

@ -487,7 +487,7 @@ public:
environment.target.version = version; environment.target.version = version;
} }
void getStrings(const char* const* &s, int& n) { s = strings; n = numStrings; }; void getStrings(const char* const* &s, int& n) { s = strings; n = numStrings; }
#ifdef ENABLE_HLSL #ifdef ENABLE_HLSL
void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; } void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; }
@ -775,7 +775,7 @@ public:
TProgram(); TProgram();
virtual ~TProgram(); virtual ~TProgram();
void addShader(TShader* shader) { stages[shader->stage].push_back(shader); } void addShader(TShader* shader) { stages[shader->stage].push_back(shader); }
std::list<TShader*>& getShaders(EShLanguage stage) { return stages[stage]; }; std::list<TShader*>& getShaders(EShLanguage stage) { return stages[stage]; }
// Link Validation interface // Link Validation interface
bool link(EShMessages); bool link(EShMessages);
const char* getInfoLog(); const char* getInfoLog();