aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86CodeEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-02 19:14:47 +0000
committerChris Lattner <sabre@nondot.org>2006-05-02 19:14:47 +0000
commitd3f0aefc33965d3d0ca6f92af4ebaea354b063c4 (patch)
treea930b341d61cfa8a4c28505803970a2b270946a2 /lib/Target/X86/X86CodeEmitter.cpp
parent43b429b05989075b60693d57395c99b0ad789f8d (diff)
downloadexternal_llvm-d3f0aefc33965d3d0ca6f92af4ebaea354b063c4.tar.gz
external_llvm-d3f0aefc33965d3d0ca6f92af4ebaea354b063c4.tar.bz2
external_llvm-d3f0aefc33965d3d0ca6f92af4ebaea354b063c4.zip
Fix a purely hypothetical problem (for now): emitWord emits in the host
byte format. This doesn't work when using the code emitter in a cross target environment. Since the code emitter is only really used by the JIT, this isn't a current problem, but if we ever start emitting .o files, it would be. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86CodeEmitter.cpp')
-rw-r--r--lib/Target/X86/X86CodeEmitter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp
index a278fd548b..175dae5ee1 100644
--- a/lib/Target/X86/X86CodeEmitter.cpp
+++ b/lib/Target/X86/X86CodeEmitter.cpp
@@ -116,7 +116,7 @@ void Emitter::emitBasicBlock(MachineBasicBlock &MBB) {
/// emitPCRelativeValue - Emit a 32-bit PC relative address.
///
void Emitter::emitPCRelativeValue(unsigned Address) {
- MCE.emitWord(Address-MCE.getCurrentPCValue()-4);
+ MCE.emitWordLE(Address-MCE.getCurrentPCValue()-4);
}
/// emitPCRelativeBlockAddress - This method emits the PC relative address of
@@ -134,7 +134,7 @@ void Emitter::emitPCRelativeBlockAddress(MachineBasicBlock *MBB) {
// Otherwise, remember where this reference was and where it is to so we can
// deal with it later.
BBRefs.push_back(std::make_pair(MBB, MCE.getCurrentPCValue()));
- MCE.emitWord(0);
+ MCE.emitWordLE(0);
}
}
@@ -145,7 +145,7 @@ void Emitter::emitGlobalAddressForCall(GlobalValue *GV, bool isTailCall) {
MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(),
X86::reloc_pcrel_word, GV, 0,
!isTailCall /*Doesn'tNeedStub*/));
- MCE.emitWord(0);
+ MCE.emitWordLE(0);
}
/// emitGlobalAddress - Emit the specified address to the code stream assuming
@@ -155,7 +155,7 @@ void Emitter::emitGlobalAddressForCall(GlobalValue *GV, bool isTailCall) {
void Emitter::emitGlobalAddressForPtr(GlobalValue *GV, int Disp /* = 0 */) {
MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(),
X86::reloc_absolute_word, GV));
- MCE.emitWord(Disp); // The relocated value will be added to the displacement
+ MCE.emitWordLE(Disp); // The relocated value will be added to the displacement
}
/// emitExternalSymbolAddress - Arrange for the address of an external symbol to
@@ -165,7 +165,7 @@ void Emitter::emitExternalSymbolAddress(const char *ES, bool isPCRelative,
bool isTailCall) {
MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(),
isPCRelative ? X86::reloc_pcrel_word : X86::reloc_absolute_word, ES));
- MCE.emitWord(0);
+ MCE.emitWordLE(0);
}
/// N86 namespace - Native X86 Register numbers... used by X86 backend.