Try fixing MSVC build after r223802
authorHans Wennborg <hans@hanshq.net>
Tue, 9 Dec 2014 20:39:15 +0000 (20:39 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 9 Dec 2014 20:39:15 +0000 (20:39 +0000)
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

include/llvm/IR/Metadata.h
include/llvm/IR/TrackingMDRef.h
lib/IR/DebugInfo.cpp

index 56699b0fc4d21ce31d63dbb08364457e3a138011..81107e6980670991d0d995fe32f5273c7cdbf690 100644 (file)
@@ -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(); }
index 6e1b1bd151046e1683f71381ba6cb9fb6e5817ab..ea621c1d95e83393aedc8f9c6d6bd8da36ff4984 100644 (file)
@@ -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(); }
index c31cd6dd915328d5c1e736d3f7842974c49b52cb..c99d885a6682e49c4b73539848b2392b293f562f 100644 (file)
@@ -662,7 +662,7 @@ static void VerifySubsetOf(const MDNode *LHS, const MDNode *RHS) {
     const MDNode *E = cast<MDNode>(LHS->getOperand(i));
     bool found = false;
     for (unsigned j = 0; !found && j != RHS->getNumOperands(); ++j)
-      found = E == RHS->getOperand(j);
+      found = (E == cast<MDNode>(RHS->getOperand(j)));
     assert(found && "Losing a member during member list replacement");
   }
 }