mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
implement simplify_type for PATypeHolder so that isa<FooType>(PATypeHolder)
works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61448 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f0569be4a9
commit
793b2e3f6f
@ -33,6 +33,7 @@ namespace llvm {
|
||||
|
||||
class Type;
|
||||
class DerivedType;
|
||||
template<typename T> struct simplify_type;
|
||||
|
||||
/// The AbstractTypeUser class is an interface to be implemented by classes who
|
||||
/// could possibly use an abstract type. Abstract types are denoted by the
|
||||
@ -174,6 +175,21 @@ private:
|
||||
void dropRef();
|
||||
};
|
||||
|
||||
// simplify_type - Allow clients to treat uses just like values when using
|
||||
// casting operators.
|
||||
template<> struct simplify_type<PATypeHolder> {
|
||||
typedef const Type* SimpleType;
|
||||
static SimpleType getSimplifiedValue(const PATypeHolder &Val) {
|
||||
return static_cast<SimpleType>(Val.get());
|
||||
}
|
||||
};
|
||||
template<> struct simplify_type<const PATypeHolder> {
|
||||
typedef const Type* SimpleType;
|
||||
static SimpleType getSimplifiedValue(const PATypeHolder &Val) {
|
||||
return static_cast<SimpleType>(Val.get());
|
||||
}
|
||||
};
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user