aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-01-18 00:23:57 +0000
committerJim Grosbach <grosbach@apple.com>2012-01-18 00:23:57 +0000
commit9b5b125c34b47e0e7eef2548acee8bf1448c4b71 (patch)
tree94ac286ee5aab98135e64016fd2b811a61864773 /lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
parent31867660cb81ea2b1d1a6ffa7d09c91acb754a8b (diff)
downloadexternal_llvm-9b5b125c34b47e0e7eef2548acee8bf1448c4b71.zip
external_llvm-9b5b125c34b47e0e7eef2548acee8bf1448c4b71.tar.gz
external_llvm-9b5b125c34b47e0e7eef2548acee8bf1448c4b71.tar.bz2
Move some ARM specific MCAssmebler bits into the ARMAsmBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp')
-rw-r--r--lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
index 7b3f966..88fea57 100644
--- a/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+++ b/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
@@ -22,6 +22,7 @@
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/MC/MCValue.h"
#include "llvm/Object/MachOFormat.h"
#include "llvm/Support/ELF.h"
#include "llvm/Support/ErrorHandling.h"
@@ -101,6 +102,20 @@ public:
return Infos[Kind - FirstTargetFixupKind];
}
+ /// processFixupValue - Target hook to process the literal value of a fixup
+ /// if necessary.
+ void processFixupValue(const MCAssembler &Asm, const MCAsmLayout &Layout,
+ const MCFixup &Fixup, const MCFragment *DF,
+ MCValue &Target, uint64_t &Value) {
+ // Some fixups to thumb function symbols need the low bit (thumb bit)
+ // twiddled.
+ if (const MCSymbolRefExpr *A = Target.getSymA()) {
+ const MCSymbol &Sym = A->getSymbol().AliasedSymbol();
+ if (Asm.isThumbFunc(&Sym))
+ Value |= 1;
+ }
+ }
+
bool MayNeedRelaxation(const MCInst &Inst) const;
bool fixupNeedsRelaxation(const MCFixup &Fixup,