]> granicus.if.org Git - clang/commitdiff
update to match LLVM API change:
authorChris Lattner <sabre@nondot.org>
Tue, 15 Dec 2009 07:26:51 +0000 (07:26 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 15 Dec 2009 07:26:51 +0000 (07:26 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91422 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclarationName.h
include/clang/AST/TypeOrdering.h
include/clang/Analysis/ProgramPoint.h
include/clang/Basic/IdentifierTable.h
include/clang/Basic/SourceLocation.h
include/clang/Frontend/PCHWriter.h
include/clang/Index/Entity.h
include/clang/Index/GlobalSelector.h
lib/Analysis/CFRefCount.cpp
lib/CodeGen/GlobalDecl.h
lib/Sema/SemaCodeComplete.cpp

index 676bd2ca7336cb0f894d3271bd2825b3971b9012..fcb4ae52e7eb4b878fc4a04f062072f854af8fd5 100644 (file)
@@ -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
index 652f4f70bd16d3d3d56e2002b14d5bb1843e9ef1..d97e5b04a24361459eca9c0cdd6b5750e76b2ec6 100644 (file)
@@ -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
index 78827dfabe2fb96bb87f0bb01820ab966ad4fc13..5abe1abd5d39cf8f56b5428199a01705d6df0647 100644 (file)
@@ -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
index 53939500e72ad5bffac8e1e10f18f43ba2994db0..75a7b8192c5af04138679719b59875d2291ceccf 100644 (file)
@@ -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.
index 28cf2db9bc25f0c438391676b153f7c20a445215..36baf5feecce25591d444eff6f6b8604613f4b97 100644 (file)
@@ -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
 
index a4bc3ff5b0b61d17e5e3b7563eb065bb4dfd8cb1..212130e2ea62b6ef12573724fa53ac2ec2824ab1 100644 (file)
@@ -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);
   }
index 4533a1a0ac082d763a46a3ec51d28db5ce072faa..c2aab62e23f2a8847800bfbdbb662e4da295f2f0 100644 (file)
@@ -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
 
index 51f98267f3562568054ec864501168566ad731cb..9cd83a8595b97dd7172e71e98c394aaa4ff0779e 100644 (file)
@@ -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
 
index 1df4f7cb51922a38b30d04d06c1e2b27d96a45f5..9639ad98fa69eedcfed1ea8fbdf61ec0e498ad15 100644 (file)
@@ -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 {
index b812020f2aa4503e718875bcf3a4f95f45d72482..b054312a01854e7f79be66e667d31cdab06e9547 100644 (file)
@@ -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
index 42ac6f19b0e5248820a76e7780efb64717ebf02f..4ce9330fc1420f08053d193a3a0b724483c0d0c9 100644 (file)
@@ -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())