[PATCH] D60252: [dwarfdump] Make -arch accept alternative spellings
Dave Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 3 23:31:19 PDT 2019
kastiglione created this revision.
kastiglione added reviewers: aprantl, keith.
Herald added subscribers: llvm-commits, kristof.beyls, javed.absar, mgorny.
Herald added a project: LLVM.
llvm-dwarfdump does not accept -arch values for commonly known arch names like
arm64 or i686. All llvm and clang tools I've used allow for these arch names,
this change makes llvm-dwarfdump consistent with other tools.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D60252
Files:
llvm/test/CMakeLists.txt
llvm/test/tools/llvm-dwarfdump/X86/archive.test
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
Index: llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
===================================================================
--- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -258,12 +258,11 @@
return true;
if (auto *MachO = dyn_cast<MachOObjectFile>(&Obj)) {
- std::string ObjArch =
- Triple::getArchTypeName(MachO->getArchTriple().getArch());
+ auto ObjArch = MachO->getArchTriple().getArch();
for (auto Arch : ArchFilters) {
// Match name.
- if (Arch == ObjArch)
+ if (Triple(Arch).getArch() == ObjArch)
return true;
// Match architecture number.
Index: llvm/test/tools/llvm-dwarfdump/X86/archive.test
===================================================================
--- llvm/test/tools/llvm-dwarfdump/X86/archive.test
+++ llvm/test/tools/llvm-dwarfdump/X86/archive.test
@@ -11,6 +11,12 @@
I386: file format Mach-O 32-bit i386
I386-NOT: 64-bit
+RUN: llvm-dwarfdump --debug-info %S/../../dsymutil/Inputs/libfat-test.a \
+RUN: --arch=i686 | FileCheck %s --check-prefix=I686
+I686-NOT: 64-bit
+I686: file format Mach-O 32-bit i386
+I686-NOT: 64-bit
+
RUN: llvm-dwarfdump --debug-info %S/../../dsymutil/Inputs/libfat-test.a \
RUN: --arch=i386 --arch=x86_64 | FileCheck %s
Index: llvm/test/CMakeLists.txt
===================================================================
--- llvm/test/CMakeLists.txt
+++ llvm/test/CMakeLists.txt
@@ -162,6 +162,15 @@
add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
+# Inform people that check-llvm should be run with Release builds.
+if(NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
+ add_custom_target(check-llvm-inform
+ COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red "Running check-llvm will be slow, use a Release build for performance"
+ USES_TERMINAL
+ )
+ set(LLVM_TEST_DEPENDS check-llvm-inform ${LLVM_TEST_DEPENDS})
+endif()
+
add_lit_testsuite(check-llvm "Running the LLVM regression tests"
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${LLVM_TEST_DEPENDS}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60252.193663.patch
Type: text/x-patch
Size: 2133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190404/c5dc2782/attachment.bin>
More information about the llvm-commits
mailing list