OSDN Git Service

[MergeICmps] Fix build of rL312315 on clang-with-thin-lto-windows:
authorClement Courbet <courbet@google.com>
Fri, 1 Sep 2017 11:51:23 +0000 (11:51 +0000)
committerClement Courbet <courbet@google.com>
Fri, 1 Sep 2017 11:51:23 +0000 (11:51 +0000)
MergeICmps.cpp(68,15): error: chosen constructor is explicit in copy-initialization
      return {};
APInt.h(339,12): note: explicit constructor declared here
  explicit APInt() : BitWidth(1) { U.VAL = 0; }
             ^
MergeICmps.cpp(56,9): note: in implicit initialization of field 'Offset' with omitted
initializer
  APInt Offset;
          ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312326 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/MergeICmps.cpp

index 3bd24eb..7bd7300 100644 (file)
@@ -45,14 +45,16 @@ namespace {
 
 // A BCE atom.
 struct BCEAtom {
+  BCEAtom() : GEP(nullptr), LoadI(nullptr), Offset() {}
+
   const Value *Base() const { return GEP ? GEP->getPointerOperand() : nullptr; }
 
   bool operator<(const BCEAtom &O) const {
     return Base() == O.Base() ? Offset.slt(O.Offset) : Base() < O.Base();
   }
 
-  GetElementPtrInst *GEP = nullptr;
-  LoadInst *LoadI = nullptr;
+  GetElementPtrInst *GEP;
+  LoadInst *LoadI;
   APInt Offset;
 };