Suppress warnings on our second compilation (for 64-bit).
Bug: 16031597
Bug: 17052573
Without this patch the 64-bit compilation path will print duplicate warning
diagnostics, since we call the frontend twice (for 32-bit, and then 64-bit).
The simplest fix is to not print warnings for the second compilation. A bug
(17052573) has been filed to track fixing this a better way (actually printing
out all warning diagnostics, but removing duplicates explicitly).
Change-Id: I78ac0ebd2b132713ec0c86c2cf234da2b620eecf
diff --git a/slang_rs.cpp b/slang_rs.cpp
index 6bb5798..e269e57 100644
--- a/slang_rs.cpp
+++ b/slang_rs.cpp
@@ -324,12 +324,15 @@
// a single pass over the input file.
bool SuppressAllWarnings = (Opts.mOutputType != Slang::OT_Dependency);
+ bool CompileSecondTimeFor64Bit = Opts.mEmit3264 && Opts.mBitWidth == 64;
+
for (unsigned i = 0, e = IOFiles32.size(); i != e; i++) {
InputFile = IOFile64Iter->first;
Output64File = IOFile64Iter->second;
Output32File = IOFile32Iter->second;
- reset();
+ // We suppress warnings (via reset) if we are doing a second compilation.
+ reset(CompileSecondTimeFor64Bit);
if (!setInputSource(InputFile))
return false;
@@ -433,11 +436,11 @@
return true;
}
-void SlangRS::reset() {
+void SlangRS::reset(bool SuppressWarnings) {
delete mRSContext;
mRSContext = NULL;
mGeneratedFileNames.clear();
- Slang::reset();
+ Slang::reset(SuppressWarnings);
}
SlangRS::~SlangRS() {