aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJan Sjödin <jan_sjodin@yahoo.com>2011-03-09 18:44:41 +0000
committerJan Sjödin <jan_sjodin@yahoo.com>2011-03-09 18:44:41 +0000
commitd1cba8727a1ee713030d9e6bbd72523a9f9e2a60 (patch)
tree228ad4358d41c8dc6d81ff0160052933cd9abc0f /lib
parent7263d71cd9a8f7be649da6f1d1b6f6aa65755280 (diff)
downloadexternal_llvm-d1cba8727a1ee713030d9e6bbd72523a9f9e2a60.zip
external_llvm-d1cba8727a1ee713030d9e6bbd72523a9f9e2a60.tar.gz
external_llvm-d1cba8727a1ee713030d9e6bbd72523a9f9e2a60.tar.bz2
Add createELFObjectTargetWriter method to TargetAsmBackend, which enables construction of non-standard ELFObjectWriters that can be used in MCJIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86AsmBackend.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Target/X86/X86AsmBackend.cpp b/lib/Target/X86/X86AsmBackend.cpp
index da5f5b1..05882b5 100644
--- a/lib/Target/X86/X86AsmBackend.cpp
+++ b/lib/Target/X86/X86AsmBackend.cpp
@@ -307,10 +307,13 @@ public:
: ELFX86AsmBackend(T, OSType) {}
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
- return createELFObjectWriter(new X86ELFObjectWriter(false, OSType,
- ELF::EM_386, false),
+ return createELFObjectWriter(createELFObjectTargetWriter(),
OS, /*IsLittleEndian*/ true);
}
+
+ MCELFObjectTargetWriter *createELFObjectTargetWriter() const {
+ return new X86ELFObjectWriter(false, OSType, ELF::EM_386, false);
+ }
};
class ELFX86_64AsmBackend : public ELFX86AsmBackend {
@@ -319,10 +322,13 @@ public:
: ELFX86AsmBackend(T, OSType) {}
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
- return createELFObjectWriter(new X86ELFObjectWriter(true, OSType,
- ELF::EM_X86_64, true),
+ return createELFObjectWriter(createELFObjectTargetWriter(),
OS, /*IsLittleEndian*/ true);
}
+
+ MCELFObjectTargetWriter *createELFObjectTargetWriter() const {
+ return new X86ELFObjectWriter(true, OSType, ELF::EM_386, true);
+ }
};
class WindowsX86AsmBackend : public X86AsmBackend {