forked from OSchip/llvm-project
Moved implementation of cast<> for SymbolData closer to SymbolData's definition.
llvm-svn: 46772
This commit is contained in:
parent
1ee50cd9c1
commit
8f6dcfaa30
|
@ -153,10 +153,38 @@ public:
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue