summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
diff options
context:
space:
mode:
authorDylan McKay <me@dylanmckay.io>2017-04-30 23:33:52 +0000
committerDylan McKay <me@dylanmckay.io>2017-04-30 23:33:52 +0000
commit2e8718bcbb9ee54a0a8f492782d86dc49c96a344 (patch)
tree6a4423deaa8320bb76601acdb5058cf4992e67ed /llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
parentad13826aea229cbafa2093a5069c4c6335299736 (diff)
downloadbcm5719-llvm-2e8718bcbb9ee54a0a8f492782d86dc49c96a344.tar.gz
bcm5719-llvm-2e8718bcbb9ee54a0a8f492782d86dc49c96a344.zip
[AVR] Fix a bug so that we now emit R_AVR_16 fixups with the correct offset
Before this, the LDS/STS instructions would have their opcodes overwritten while linking. llvm-svn: 301782
Diffstat (limited to 'llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp')
-rw-r--r--llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
index c3d43ebb407..4dbbce8c205 100644
--- a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
+++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
@@ -177,7 +177,7 @@ unsigned AVRMCCodeEmitter::encodeComplement(const MCInst &MI, unsigned OpNo,
return (~0) - Imm;
}
-template <AVR::Fixups Fixup>
+template <AVR::Fixups Fixup, unsigned Offset>
unsigned AVRMCCodeEmitter::encodeImm(const MCInst &MI, unsigned OpNo,
SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &STI) const {
@@ -193,7 +193,7 @@ unsigned AVRMCCodeEmitter::encodeImm(const MCInst &MI, unsigned OpNo,
}
MCFixupKind FixupKind = static_cast<MCFixupKind>(Fixup);
- Fixups.push_back(MCFixup::create(0, MO.getExpr(), FixupKind, MI.getLoc()));
+ Fixups.push_back(MCFixup::create(Offset, MO.getExpr(), FixupKind, MI.getLoc()));
return 0;
}
OpenPOWER on IntegriCloud