From 0f10d50fe23c08f5133db0ad7269e7995ad9b172 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 5 Feb 2008 22:21:54 +0000 Subject: [PATCH] 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 --- Analysis/RValues.h | 52 +++++++++++++++++++++++++--------------------- 1 file 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(const clang::SymbolData& V) { + return V.getKind() == clang::SymbolData::ParmKind; + } + + template<> struct cast_retty_impl { + typedef const clang::ParmVarDecl* ret_type; + }; + + template<> struct simplify_type { + 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(const clang::SymbolData& V) { - return V.getKind() == clang::SymbolData::ParmKind; -} - -template<> struct cast_retty_impl { - typedef const clang::ParmVarDecl* ret_type; -}; - -template<> struct simplify_type { - typedef void* SimpleType; - static inline SimpleType getSimplifiedValue(const clang::SymbolData &V) { - return V.getPtr(); - } -}; - -} // end llvm namespace - #endif -- 2.40.0