[cfe-commits] r46772 - /cfe/trunk/Analysis/RValues.h
Ted Kremenek
kremenek at apple.com
Tue Feb 5 14:21:54 PST 2008
Author: kremenek
Date: Tue Feb 5 16:21:54 2008
New Revision: 46772
URL: http://llvm.org/viewvc/llvm-project?rev=46772&view=rev
Log:
Moved implementation of cast<> for SymbolData closer to SymbolData's definition.
Modified:
cfe/trunk/Analysis/RValues.h
Modified: cfe/trunk/Analysis/RValues.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/RValues.h?rev=46772&r1=46771&r2=46772&view=diff
==============================================================================
--- cfe/trunk/Analysis/RValues.h (original)
+++ cfe/trunk/Analysis/RValues.h Tue Feb 5 16:21:54 2008
@@ -152,11 +152,39 @@
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 @@
} // 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
More information about the cfe-commits
mailing list