[cfe-commits] r91422 - in /cfe/trunk: 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
Chris Lattner
sabre at nondot.org
Mon Dec 14 23:26:52 PST 2009
Author: lattner
Date: Tue Dec 15 01:26:51 2009
New Revision: 91422
URL: http://llvm.org/viewvc/llvm-project?rev=91422&view=rev
Log:
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.
Modified:
cfe/trunk/include/clang/AST/DeclarationName.h
cfe/trunk/include/clang/AST/TypeOrdering.h
cfe/trunk/include/clang/Analysis/ProgramPoint.h
cfe/trunk/include/clang/Basic/IdentifierTable.h
cfe/trunk/include/clang/Basic/SourceLocation.h
cfe/trunk/include/clang/Frontend/PCHWriter.h
cfe/trunk/include/clang/Index/Entity.h
cfe/trunk/include/clang/Index/GlobalSelector.h
cfe/trunk/lib/Analysis/CFRefCount.cpp
cfe/trunk/lib/CodeGen/GlobalDecl.h
cfe/trunk/lib/Sema/SemaCodeComplete.cpp
Modified: cfe/trunk/include/clang/AST/DeclarationName.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclarationName.h?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclarationName.h (original)
+++ cfe/trunk/include/clang/AST/DeclarationName.h Tue Dec 15 01:26:51 2009
@@ -387,10 +387,11 @@
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
Modified: cfe/trunk/include/clang/AST/TypeOrdering.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeOrdering.h?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TypeOrdering.h (original)
+++ cfe/trunk/include/clang/AST/TypeOrdering.h Tue Dec 15 01:26:51 2009
@@ -50,14 +50,11 @@
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
Modified: cfe/trunk/include/clang/Analysis/ProgramPoint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/ProgramPoint.h?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/ProgramPoint.h (original)
+++ cfe/trunk/include/clang/Analysis/ProgramPoint.h Tue Dec 15 01:26:51 2009
@@ -333,10 +333,11 @@
return L == R;
}
-static bool isPod() {
- return true;
-}
};
+
+template <>
+struct isPodLike<clang::ProgramPoint> { static const bool value = true; };
+
} // end namespace llvm
#endif
Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Tue Dec 15 01:26:51 2009
@@ -532,9 +532,11 @@
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.
Modified: cfe/trunk/include/clang/Basic/SourceLocation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceLocation.h (original)
+++ cfe/trunk/include/clang/Basic/SourceLocation.h Tue Dec 15 01:26:51 2009
@@ -21,6 +21,7 @@
class MemoryBuffer;
class raw_ostream;
template <typename T> struct DenseMapInfo;
+ template <typename T> struct isPodLike;
}
namespace clang {
@@ -296,9 +297,12 @@
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
Modified: cfe/trunk/include/clang/Frontend/PCHWriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/PCHWriter.h?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/PCHWriter.h (original)
+++ cfe/trunk/include/clang/Frontend/PCHWriter.h Tue Dec 15 01:26:51 2009
@@ -44,7 +44,6 @@
/// 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);
}
Modified: cfe/trunk/include/clang/Index/Entity.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Index/Entity.h?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/include/clang/Index/Entity.h (original)
+++ cfe/trunk/include/clang/Index/Entity.h Tue Dec 15 01:26:51 2009
@@ -134,9 +134,10 @@
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
Modified: cfe/trunk/include/clang/Index/GlobalSelector.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Index/GlobalSelector.h?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/include/clang/Index/GlobalSelector.h (original)
+++ cfe/trunk/include/clang/Index/GlobalSelector.h Tue Dec 15 01:26:51 2009
@@ -90,9 +90,10 @@
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
Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue Dec 15 01:26:51 2009
@@ -675,11 +675,9 @@
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 {
Modified: cfe/trunk/lib/CodeGen/GlobalDecl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/GlobalDecl.h?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/GlobalDecl.h (original)
+++ cfe/trunk/lib/CodeGen/GlobalDecl.h Tue Dec 15 01:26:51 2009
@@ -96,15 +96,14 @@
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
Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=91422&r1=91421&r2=91422&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Tue Dec 15 01:26:51 2009
@@ -240,13 +240,6 @@
}
};
-namespace llvm {
- template<>
- struct DenseMapInfo<ResultBuilder::ShadowMapEntry> {
- static bool isPod() { return false; }
- };
-}
-
ResultBuilder::ShadowMapEntry::iterator
ResultBuilder::ShadowMapEntry::begin() const {
if (DeclOrVector.isNull())
More information about the cfe-commits
mailing list