+typedef UseTy<Value> Use; // Provide Use as a common UseTy type
+
+template<typename From> struct simplify_type<UseTy<From> > {
+ typedef typename simplify_type<From*>::SimpleType SimpleType;
+
+ static SimpleType getSimplifiedValue(const UseTy<From> &Val) {
+ return (SimpleType)Val.get();
+ }
+};
+template<typename From> struct simplify_type<const UseTy<From> > {
+ typedef typename simplify_type<From*>::SimpleType SimpleType;
+
+ static SimpleType getSimplifiedValue(const UseTy<From> &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);
+}