diff options
author | Chris Lattner <sabre@nondot.org> | 2006-05-03 20:30:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-05-03 20:30:20 +0000 |
commit | 5a032de387831b9de3a707292eade95934938da9 (patch) | |
tree | f5ec4fba3a29470e1903e446970170690f26d5af /lib | |
parent | d2d5c76753b132c34c71248db2f136b38531bc6d (diff) | |
download | external_llvm-5a032de387831b9de3a707292eade95934938da9.zip external_llvm-5a032de387831b9de3a707292eade95934938da9.tar.gz external_llvm-5a032de387831b9de3a707292eade95934938da9.tar.bz2 |
Change from using MachineRelocation ctors to using static methods
in MachineRelocation to create Relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/Alpha/AlphaCodeEmitter.cpp | 6 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCCodeEmitter.cpp | 4 | ||||
-rw-r--r-- | lib/Target/X86/X86CodeEmitter.cpp | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/Target/Alpha/AlphaCodeEmitter.cpp b/lib/Target/Alpha/AlphaCodeEmitter.cpp index cd03320..d8cf7df 100644 --- a/lib/Target/Alpha/AlphaCodeEmitter.cpp +++ b/lib/Target/Alpha/AlphaCodeEmitter.cpp @@ -215,15 +215,15 @@ int AlphaCodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) { abort(); } if (MO.isGlobalAddress()) - MCE.addRelocation(MachineRelocation((unsigned)MCE.getCurrentPCOffset(), + MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc, MO.getGlobal(), Offset, false, useGOT)); else if (MO.isExternalSymbol()) - MCE.addRelocation(MachineRelocation((unsigned)MCE.getCurrentPCOffset(), + MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(), Reloc, MO.getSymbolName(), Offset, true)); else - MCE.addRelocation(MachineRelocation((unsigned)MCE.getCurrentPCOffset(), + MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(), Reloc, MO.getConstantPoolIndex(), Offset)); } else if (MO.isMachineBasicBlock()) { diff --git a/lib/Target/PowerPC/PPCCodeEmitter.cpp b/lib/Target/PowerPC/PPCCodeEmitter.cpp index 9be0f10..a530b1e 100644 --- a/lib/Target/PowerPC/PPCCodeEmitter.cpp +++ b/lib/Target/PowerPC/PPCCodeEmitter.cpp @@ -180,10 +180,10 @@ int PPCCodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) { } } if (MO.isGlobalAddress()) - MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), + MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc, MO.getGlobal(), 0)); else - MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), + MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(), Reloc, MO.getSymbolName(), 0)); } else if (MO.isMachineBasicBlock()) { unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index d0f7693..37c60bd 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -123,7 +123,7 @@ void Emitter::emitPCRelativeBlockAddress(MachineBasicBlock *MBB) { /// assuming this is part of a function call, which is PC relative. /// void Emitter::emitGlobalAddressForCall(GlobalValue *GV, bool isTailCall) { - MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), + MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(), X86::reloc_pcrel_word, GV, 0, !isTailCall /*Doesn'tNeedStub*/)); MCE.emitWordLE(0); @@ -134,7 +134,7 @@ void Emitter::emitGlobalAddressForCall(GlobalValue *GV, bool isTailCall) { /// PC relative. /// void Emitter::emitGlobalAddressForPtr(GlobalValue *GV, int Disp /* = 0 */) { - MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), + MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(), X86::reloc_absolute_word, GV)); MCE.emitWordLE(Disp); // The relocated value will be added to the displacement } @@ -144,7 +144,7 @@ void Emitter::emitGlobalAddressForPtr(GlobalValue *GV, int Disp /* = 0 */) { /// relative. void Emitter::emitExternalSymbolAddress(const char *ES, bool isPCRelative, bool isTailCall) { - MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), + MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(), isPCRelative ? X86::reloc_pcrel_word : X86::reloc_absolute_word, ES)); MCE.emitWordLE(0); } |