diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-12-15 07:26:51 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-12-15 07:26:51 +0000 |
| commit | 2f3da9b2059acbba071d7a38589d8cd373383dfa (patch) | |
| tree | c2dec7e4b5e98d3d69cdbeaaecbe76da1269befa | |
| parent | 45d040bd85e0775156c65d99b329b7da5e764ef7 (diff) | |
| download | bcm5719-llvm-2f3da9b2059acbba071d7a38589d8cd373383dfa.tar.gz bcm5719-llvm-2f3da9b2059acbba071d7a38589d8cd373383dfa.zip | |
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
| -rw-r--r-- | clang/include/clang/AST/DeclarationName.h | 5 | ||||
| -rw-r--r-- | clang/include/clang/AST/TypeOrdering.h | 11 | ||||
| -rw-r--r-- | clang/include/clang/Analysis/ProgramPoint.h | 7 | ||||
| -rw-r--r-- | clang/include/clang/Basic/IdentifierTable.h | 6 | ||||
| -rw-r--r-- | clang/include/clang/Basic/SourceLocation.h | 8 | ||||
| -rw-r--r-- | clang/include/clang/Frontend/PCHWriter.h | 1 | ||||
| -rw-r--r-- | clang/include/clang/Index/Entity.h | 5 | ||||
| -rw-r--r-- | clang/include/clang/Index/GlobalSelector.h | 5 | ||||
| -rw-r--r-- | clang/lib/Analysis/CFRefCount.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/CodeGen/GlobalDecl.h | 15 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 7 |
11 files changed, 36 insertions, 40 deletions
diff --git a/clang/include/clang/AST/DeclarationName.h b/clang/include/clang/AST/DeclarationName.h index 676bd2ca733..fcb4ae52e7e 100644 --- a/clang/include/clang/AST/DeclarationName.h +++ b/clang/include/clang/AST/DeclarationName.h @@ -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 diff --git a/clang/include/clang/AST/TypeOrdering.h b/clang/include/clang/AST/TypeOrdering.h index 652f4f70bd1..d97e5b04a24 100644 --- a/clang/include/clang/AST/TypeOrdering.h +++ b/clang/include/clang/AST/TypeOrdering.h @@ -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 diff --git a/clang/include/clang/Analysis/ProgramPoint.h b/clang/include/clang/Analysis/ProgramPoint.h index 78827dfabe2..5abe1abd5d3 100644 --- a/clang/include/clang/Analysis/ProgramPoint.h +++ b/clang/include/clang/Analysis/ProgramPoint.h @@ -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 diff --git a/clang/include/clang/Basic/IdentifierTable.h b/clang/include/clang/Basic/IdentifierTable.h index 53939500e72..75a7b8192c5 100644 --- a/clang/include/clang/Basic/IdentifierTable.h +++ b/clang/include/clang/Basic/IdentifierTable.h @@ -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. diff --git a/clang/include/clang/Basic/SourceLocation.h b/clang/include/clang/Basic/SourceLocation.h index 28cf2db9bc2..36baf5feecc 100644 --- a/clang/include/clang/Basic/SourceLocation.h +++ b/clang/include/clang/Basic/SourceLocation.h @@ -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 diff --git a/clang/include/clang/Frontend/PCHWriter.h b/clang/include/clang/Frontend/PCHWriter.h index a4bc3ff5b0b..212130e2ea6 100644 --- a/clang/include/clang/Frontend/PCHWriter.h +++ b/clang/include/clang/Frontend/PCHWriter.h @@ -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); } diff --git a/clang/include/clang/Index/Entity.h b/clang/include/clang/Index/Entity.h index 4533a1a0ac0..c2aab62e23f 100644 --- a/clang/include/clang/Index/Entity.h +++ b/clang/include/clang/Index/Entity.h @@ -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 diff --git a/clang/include/clang/Index/GlobalSelector.h b/clang/include/clang/Index/GlobalSelector.h index 51f98267f35..9cd83a8595b 100644 --- a/clang/include/clang/Index/GlobalSelector.h +++ b/clang/include/clang/Index/GlobalSelector.h @@ -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 diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 1df4f7cb519..9639ad98fa6 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -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 { diff --git a/clang/lib/CodeGen/GlobalDecl.h b/clang/lib/CodeGen/GlobalDecl.h index b812020f2aa..b054312a018 100644 --- a/clang/lib/CodeGen/GlobalDecl.h +++ b/clang/lib/CodeGen/GlobalDecl.h @@ -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 diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 42ac6f19b0e..4ce9330fc14 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -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()) |

