aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorSam Elliott <aelliott@qti.qualcomm.com>2025-08-07 11:28:07 -0700
committerGitHub <noreply@github.com>2025-08-07 11:28:07 -0700
commit4e11f89904dc9b77ef44b01c68742e5b00bfdf21 (patch)
treea9999c374a205c55b567290d2d35a1ee5ea6e44a /llvm/lib
parent1e2e903684719a0bdf559af261ffff9f551f4ebb (diff)
downloadllvm-4e11f89904dc9b77ef44b01c68742e5b00bfdf21.zip
llvm-4e11f89904dc9b77ef44b01c68742e5b00bfdf21.tar.gz
llvm-4e11f89904dc9b77ef44b01c68742e5b00bfdf21.tar.bz2
[RISCV] Basic Objdump Mapping Symbol Support (#151452)
This implements very basic support for RISC-V mapping symbols in llvm-objdump, sharing the implementation with how Arm/AArch64/CSKY implement this feature. This only supports the `$x` (instruction) and `$d` (data) mapping symbols for RISC-V, and not the version of `$x` which includes an architecture string suffix.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
index 95ec42f..a997ea5 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
@@ -471,6 +471,8 @@ bool RISCVAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
Count -= 1;
}
+ // TODO: emit a mapping symbol right here
+
if (Count % 4 == 2) {
// The canonical nop with Zca is c.nop.
OS.write(STI->hasFeature(RISCV::FeatureStdExtZca) ? "\x01\0" : "\0\0", 2);