+template<> struct simplify_type<Use> {
+ typedef Value* SimpleType;
+
+ static SimpleType getSimplifiedValue(const Use &Val) {
+ return (SimpleType)Val.get();
+ }
+};
+template<> struct simplify_type<const Use> {
+ typedef Value* SimpleType;
+
+ static SimpleType getSimplifiedValue(const Use &Val) {
+ return (SimpleType)Val.get();
+ }
+};
+
+// isa - Provide some specializations of isa so that we don't have to include
+// the subtype header files to test to see if the value is a subclass...
+//
+template <> inline bool isa_impl<Type, Value>(const Value &Val) {
+ return Val.getValueType() == Value::TypeVal;
+}
+template <> inline bool isa_impl<Constant, Value>(const Value &Val) {
+ return Val.getValueType() == Value::ConstantVal;
+}
+template <> inline bool isa_impl<Argument, Value>(const Value &Val) {
+ return Val.getValueType() == Value::ArgumentVal;
+}
+template <> inline bool isa_impl<Instruction, Value>(const Value &Val) {
+ return Val.getValueType() == Value::InstructionVal;
+}
+template <> inline bool isa_impl<BasicBlock, Value>(const Value &Val) {
+ return Val.getValueType() == Value::BasicBlockVal;
+}
+template <> inline bool isa_impl<Function, Value>(const Value &Val) {
+ return Val.getValueType() == Value::FunctionVal;
+}
+template <> inline bool isa_impl<GlobalVariable, Value>(const Value &Val) {
+ return Val.getValueType() == Value::GlobalVariableVal;
+}
+template <> inline bool isa_impl<GlobalValue, Value>(const Value &Val) {
+ return isa<GlobalVariable>(Val) || isa<Function>(Val);
+}