aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-02-05 22:21:54 +0000
committerTed Kremenek <kremenek@apple.com>2008-02-05 22:21:54 +0000
commit0f10d50fe23c08f5133db0ad7269e7995ad9b172 (patch)
tree2304d5f7f9cfae992a189fa8faf8ee90bdef244c
parent9466aa8cf38aa8e87fe3e2cd8005fc245d04f9b7 (diff)
Moved implementation of cast<> for SymbolData closer to SymbolData's definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46772 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Analysis/RValues.h52
1 files changed, 28 insertions, 24 deletions
diff --git a/Analysis/RValues.h b/Analysis/RValues.h
index ef7c82ecdd..1db0a185d4 100644
--- a/Analysis/RValues.h
+++ b/Analysis/RValues.h
@@ -152,11 +152,39 @@ public:
const SymIntConstraint& getConstraint(SymbolID sym, BinaryOperator::Opcode Op,
const llvm::APSInt& V);
};
+
+} // end clang namespace
+
+//==------------------------------------------------------------------------==//
+// Casting machinery to get cast<> and dyn_cast<> working with SymbolData.
+//==------------------------------------------------------------------------==//
+
+namespace llvm {
+
+ template<> inline bool
+ isa<clang::ParmVarDecl,clang::SymbolData>(const clang::SymbolData& V) {
+ return V.getKind() == clang::SymbolData::ParmKind;
+ }
+
+ template<> struct cast_retty_impl<clang::ParmVarDecl,clang::SymbolData> {
+ typedef const clang::ParmVarDecl* ret_type;
+ };
+
+ template<> struct simplify_type<clang::SymbolData> {
+ typedef void* SimpleType;
+ static inline SimpleType getSimplifiedValue(const clang::SymbolData &V) {
+ return V.getPtr();
+ }
+ };
+
+} // end llvm namespace
//==------------------------------------------------------------------------==//
// Base RValue types.
//==------------------------------------------------------------------------==//
+namespace clang {
+
class RValue {
public:
enum BaseKind { LValueKind=0x0,
@@ -496,28 +524,4 @@ namespace lval {
} // end clang namespace
-//==------------------------------------------------------------------------==//
-// Casting machinery to get cast<> and dyn_cast<> working with SymbolData.
-//==------------------------------------------------------------------------==//
-
-namespace llvm {
-
-template<> inline bool
-isa<clang::ParmVarDecl,clang::SymbolData>(const clang::SymbolData& V) {
- return V.getKind() == clang::SymbolData::ParmKind;
-}
-
-template<> struct cast_retty_impl<clang::ParmVarDecl,clang::SymbolData> {
- typedef const clang::ParmVarDecl* ret_type;
-};
-
-template<> struct simplify_type<clang::SymbolData> {
- typedef void* SimpleType;
- static inline SimpleType getSimplifiedValue(const clang::SymbolData &V) {
- return V.getPtr();
- }
-};
-
-} // end llvm namespace
-
#endif