-#include "llvm/Target/MachineInstrInfo.h"
-#include "llvm/Constant.h"
-#include "llvm/DerivedTypes.h"
-
-// External object describing the machine instructions
-// Initialized only when the TargetMachine class is created
-// and reset when that class is destroyed.
-//
-const MachineInstrDescriptor* TargetInstrDescriptors = 0;
-
-//---------------------------------------------------------------------------
-// class MachineInstructionInfo
-// Interface to description of machine instructions
-//---------------------------------------------------------------------------
-
-
-MachineInstrInfo::MachineInstrInfo(const MachineInstrDescriptor* Desc,
- unsigned DescSize,
- unsigned NumRealOpCodes)
- : desc(Desc), descSize(DescSize), numRealOpCodes(NumRealOpCodes) {
- // FIXME: TargetInstrDescriptors should not be global
- assert(TargetInstrDescriptors == NULL && desc != NULL);
- TargetInstrDescriptors = desc; // initialize global variable
+#include "llvm/Target/TargetInstrInfo.h"
+#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/Support/ErrorHandling.h"
+using namespace llvm;
+
+//===----------------------------------------------------------------------===//
+// TargetOperandInfo
+//===----------------------------------------------------------------------===//
+
+/// getRegClass - Get the register class for the operand, handling resolution
+/// of "symbolic" pointer register classes etc. If this is not a register
+/// operand, this returns null.
+const TargetRegisterClass *
+TargetOperandInfo::getRegClass(const TargetRegisterInfo *TRI) const {
+ if (isLookupPtrRegClass())
+ return TRI->getPointerRegClass(RegClass);
+ return TRI->getRegClass(RegClass);