forked from OSchip/llvm-project
update to match LLVM API change:
Remove isPod() from DenseMapInfo, splitting it out to its own isPodLike type trait. This is a generally useful type trait for more than just DenseMap, and we really care about whether something acts like a pod, not whether it really is a pod. llvm-svn: 91422
This commit is contained in:
parent
45d040bd85
commit
2f3da9b205
|
@ -387,10 +387,11 @@ struct DenseMapInfo<clang::DeclarationName> {
|
|||
isEqual(clang::DeclarationName LHS, clang::DeclarationName RHS) {
|
||||
return LHS == RHS;
|
||||
}
|
||||
|
||||
static inline bool isPod() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct isPodLike<clang::DeclarationName> { static const bool value = true; };
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
#endif
|
||||
|
|
|
@ -50,14 +50,11 @@ namespace llvm {
|
|||
static bool isEqual(clang::QualType LHS, clang::QualType RHS) {
|
||||
return LHS == RHS;
|
||||
}
|
||||
|
||||
static bool isPod() {
|
||||
// QualType isn't *technically* a POD type. However, we can get
|
||||
// away with calling it a POD type since its copy constructor,
|
||||
// copy assignment operator, and destructor are all trivial.
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// FIXME: Move to Type.h
|
||||
template <>
|
||||
struct isPodLike<clang::QualType> { static const bool value = true; };
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -333,10 +333,11 @@ static bool isEqual(const clang::ProgramPoint& L,
|
|||
return L == R;
|
||||
}
|
||||
|
||||
static bool isPod() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct isPodLike<clang::ProgramPoint> { static const bool value = true; };
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
#endif
|
||||
|
|
|
@ -532,9 +532,11 @@ struct DenseMapInfo<clang::Selector> {
|
|||
static bool isEqual(clang::Selector LHS, clang::Selector RHS) {
|
||||
return LHS == RHS;
|
||||
}
|
||||
|
||||
static bool isPod() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct isPodLike<clang::Selector> { static const bool value = true; };
|
||||
|
||||
|
||||
// Provide PointerLikeTypeTraits for IdentifierInfo pointers, which
|
||||
// are not guaranteed to be 8-byte aligned.
|
||||
|
|
|
@ -21,6 +21,7 @@ namespace llvm {
|
|||
class MemoryBuffer;
|
||||
class raw_ostream;
|
||||
template <typename T> struct DenseMapInfo;
|
||||
template <typename T> struct isPodLike;
|
||||
}
|
||||
|
||||
namespace clang {
|
||||
|
@ -296,9 +297,12 @@ namespace llvm {
|
|||
static bool isEqual(clang::FileID LHS, clang::FileID RHS) {
|
||||
return LHS == RHS;
|
||||
}
|
||||
|
||||
static bool isPod() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct isPodLike<clang::SourceLocation> { static const bool value = true; };
|
||||
template <>
|
||||
struct isPodLike<clang::FileID> { static const bool value = true; };
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ class TargetInfo;
|
|||
/// DenseMap. This uses the standard pointer hash function.
|
||||
struct UnsafeQualTypeDenseMapInfo {
|
||||
static inline bool isEqual(QualType A, QualType B) { return A == B; }
|
||||
static inline bool isPod() { return true; }
|
||||
static inline QualType getEmptyKey() {
|
||||
return QualType::getFromOpaquePtr((void*) 1);
|
||||
}
|
||||
|
|
|
@ -134,9 +134,10 @@ struct DenseMapInfo<clang::idx::Entity> {
|
|||
isEqual(clang::idx::Entity LHS, clang::idx::Entity RHS) {
|
||||
return LHS == RHS;
|
||||
}
|
||||
|
||||
static inline bool isPod() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct isPodLike<clang::idx::Entity> { static const bool value = true; };
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
|
|
|
@ -90,9 +90,10 @@ struct DenseMapInfo<clang::idx::GlobalSelector> {
|
|||
isEqual(clang::idx::GlobalSelector LHS, clang::idx::GlobalSelector RHS) {
|
||||
return LHS == RHS;
|
||||
}
|
||||
|
||||
static inline bool isPod() { return true; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct isPodLike<clang::idx::GlobalSelector> { static const bool value = true;};
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
|
|
|
@ -675,11 +675,9 @@ template <> struct DenseMapInfo<ObjCSummaryKey> {
|
|||
RHS.getSelector());
|
||||
}
|
||||
|
||||
static bool isPod() {
|
||||
return DenseMapInfo<ObjCInterfaceDecl*>::isPod() &&
|
||||
DenseMapInfo<Selector>::isPod();
|
||||
}
|
||||
};
|
||||
template <>
|
||||
struct isPodLike<ObjCSummaryKey> { static const bool value = true; };
|
||||
} // end llvm namespace
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -96,15 +96,14 @@ namespace llvm {
|
|||
return LHS == RHS;
|
||||
}
|
||||
|
||||
static bool isPod() {
|
||||
// GlobalDecl isn't *technically* a POD type. However, we can get
|
||||
// away with calling it a POD type since its copy constructor,
|
||||
// copy assignment operator, and destructor are all trivial.
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
// GlobalDecl isn't *technically* a POD type. However, its copy constructor,
|
||||
// copy assignment operator, and destructor are all trivial.
|
||||
template <>
|
||||
struct isPodLike<clang::CodeGen::GlobalDecl> {
|
||||
static const bool value = true;
|
||||
};
|
||||
} // end namespace llvm
|
||||
|
||||
#endif
|
||||
|
|
|
@ -240,13 +240,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
namespace llvm {
|
||||
template<>
|
||||
struct DenseMapInfo<ResultBuilder::ShadowMapEntry> {
|
||||
static bool isPod() { return false; }
|
||||
};
|
||||
}
|
||||
|
||||
ResultBuilder::ShadowMapEntry::iterator
|
||||
ResultBuilder::ShadowMapEntry::begin() const {
|
||||
if (DeclOrVector.isNull())
|
||||
|
|
Loading…
Reference in New Issue