summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
diff options
context:
space:
mode:
authorAlex Bradbury <asb@lowrisc.org>2019-04-01 14:53:17 +0000
committerAlex Bradbury <asb@lowrisc.org>2019-04-01 14:53:17 +0000
commit44668ae7c7df73ca255a688e534af49ac9600323 (patch)
treed8707ca5636da39b02883f3fe2b4950684481a64 /llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
parent9142b8ef1b9aac053461242472f9640d60aa6ac7 (diff)
downloadbcm5719-llvm-44668ae7c7df73ca255a688e534af49ac9600323.tar.gz
bcm5719-llvm-44668ae7c7df73ca255a688e534af49ac9600323.zip
[RISCV] Attach VK_RISCV_CALL to symbols upon creation
This patch replaces the addition of VK_RISCV_CALL in RISCVMCCodeEmitter by creating the RISCVMCExpr when tail/call are parsed, or in the codegen case when the callee symbols are created. This required adding a new CallSymbol operand to allow only adding VK_RISCV_CALL to tail/call instructions. This patch will allow further expansion of parsing and codegen to easily include PLT symbols which must generate the R_RISCV_CALL_PLT relocation. Differential Revision: https://reviews.llvm.org/D55560 Patch by Lewis Revill. llvm-svn: 357396
Diffstat (limited to 'llvm/lib/Target/RISCV/RISCVMCInstLower.cpp')
-rw-r--r--llvm/lib/Target/RISCV/RISCVMCInstLower.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVMCInstLower.cpp b/llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
index c2c4128f8a6..ba0cfd9edb6 100644
--- a/llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
+++ b/llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
@@ -36,6 +36,9 @@ static MCOperand lowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym,
case RISCVII::MO_None:
Kind = RISCVMCExpr::VK_RISCV_None;
break;
+ case RISCVII::MO_CALL:
+ Kind = RISCVMCExpr::VK_RISCV_CALL;
+ break;
case RISCVII::MO_LO:
Kind = RISCVMCExpr::VK_RISCV_LO;
break;
OpenPOWER on IntegriCloud