From 50c7531ed47b183d1d1231cd2dbba336888fe0bb Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Fri, 1 Sep 2017 11:51:23 +0000 Subject: [PATCH] [MergeICmps] Fix build of rL312315 on clang-with-thin-lto-windows: 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/MergeICmps.cpp b/lib/Transforms/Scalar/MergeICmps.cpp index 3bd24eb8601..7bd730014c8 100644 --- a/lib/Transforms/Scalar/MergeICmps.cpp +++ b/lib/Transforms/Scalar/MergeICmps.cpp @@ -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; }; -- 2.11.0