aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/AbstractTypeUser.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/AbstractTypeUser.h b/include/llvm/AbstractTypeUser.h
index f7fabfcb2f..80656d89b7 100644
--- a/include/llvm/AbstractTypeUser.h
+++ b/include/llvm/AbstractTypeUser.h
@@ -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