Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229335 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Aaron Ballman 2015-02-15 22:00:20 +00:00
parent 734d358274
commit d898d31ebc
18 changed files with 55 additions and 65 deletions

View File

@ -496,7 +496,7 @@ public:
NodeRef() {} NodeRef() {}
/// operator bool - Detect a null ref. /// operator bool - Detect a null ref.
LLVM_EXPLICIT operator bool() const { return pip.getOpaqueValue(); } explicit operator bool() const { return pip.getOpaqueValue(); }
/// NodeRef - Create a reference to the node p with n elements. /// NodeRef - Create a reference to the node p with n elements.
template <typename NodeT> template <typename NodeT>

View File

@ -177,7 +177,7 @@ public:
T* get() const { return Obj; } T* get() const { return Obj; }
LLVM_EXPLICIT operator bool() const { return Obj; } explicit operator bool() const { return Obj; }
void swap(IntrusiveRefCntPtr& other) { void swap(IntrusiveRefCntPtr& other) {
T* tmp = other.Obj; T* tmp = other.Obj;

View File

@ -121,7 +121,7 @@ public:
const T& getValue() const LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); } const T& getValue() const LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); }
T& getValue() LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); } T& getValue() LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); }
LLVM_EXPLICIT operator bool() const { return hasVal; } explicit operator bool() const { return hasVal; }
bool hasValue() const { return hasVal; } bool hasValue() const { return hasVal; }
const T* operator->() const { return getPointer(); } const T* operator->() const { return getPointer(); }
T* operator->() { return getPointer(); } T* operator->() { return getPointer(); }

View File

@ -111,7 +111,7 @@ namespace llvm {
// we recursively strip off low bits if we have a nested PointerUnion. // we recursively strip off low bits if we have a nested PointerUnion.
return !PointerLikeTypeTraits<PT1>::getFromVoidPointer(Val.getPointer()); return !PointerLikeTypeTraits<PT1>::getFromVoidPointer(Val.getPointer());
} }
LLVM_EXPLICIT operator bool() const { return !isNull(); } explicit operator bool() const { return !isNull(); }
/// is<T>() return true if the Union currently holds the type matching T. /// is<T>() return true if the Union currently holds the type matching T.
template<typename T> template<typename T>
@ -271,7 +271,7 @@ namespace llvm {
/// isNull - Return true if the pointer held in the union is null, /// isNull - Return true if the pointer held in the union is null,
/// regardless of which type it is. /// regardless of which type it is.
bool isNull() const { return Val.isNull(); } bool isNull() const { return Val.isNull(); }
LLVM_EXPLICIT operator bool() const { return !isNull(); } explicit operator bool() const { return !isNull(); }
/// is<T>() return true if the Union currently holds the type matching T. /// is<T>() return true if the Union currently holds the type matching T.
template<typename T> template<typename T>
@ -385,7 +385,7 @@ namespace llvm {
/// isNull - Return true if the pointer held in the union is null, /// isNull - Return true if the pointer held in the union is null,
/// regardless of which type it is. /// regardless of which type it is.
bool isNull() const { return Val.isNull(); } bool isNull() const { return Val.isNull(); }
LLVM_EXPLICIT operator bool() const { return !isNull(); } explicit operator bool() const { return !isNull(); }
/// is<T>() return true if the Union currently holds the type matching T. /// is<T>() return true if the Union currently holds the type matching T.
template<typename T> template<typename T>

View File

@ -77,7 +77,7 @@ public:
} }
/// \brief Test whether the inline cost is low enough for inlining. /// \brief Test whether the inline cost is low enough for inlining.
LLVM_EXPLICIT operator bool() const { explicit operator bool() const {
return Cost < Threshold; return Cost < Threshold;
} }

View File

@ -145,7 +145,7 @@ public:
bool operator<(const SDValue &O) const { bool operator<(const SDValue &O) const {
return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo); return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo);
} }
LLVM_EXPLICIT operator bool() const { explicit operator bool() const {
return Node != nullptr; return Node != nullptr;
} }

View File

@ -162,7 +162,7 @@ namespace llvm {
} }
/// Return true for a valid index. /// Return true for a valid index.
LLVM_EXPLICIT operator bool() const { return isValid(); } explicit operator bool() const { return isValid(); }
/// Print this index to the given raw_ostream. /// Print this index to the given raw_ostream.
void print(raw_ostream &os) const; void print(raw_ostream &os) const;

View File

@ -34,7 +34,7 @@ public:
: CachedAddr(0), GetAddress(std::move(GetAddress)) {} : CachedAddr(0), GetAddress(std::move(GetAddress)) {}
/// @brief Returns true if the symbol exists, false otherwise. /// @brief Returns true if the symbol exists, false otherwise.
LLVM_EXPLICIT operator bool() const { return CachedAddr || GetAddress; } explicit operator bool() const { return CachedAddr || GetAddress; }
/// @brief Get the address of the symbol in the target address space. Returns /// @brief Get the address of the symbol in the target address space. Returns
/// '0' if the symbol does not exist. /// '0' if the symbol does not exist.

View File

@ -78,7 +78,7 @@ public:
InstrTy *getInstruction() const { return I.getPointer(); } InstrTy *getInstruction() const { return I.getPointer(); }
InstrTy *operator->() const { return I.getPointer(); } InstrTy *operator->() const { return I.getPointer(); }
LLVM_EXPLICIT operator bool() const { return I.getPointer(); } explicit operator bool() const { return I.getPointer(); }
/// getCalledValue - Return the pointer to function that is being called. /// getCalledValue - Return the pointer to function that is being called.
/// ///

View File

@ -186,7 +186,7 @@ public:
// FIXME: This operator bool isn't actually protecting anything at the // FIXME: This operator bool isn't actually protecting anything at the
// moment due to the conversion operator above making DIDescriptor nodes // moment due to the conversion operator above making DIDescriptor nodes
// implicitly convertable to bool. // implicitly convertable to bool.
LLVM_EXPLICIT operator bool() const { return DbgNode != nullptr; } explicit operator bool() const { return DbgNode != nullptr; }
bool operator==(DIDescriptor Other) const { return DbgNode == Other.DbgNode; } bool operator==(DIDescriptor Other) const { return DbgNode == Other.DbgNode; }
bool operator!=(DIDescriptor Other) const { return !operator==(Other); } bool operator!=(DIDescriptor Other) const { return !operator==(Other); }

View File

@ -512,7 +512,7 @@ struct AAMDNodes {
bool operator!=(const AAMDNodes &A) const { return !(*this == A); } bool operator!=(const AAMDNodes &A) const { return !(*this == A); }
LLVM_EXPLICIT operator bool() const { return TBAA || Scope || NoAlias; } explicit operator bool() const { return TBAA || Scope || NoAlias; }
/// \brief The tag for type-based alias analysis. /// \brief The tag for type-based alias analysis.
MDNode *TBAA; MDNode *TBAA;

View File

@ -339,16 +339,6 @@
# define LLVM_IS_UNALIGNED_ACCESS_FAST 0 # define LLVM_IS_UNALIGNED_ACCESS_FAST 0
#endif #endif
/// \macro LLVM_EXPLICIT
/// \brief Expands to explicit on compilers which support explicit conversion
/// operators. Otherwise expands to nothing.
#if __has_feature(cxx_explicit_conversions) || \
defined(__GXX_EXPERIMENTAL_CXX0X__)
#define LLVM_EXPLICIT explicit
#else
#define LLVM_EXPLICIT
#endif
/// \brief Does the compiler support generalized initializers (using braced /// \brief Does the compiler support generalized initializers (using braced
/// lists and std::initializer_list). While clang may claim it supports general /// lists and std::initializer_list). While clang may claim it supports general
/// initializers, if we're using MSVC's headers, we might not have a usable /// initializers, if we're using MSVC's headers, we might not have a usable

View File

@ -168,7 +168,7 @@ public:
} }
/// \brief Return false if there is an error. /// \brief Return false if there is an error.
LLVM_EXPLICIT operator bool() const { explicit operator bool() const {
return !HasError; return !HasError;
} }

View File

@ -129,7 +129,7 @@ namespace llvm {
} }
inline const char *operator*() const { return begin(); } inline const char *operator*() const { return begin(); }
inline LLVM_EXPLICIT operator bool() const { return S != nullptr; } inline explicit operator bool() const { return S != nullptr; }
inline bool operator==(const PooledStringPtr &That) const { return S == That.S; } inline bool operator==(const PooledStringPtr &That) const { return S == That.S; }
inline bool operator!=(const PooledStringPtr &That) const { return S != That.S; } inline bool operator!=(const PooledStringPtr &That) const { return S != That.S; }

View File

@ -92,7 +92,7 @@ public:
} }
// True if Handle is valid. // True if Handle is valid.
LLVM_EXPLICIT operator bool() const { explicit operator bool() const {
return HandleTraits::IsValid(Handle) ? true : false; return HandleTraits::IsValid(Handle) ? true : false;
} }

View File

@ -47,7 +47,7 @@ struct Reference {
return *this; return *this;
} }
LLVM_EXPLICIT operator bool() const { return Def || Use; } explicit operator bool() const { return Def || Use; }
// True if the register is defined or used in some form, either directly or // True if the register is defined or used in some form, either directly or
// via a sub- or super-register. // via a sub- or super-register.

View File

@ -633,7 +633,7 @@ struct LogicOp {
LogicOp(unsigned regSize, unsigned immLSB, unsigned immSize) LogicOp(unsigned regSize, unsigned immLSB, unsigned immSize)
: RegSize(regSize), ImmLSB(immLSB), ImmSize(immSize) {} : RegSize(regSize), ImmLSB(immLSB), ImmSize(immSize) {}
LLVM_EXPLICIT operator bool() const { return RegSize; } explicit operator bool() const { return RegSize; }
unsigned RegSize, ImmLSB, ImmSize; unsigned RegSize, ImmLSB, ImmSize;
}; };

View File

@ -250,7 +250,7 @@ class PTy {
Base *B; Base *B;
public: public:
PTy(Base *B) : B(B) {} PTy(Base *B) : B(B) {}
LLVM_EXPLICIT operator bool() const { return get(); } explicit operator bool() const { return get(); }
Base *get() const { return B; } Base *get() const { return B; }
}; };