aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/DeclGroup.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-29 14:23:52 +0000
committerChris Lattner <sabre@nondot.org>2009-03-29 14:23:52 +0000
commitd51a183ffd7de05374ef20977e17ab4444bd633c (patch)
treeec7c2c6e33bba855558df47d6bf033ca8c43e0a3 /include/clang/AST/DeclGroup.h
parent5144832ae62cf97543b274d4bb88d5f74d0f7a20 (diff)
Implement PointerLikeTypeTraits for DeclGroupRef.
Make OpaquePtr work with things that are pointer-like but not necessarily pointers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67998 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/DeclGroup.h')
-rw-r--r--include/clang/AST/DeclGroup.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/clang/AST/DeclGroup.h b/include/clang/AST/DeclGroup.h
index 3a57281bc0..b1c2575361 100644
--- a/include/clang/AST/DeclGroup.h
+++ b/include/clang/AST/DeclGroup.h
@@ -134,4 +134,21 @@ public:
};
} // end clang namespace
+
+namespace llvm {
+ // DeclGroupRef is "like a pointer", implement PointerLikeTypeTraits.
+ template <typename T>
+ class PointerLikeTypeTraits;
+ template <>
+ class PointerLikeTypeTraits<clang::DeclGroupRef> {
+ public:
+ static inline void *getAsVoidPointer(clang::DeclGroupRef P) {
+ return P.getAsOpaquePtr();
+ }
+ static inline clang::DeclGroupRef getFromVoidPointer(void *P) {
+ return clang::DeclGroupRef::getFromOpaquePtr(P);
+ }
+ enum { NumLowBitsAvailable = 0 };
+ };
+}
#endif