summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-08-05 00:11:21 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-08-05 00:11:21 +0000
commit1b02ceeb41a28ecf1db6a8e7f99e60bc81891e89 (patch)
treef1e42ed96b863206c3a2e2786f2a18e62140217f /llvm/include
parent23a419f36129d2a9eb4947aa268c8e2072b39f01 (diff)
downloadbcm5719-llvm-1b02ceeb41a28ecf1db6a8e7f99e60bc81891e89.tar.gz
bcm5719-llvm-1b02ceeb41a28ecf1db6a8e7f99e60bc81891e89.zip
1) Proper emit displacements for x86, using absolute relocations where necessary
for ELF to work. 2) RIP addressing: Use SIB bytes for absolute relocations where RegBase=0, IndexReg=0. 3) The JIT can get the real address of cstpools and jmptables during code emission, fix that for object code emission llvm-svn: 78129
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/CodeGen/JITCodeEmitter.h7
-rw-r--r--llvm/include/llvm/CodeGen/MachineCodeEmitter.h7
-rw-r--r--llvm/include/llvm/CodeGen/ObjectCodeEmitter.h7
3 files changed, 21 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/JITCodeEmitter.h b/llvm/include/llvm/CodeGen/JITCodeEmitter.h
index 5ce6e83e569..c3f95b41989 100644
--- a/llvm/include/llvm/CodeGen/JITCodeEmitter.h
+++ b/llvm/include/llvm/CodeGen/JITCodeEmitter.h
@@ -289,6 +289,13 @@ public:
return CurBufferPtr-BufferBegin;
}
+ /// earlyResolveAddresses - True if the code emitter can use symbol addresses
+ /// during code emission time. The JIT is capable of doing this because it
+ /// creates jump tables or constant pools in memory on the fly while the
+ /// object code emitters rely on a linker to have real addresses and should
+ /// use relocations instead.
+ bool earlyResolveAddresses() const { return true; }
+
/// addRelocation - Whenever a relocatable address is needed, it should be
/// noted with this interface.
virtual void addRelocation(const MachineRelocation &MR) = 0;
diff --git a/llvm/include/llvm/CodeGen/MachineCodeEmitter.h b/llvm/include/llvm/CodeGen/MachineCodeEmitter.h
index 20a9ad78e7e..707b020f957 100644
--- a/llvm/include/llvm/CodeGen/MachineCodeEmitter.h
+++ b/llvm/include/llvm/CodeGen/MachineCodeEmitter.h
@@ -280,6 +280,13 @@ public:
return CurBufferPtr-BufferBegin;
}
+ /// earlyResolveAddresses - True if the code emitter can use symbol addresses
+ /// during code emission time. The JIT is capable of doing this because it
+ /// creates jump tables or constant pools in memory on the fly while the
+ /// object code emitters rely on a linker to have real addresses and should
+ /// use relocations instead.
+ virtual bool earlyResolveAddresses() const = 0;
+
/// addRelocation - Whenever a relocatable address is needed, it should be
/// noted with this interface.
virtual void addRelocation(const MachineRelocation &MR) = 0;
diff --git a/llvm/include/llvm/CodeGen/ObjectCodeEmitter.h b/llvm/include/llvm/CodeGen/ObjectCodeEmitter.h
index 4ed061609bc..8252e07d84b 100644
--- a/llvm/include/llvm/CodeGen/ObjectCodeEmitter.h
+++ b/llvm/include/llvm/CodeGen/ObjectCodeEmitter.h
@@ -109,6 +109,13 @@ public:
/// noted with this interface.
void addRelocation(const MachineRelocation& relocation);
+ /// earlyResolveAddresses - True if the code emitter can use symbol addresses
+ /// during code emission time. The JIT is capable of doing this because it
+ /// creates jump tables or constant pools in memory on the fly while the
+ /// object code emitters rely on a linker to have real addresses and should
+ /// use relocations instead.
+ bool earlyResolveAddresses() const { return false; }
+
/// startFunction - This callback is invoked when the specified function is
/// about to be code generated. This initializes the BufferBegin/End/Ptr
/// fields.
OpenPOWER on IntegriCloud