summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-30 05:33:48 +0000
committerChris Lattner <sabre@nondot.org>2003-07-30 05:33:48 +0000
commitea6aac412df9d1b62117a98f3dcecc0d75c93a46 (patch)
tree9763b1e044f3de863135becc2940c45e32d3c716 /llvm/lib/Target
parenta8f5df593b258373523a65c19524d8101349cfa6 (diff)
downloadbcm5719-llvm-ea6aac412df9d1b62117a98f3dcecc0d75c93a46.tar.gz
bcm5719-llvm-ea6aac412df9d1b62117a98f3dcecc0d75c93a46.zip
Use target specific interface instead of forcing it to be target-generic
llvm-svn: 7413
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/InstSelectSimple.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/InstSelectSimple.cpp b/llvm/lib/Target/X86/InstSelectSimple.cpp
index 83987df7e29..79dbedcdc11 100644
--- a/llvm/lib/Target/X86/InstSelectSimple.cpp
+++ b/llvm/lib/Target/X86/InstSelectSimple.cpp
@@ -219,9 +219,12 @@ namespace {
/// of the long value.
///
unsigned makeAnotherReg(const Type *Ty) {
+ assert(dynamic_cast<const X86RegisterInfo*>(TM.getRegisterInfo()) &&
+ "Current target doesn't have X86 reg info??");
+ const X86RegisterInfo *MRI =
+ static_cast<const X86RegisterInfo*>(TM.getRegisterInfo());
if (Ty == Type::LongTy || Ty == Type::ULongTy) {
- const TargetRegisterClass *RC =
- TM.getRegisterInfo()->getRegClassForType(Type::IntTy);
+ const TargetRegisterClass *RC = MRI->getRegClassForType(Type::IntTy);
// Create the lower part
F->getSSARegMap()->createVirtualRegister(RC);
// Create the upper part.
@@ -229,8 +232,7 @@ namespace {
}
// Add the mapping of regnumber => reg class to MachineFunction
- const TargetRegisterClass *RC =
- TM.getRegisterInfo()->getRegClassForType(Ty);
+ const TargetRegisterClass *RC = MRI->getRegClassForType(Ty);
return F->getSSARegMap()->createVirtualRegister(RC);
}
OpenPOWER on IntegriCloud