Subzero: Fix g++ warnings.
This tries to use the same -W options that the buildbots use, to reduce the amount of warning spam in the logs.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/1575873006 .
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index ddf6342..a7b367c 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -23,8 +23,11 @@
#include "IceInst.h"
#include "IceOperand.h"
+#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
+#endif // __clang__
+
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Bitcode/NaCl/NaClBitcodeDecoders.h"
@@ -35,8 +38,12 @@
#include "llvm/Support/Format.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
-#include <unordered_set>
+
+#ifdef __clang__
#pragma clang diagnostic pop
+#endif // __clang__
+
+#include <unordered_set>
// Define a hash function for SmallString's, so that it can be used in hash
// tables.
@@ -190,7 +197,7 @@
"IntType and FpType should be the same width");
assert(BitWidth == sizeof(IntType) * CHAR_BIT);
auto V = static_cast<IntType>(Val);
- return reinterpret_cast<FpType &>(V);
+ return Ice::Utils::bitCopy<FpType>(V);
}
private: