[llvm-commits] [llvm] r58872 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMJITInfo.cpp ARMJITInfo.h
Evan Cheng
evan.cheng at apple.com
Fri Nov 7 14:57:53 PST 2008
Author: evancheng
Date: Fri Nov 7 16:57:53 2008
New Revision: 58872
URL: http://llvm.org/viewvc/llvm-project?rev=58872&view=rev
Log:
More code clean up.
Modified:
llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp
llvm/trunk/lib/Target/ARM/ARMJITInfo.h
Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=58872&r1=58871&r2=58872&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Fri Nov 7 16:57:53 2008
@@ -140,7 +140,7 @@
/// Routines that handle operands which add machine relocations which are
/// fixed up by the relocation stage.
void emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
- bool NeedStub, unsigned CPIdx = 0);
+ bool NeedStub, intptr_t ACPV = 0);
void emitExternalSymbolAddress(const char *ES, unsigned Reloc);
void emitConstPoolAddress(unsigned CPI, unsigned Reloc);
void emitJumpTableAddress(unsigned JTIndex, unsigned Reloc);
@@ -225,11 +225,10 @@
/// emitGlobalAddress - Emit the specified address to the code stream.
///
-void ARMCodeEmitter::emitGlobalAddress(GlobalValue *GV,
- unsigned Reloc, bool NeedStub,
- unsigned CPIdx) {
+void ARMCodeEmitter::emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
+ bool NeedStub, intptr_t ACPV) {
MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(),
- Reloc, GV, CPIdx, NeedStub));
+ Reloc, GV, ACPV, NeedStub));
}
/// emitExternalSymbolAddress - Arrange for the address of an external symbol to
@@ -337,7 +336,8 @@
GlobalValue *GV = ACPV->getGV();
if (GV) {
assert(!ACPV->isStub() && "Don't know how to deal this yet!");
- emitGlobalAddress(GV, ARM::reloc_arm_machine_cp_entry, false, CPIndex);
+ emitGlobalAddress(GV, ARM::reloc_arm_machine_cp_entry, false,
+ (intptr_t)ACPV);
} else {
assert(!ACPV->isNonLazyPointer() && "Don't know how to deal this yet!");
emitExternalSymbolAddress(ACPV->getSymbol(), ARM::reloc_arm_absolute);
Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?rev=58872&r1=58871&r2=58872&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Fri Nov 7 16:57:53 2008
@@ -180,11 +180,7 @@
// Constant pool entry address.
return getConstantPoolEntryAddr(MR->getConstantPoolIndex());
else if (RT == ARM::reloc_arm_machine_cp_entry) {
- const MachineConstantPoolEntry &MCPE = (*MCPEs)[MR->getConstantVal()];
- assert(MCPE.isMachineConstantPoolEntry() &&
- "Expecting a machine constant pool entry!");
- ARMConstantPoolValue *ACPV =
- static_cast<ARMConstantPoolValue*>(MCPE.Val.MachineCPVal);
+ ARMConstantPoolValue *ACPV = (ARMConstantPoolValue*)MR->getConstantVal();
assert((!ACPV->hasModifier() && !ACPV->mustAddCurrentAddress()) &&
"Can't handle this machine constant pool entry yet!");
intptr_t Addr = (intptr_t)(MR->getResultPointer());
Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.h?rev=58872&r1=58871&r2=58872&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMJITInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMJITInfo.h Fri Nov 7 16:57:53 2008
@@ -27,10 +27,6 @@
class ARMJITInfo : public TargetJITInfo {
ARMTargetMachine &TM;
- // MCPEs - List of the constant pool entries for the current machine
- // function that's being processed.
- const std::vector<MachineConstantPoolEntry> *MCPEs;
-
// ConstPoolId2AddrMap - A map from constant pool ids to the corresponding
// CONSTPOOL_ENTRY addresses.
SmallVector<intptr_t, 16> ConstPoolId2AddrMap;
@@ -89,8 +85,7 @@
/// Initialize - Initialize internal stage. Get the list of constant pool
/// Resize constant pool ids to CONSTPOOL_ENTRY addresses map.
void Initialize(const MachineFunction &MF) {
- MCPEs = &MF.getConstantPool()->getConstants();
- ConstPoolId2AddrMap.resize(MCPEs->size());
+ ConstPoolId2AddrMap.resize(MF.getConstantPool()->getConstants().size());
JumpTableId2AddrMap.resize(MF.getJumpTableInfo()->getJumpTables().size());
}
More information about the llvm-commits
mailing list