]> granicus.if.org Git - clang/commitdiff
Moved implementation of cast<> for SymbolData closer to SymbolData's definition.
authorTed Kremenek <kremenek@apple.com>
Tue, 5 Feb 2008 22:21:54 +0000 (22:21 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 5 Feb 2008 22:21:54 +0000 (22:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46772 91177308-0d34-0410-b5e6-96231b3b80d8

Analysis/RValues.h

index ef7c82ecddbe469b1406db71fbf3a10f9802d2b7..1db0a185d495a4c742a6f1e629e9401c00e63ee6 100644 (file)
@@ -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