Index: include/llvm/ADT/DenseMap.h =================================================================== --- include/llvm/ADT/DenseMap.h +++ include/llvm/ADT/DenseMap.h @@ -99,10 +99,10 @@ setNumTombstones(0); } - /// count - Return true if the specified key is in the map. - bool count(const KeyT &Val) const { + /// Return 1 if the specified key is in the map, 0 otherwise. + unsigned count(const KeyT &Val) const { const BucketT *TheBucket; - return LookupBucketFor(Val, TheBucket); + return LookupBucketFor(Val, TheBucket) ? 1 : 0; } iterator find(const KeyT &Val) { Index: include/llvm/ADT/DenseSet.h =================================================================== --- include/llvm/ADT/DenseSet.h +++ include/llvm/ADT/DenseSet.h @@ -44,7 +44,8 @@ TheMap.clear(); } - bool count(const ValueT &V) const { + /// Return 1 if the specified key is in the set, 0 otherwise. + unsigned count(const ValueT &V) const { return TheMap.count(V); } Index: include/llvm/ADT/ScopedHashTable.h =================================================================== --- include/llvm/ADT/ScopedHashTable.h +++ include/llvm/ADT/ScopedHashTable.h @@ -170,7 +170,8 @@ AllocatorTy &getAllocator() { return Allocator; } const AllocatorTy &getAllocator() const { return Allocator; } - bool count(const K &Key) const { + /// Return 1 if the specified key is in the table, 0 otherwise. + unsigned count(const K &Key) const { return TopLevelMap.count(Key); } Index: include/llvm/IR/ValueMap.h =================================================================== --- include/llvm/IR/ValueMap.h +++ include/llvm/IR/ValueMap.h @@ -108,9 +108,9 @@ void clear() { Map.clear(); } - /// count - Return true if the specified key is in the map. - bool count(const KeyT &Val) const { - return Map.find_as(Val) != Map.end(); + /// Return 1 if the specified key is in the map, 0 otherwise. + unsigned count(const KeyT &Val) const { + return Map.find_as(Val) == Map.end() ? 0 : 1; } iterator find(const KeyT &Val) { Index: lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp =================================================================== --- lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp +++ lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp @@ -308,7 +308,7 @@ return; const Function *GV = MF->getFunction(); - assert(FnDebugInfo.count(GV) == true); + assert(FnDebugInfo.count(GV) == 1); assert(CurFn == &FnDebugInfo[GV]); if (CurFn->Instrs.empty()) { Index: lib/IR/Metadata.cpp =================================================================== --- lib/IR/Metadata.cpp +++ lib/IR/Metadata.cpp @@ -663,7 +663,7 @@ // Otherwise, we're removing metadata from an instruction. assert((hasMetadataHashEntry() == - getContext().pImpl->MetadataStore.count(this)) && + (getContext().pImpl->MetadataStore.count(this) == 1)) && "HasMetadata bit out of date!"); if (!hasMetadataHashEntry()) return; // Nothing to remove!