Fix the build for clang 3.8 and MINIMAL=1.
3.8 has stricter warnings which LLVM doesn't pass so we turn them off when
including the offending headers.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/1318883007 .
diff --git a/src/IceClFlagsExtra.h b/src/IceClFlagsExtra.h
index 46000e3..8086dc9 100644
--- a/src/IceClFlagsExtra.h
+++ b/src/IceClFlagsExtra.h
@@ -19,6 +19,7 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
+#pragma clang diagnostic ignored "-Wredundant-move"
#include "llvm/IRReader/IRReader.h"
#pragma clang diagnostic pop
diff --git a/src/IceGlobalInits.h b/src/IceGlobalInits.h
index fb86f7c..c6804de 100644
--- a/src/IceGlobalInits.h
+++ b/src/IceGlobalInits.h
@@ -24,6 +24,7 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
+#pragma clang diagnostic ignored "-Wredundant-move"
#include "llvm/Bitcode/NaCl/NaClBitcodeParser.h" // for NaClBitcodeRecord.
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/GlobalValue.h" // for GlobalValue::LinkageTypes.
diff --git a/src/IceTargetLoweringARM32.cpp b/src/IceTargetLoweringARM32.cpp
index 423572c..167e37c 100644
--- a/src/IceTargetLoweringARM32.cpp
+++ b/src/IceTargetLoweringARM32.cpp
@@ -56,7 +56,6 @@
ICMPARM32_TABLE
#undef X
};
-const size_t TableIcmp32Size = llvm::array_lengthof(TableIcmp32);
// The following table summarizes the logic for lowering the icmp instruction
// for the i64 type. Two conditional moves are needed for setting to 1 or 0.
@@ -73,11 +72,10 @@
ICMPARM32_TABLE
#undef X
};
-const size_t TableIcmp64Size = llvm::array_lengthof(TableIcmp64);
CondARM32::Cond getIcmp32Mapping(InstIcmp::ICond Cond) {
size_t Index = static_cast<size_t>(Cond);
- assert(Index < TableIcmp32Size);
+ assert(Index < llvm::array_lengthof(TableIcmp32));
return TableIcmp32[Index].Mapping;
}
@@ -2165,7 +2163,7 @@
if (Src0->getType() == IceType_i64) {
InstIcmp::ICond Conditon = Inst->getCondition();
size_t Index = static_cast<size_t>(Conditon);
- assert(Index < TableIcmp64Size);
+ assert(Index < llvm::array_lengthof(TableIcmp64));
Variable *Src0Lo, *Src0Hi;
Operand *Src1LoRF, *Src1HiRF;
if (TableIcmp64[Index].Swapped) {
diff --git a/src/IceTypeConverter.h b/src/IceTypeConverter.h
index 81dde92..cb3536c 100644
--- a/src/IceTypeConverter.h
+++ b/src/IceTypeConverter.h
@@ -18,7 +18,11 @@
#include "IceDefs.h"
#include "IceTypes.h"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-parameter"
+#pragma clang diagnostic ignored "-Wredundant-move"
#include "llvm/IR/DerivedTypes.h"
+#pragma clang diagnostic pop
namespace llvm {
class LLVMContext;