summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorShiva Chen <shiva0217@gmail.com>2018-05-18 06:42:21 +0000
committerShiva Chen <shiva0217@gmail.com>2018-05-18 06:42:21 +0000
commit6e07dfb148a6fd5ed3fb6097e884bd4ecebb9239 (patch)
tree7be11872c1ead2778e4134c23c557b707d3c10b3 /clang/lib/Frontend/CompilerInvocation.cpp
parent5095883fe9323384d202064aafdfadf57405bfc0 (diff)
downloadbcm5719-llvm-6e07dfb148a6fd5ed3fb6097e884bd4ecebb9239.tar.gz
bcm5719-llvm-6e07dfb148a6fd5ed3fb6097e884bd4ecebb9239.zip
[RISCV] Add WasForced parameter to MCAsmBackend::fixupNeedsRelaxationAdvanced
For RISCV branch instructions, we need to preserve relocation types when linker relaxation enabled, so then linker could modify offset when the branch offsets changed. We preserve relocation types by define shouldForceRelocation. IsResolved return by evaluateFixup will always false when shouldForceRelocation return true. It will make RISCV MC Branch Relaxation always relax 16-bit branches to 32-bit form, even if the symbol actually could be resolved. To avoid 16-bit branches always relax to 32-bit form when linker relaxation enabled, we add a new parameter WasForced to indicate that the symbol actually couldn't be resolved and not forced by shouldForceRelocation return true. RISCVAsmBackend::fixupNeedsRelaxationAdvanced could relax branches with unresolved symbols by (!IsResolved && !WasForced). RISCV MC Branch Relaxation is needed because RISCV could perform 32-bit to 16-bit transformation in MC layer. Differential Revision: https://reviews.llvm.org/D46350 llvm-svn: 332696
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud