[llvm-commits] [llvm] r172481 - /llvm/trunk/lib/Target/Mips/MipsCodeEmitter.cpp
Dmitri Gribenko
gribozavr at gmail.com
Mon Jan 14 14:08:37 PST 2013
Author: gribozavr
Date: Mon Jan 14 16:08:37 2013
New Revision: 172481
URL: http://llvm.org/viewvc/llvm-project?rev=172481&view=rev
Log:
Improve r172471: avoid all those extra casts on the lines nearby
Modified:
llvm/trunk/lib/Target/Mips/MipsCodeEmitter.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsCodeEmitter.cpp?rev=172481&r1=172480&r2=172481&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsCodeEmitter.cpp Mon Jan 14 16:08:37 2013
@@ -120,10 +120,12 @@
char MipsCodeEmitter::ID = 0;
bool MipsCodeEmitter::runOnMachineFunction(MachineFunction &MF) {
- JTI = const_cast<MipsTargetMachine&>(
- static_cast<const MipsTargetMachine&>(MF.getTarget())).getJITInfo();
- II = ((const MipsTargetMachine&) MF.getTarget()).getInstrInfo();
- TD = ((const MipsTargetMachine&) MF.getTarget()).getDataLayout();
+ MipsTargetMachine &Target = static_cast<MipsTargetMachine &>(
+ const_cast<TargetMachine &>(MF.getTarget()));
+
+ JTI = Target.getJITInfo();
+ II = Target.getInstrInfo();
+ TD = Target.getDataLayout();
Subtarget = &TM.getSubtarget<MipsSubtarget> ();
MCPEs = &MF.getConstantPool()->getConstants();
MJTEs = 0;
More information about the llvm-commits
mailing list