From: Hans Wennborg Date: Tue, 9 Dec 2014 20:39:15 +0000 (+0000) Subject: Try fixing MSVC build after r223802 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=86704cc3557b8933c2dd49fb130b9c5ace27e3f7;p=oota-llvm.git Try fixing MSVC build after r223802 LLVM_EXPLICIT is only supported by recent version of MSVC, and it seems the not-so-recent versions get confused about the operator bool() when tryint to resolve operator== calls. This removed the operator bool()'s since they don't seem to be used anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223824 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/IR/Metadata.h b/include/llvm/IR/Metadata.h index 56699b0fc4d..81107e69806 100644 --- a/include/llvm/IR/Metadata.h +++ b/include/llvm/IR/Metadata.h @@ -525,7 +525,6 @@ public: MDOperand() : MD(nullptr) {} ~MDOperand() { untrack(); } - LLVM_EXPLICIT operator bool() const { return get(); } Metadata *get() const { return MD; } operator Metadata *() const { return get(); } Metadata *operator->() const { return get(); } diff --git a/include/llvm/IR/TrackingMDRef.h b/include/llvm/IR/TrackingMDRef.h index 6e1b1bd1510..ea621c1d95e 100644 --- a/include/llvm/IR/TrackingMDRef.h +++ b/include/llvm/IR/TrackingMDRef.h @@ -55,7 +55,6 @@ public: } ~TrackingMDRef() { untrack(); } - LLVM_EXPLICIT operator bool() const { return get(); } Metadata *get() const { return MD; } operator Metadata *() const { return get(); } Metadata *operator->() const { return get(); } @@ -121,7 +120,6 @@ public: return *this; } - LLVM_EXPLICIT operator bool() const { return get(); } T *get() const { return (T *)Ref.get(); } operator T *() const { return get(); } T *operator->() const { return get(); } diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index c31cd6dd915..c99d885a668 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -662,7 +662,7 @@ static void VerifySubsetOf(const MDNode *LHS, const MDNode *RHS) { const MDNode *E = cast(LHS->getOperand(i)); bool found = false; for (unsigned j = 0; !found && j != RHS->getNumOperands(); ++j) - found = E == RHS->getOperand(j); + found = (E == cast(RHS->getOperand(j))); assert(found && "Losing a member during member list replacement"); } }