OSDN Git Service

Fix the build for clang 3.8 and MINIMAL=1.
authorAndrew Scull <ascull@google.com>
Wed, 9 Sep 2015 18:56:10 +0000 (11:56 -0700)
committerAndrew Scull <ascull@google.com>
Wed, 9 Sep 2015 18:56:10 +0000 (11:56 -0700)
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 .

src/IceClFlagsExtra.h
src/IceGlobalInits.h
src/IceTargetLoweringARM32.cpp
src/IceTypeConverter.h

index 46000e3..8086dc9 100644 (file)
@@ -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
 
index fb86f7c..c6804de 100644 (file)
@@ -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.
index 423572c..167e37c 100644 (file)
@@ -56,7 +56,6 @@ const struct TableIcmp32_ {
     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 @@ const struct TableIcmp64_ {
     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 @@ void TargetARM32::lowerIcmp(const InstIcmp *Inst) {
   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) {
index 81dde92..cb3536c 100644 (file)
 
 #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;