diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-10-16 18:23:53 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-10-16 18:23:53 +0000 |
commit | f230df9af4012f9510de664b6d62b128e26a5861 (patch) | |
tree | 459a596099278874a963dabafad21e27da5046eb /lib/Target/ARM/ARMAsmBackend.cpp | |
parent | cb2caf738023c0a03f5df1b909431129a16e2c54 (diff) |
Add a MCObjectFormat class so that code common to all targets that use a
single object format can be shared.
This also adds support for
mov zed+(bar-foo), %eax
on ELF and COFF targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmBackend.cpp')
-rw-r--r-- | lib/Target/ARM/ARMAsmBackend.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMAsmBackend.cpp b/lib/Target/ARM/ARMAsmBackend.cpp index df439a41b3..d113cf5b9e 100644 --- a/lib/Target/ARM/ARMAsmBackend.cpp +++ b/lib/Target/ARM/ARMAsmBackend.cpp @@ -14,6 +14,7 @@ #include "llvm/MC/ELFObjectWriter.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCExpr.h" +#include "llvm/MC/MCObjectFormat.h" #include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSectionMachO.h" @@ -66,14 +67,19 @@ namespace { // FIXME: This should be in a separate file. // ELF is an ELF of course... class ELFARMAsmBackend : public ARMAsmBackend { + MCELFObjectFormat Format; + public: Triple::OSType OSType; ELFARMAsmBackend(const Target &T, Triple::OSType _OSType) : ARMAsmBackend(T), OSType(_OSType) { - HasAbsolutizedSet = true; HasScatteredSymbols = true; } + virtual const MCObjectFormat &getObjectFormat() const { + return Format; + } + void ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, uint64_t Value) const; @@ -98,14 +104,19 @@ void ELFARMAsmBackend::ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, // FIXME: This should be in a separate file. class DarwinARMAsmBackend : public ARMAsmBackend { + MCMachOObjectFormat Format; + public: DarwinARMAsmBackend(const Target &T) : ARMAsmBackend(T) { - HasAbsolutizedSet = true; HasScatteredSymbols = true; assert(0 && "DarwinARMAsmBackend::DarwinARMAsmBackend() unimplemented"); } + virtual const MCObjectFormat &getObjectFormat() const { + return Format; + } + void ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, uint64_t Value) const; |