[llvm-objdump] Default to --mattr=+all for AArch64be and AArch64_32 (#118311)

GNU objdump disassembles all unknown instructions by default. 
Complement for [D128030](https://reviews.llvm.org/D128030)。
This commit is contained in:
hstk30-hw
2024-12-03 11:18:17 +08:00
committed by GitHub
parent 2af2634c64
commit 2f5bfb41e2
2 changed files with 5 additions and 1 deletions

View File

@@ -1,6 +1,10 @@
## When --mattr and --mcpu are both empty, disassemble all known instructions.
# RUN: llvm-mc -filetype=obj -triple=aarch64 -mattr=+all %s -o %t
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=CHECK,ALL
# RUN: llvm-mc -filetype=obj -triple=aarch64_be -mattr=+all %s -o %t
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=CHECK,ALL
# RUN: llvm-mc -filetype=obj -triple=aarch64_32 -mattr=+all %s -o %t
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=CHECK,ALL
## If --mattr or --mcpu is specified, don't default to --mattr=+all.
# RUN: llvm-objdump -d --no-show-raw-insn --mattr=+v8a %t | FileCheck %s --check-prefixes=CHECK,UNKNOWN

View File

@@ -2556,7 +2556,7 @@ static void disassembleObject(ObjectFile *Obj, bool InlineRelocs) {
if (!MAttrs.empty()) {
for (unsigned I = 0; I != MAttrs.size(); ++I)
Features.AddFeature(MAttrs[I]);
} else if (MCPU.empty() && Obj->getArch() == llvm::Triple::aarch64) {
} else if (MCPU.empty() && Obj->makeTriple().isAArch64()) {
Features.AddFeature("+all");
}