diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt --- a/llvm/test/CMakeLists.txt +++ b/llvm/test/CMakeLists.txt @@ -39,6 +39,7 @@ UnitTests bugpoint count + gsymutil llc lli lli-child-target @@ -64,7 +65,6 @@ llvm-elfabi llvm-exegesis llvm-extract - llvm-gsymutil llvm-isel-fuzzer llvm-ifs llvm-install-name-tool diff --git a/llvm/test/tools/llvm-gsymutil/cmdline.test b/llvm/test/tools/gsymutil/cmdline.test rename from llvm/test/tools/llvm-gsymutil/cmdline.test rename to llvm/test/tools/gsymutil/cmdline.test --- a/llvm/test/tools/llvm-gsymutil/cmdline.test +++ b/llvm/test/tools/gsymutil/cmdline.test @@ -1,7 +1,7 @@ -RUN: llvm-gsymutil -h 2>&1 | FileCheck --check-prefix=HELP %s -RUN: llvm-gsymutil --help 2>&1 | FileCheck --check-prefix=HELP %s +RUN: gsymutil -h 2>&1 | FileCheck --check-prefix=HELP %s +RUN: gsymutil --help 2>&1 | FileCheck --check-prefix=HELP %s HELP: OVERVIEW: A tool for dumping, searching and creating GSYM files. -HELP: USAGE: llvm-gsymutil{{[^ ]*}} [options] +HELP: USAGE: gsymutil{{[^ ]*}} [options] HELP: OPTIONS: HELP: Conversion Options: HELP: --arch= @@ -17,5 +17,5 @@ HELP: Options: HELP: --verbose -RUN: llvm-gsymutil --version 2>&1 | FileCheck --check-prefix=VERSION %s +RUN: gsymutil --version 2>&1 | FileCheck --check-prefix=VERSION %s VERSION: {{ version }} diff --git a/llvm/test/tools/llvm-gsymutil/elf-dwarf.yaml b/llvm/test/tools/gsymutil/elf-dwarf.yaml rename from llvm/test/tools/llvm-gsymutil/elf-dwarf.yaml rename to llvm/test/tools/gsymutil/elf-dwarf.yaml --- a/llvm/test/tools/llvm-gsymutil/elf-dwarf.yaml +++ b/llvm/test/tools/gsymutil/elf-dwarf.yaml @@ -3,10 +3,10 @@ ## created GSYM, and finally we dump the entire GSYM. # RUN: yaml2obj %s -o %t -# RUN: llvm-gsymutil --convert %t -o %t.gsym 2>&1 | FileCheck %s --check-prefix=CONVERT -# RUN: llvm-gsymutil --address=0x400391 --address=0x4004cd %t.gsym 2>&1 | FileCheck %s --check-prefix=ADDR -# RUN: llvm-gsymutil --address=0x400391 --address=0x4004cd --verbose %t.gsym 2>&1 | FileCheck %s --check-prefix=ADDRV --dump-input=always -# RUN: llvm-gsymutil %t.gsym 2>&1 | FileCheck %s --check-prefix=DUMP +# RUN: gsymutil --convert %t -o %t.gsym 2>&1 | FileCheck %s --check-prefix=CONVERT +# RUN: gsymutil --address=0x400391 --address=0x4004cd %t.gsym 2>&1 | FileCheck %s --check-prefix=ADDR +# RUN: gsymutil --address=0x400391 --address=0x4004cd --verbose %t.gsym 2>&1 | FileCheck %s --check-prefix=ADDRV --dump-input=always +# RUN: gsymutil %t.gsym 2>&1 | FileCheck %s --check-prefix=DUMP # ADDR: Looking up addresses in "{{.*\.yaml\.tmp\.gsym}}": # ADDR: 0x0000000000400391: _init diff --git a/llvm/test/tools/llvm-gsymutil/fat-macho-dwarf.yaml b/llvm/test/tools/gsymutil/fat-macho-dwarf.yaml rename from llvm/test/tools/llvm-gsymutil/fat-macho-dwarf.yaml rename to llvm/test/tools/gsymutil/fat-macho-dwarf.yaml --- a/llvm/test/tools/llvm-gsymutil/fat-macho-dwarf.yaml +++ b/llvm/test/tools/gsymutil/fat-macho-dwarf.yaml @@ -7,9 +7,9 @@ ## then the GSYM file will be created in the normal location. # RUN: yaml2obj %s -o %t -# RUN: llvm-gsymutil --convert %t --arch armv7 -o %t.armv7.gsym 2>&1 | FileCheck %s --check-prefix=ARMV7 -# RUN: llvm-gsymutil --convert %t --arch arm64 -o %t.arm64.gsym 2>&1 | FileCheck %s --check-prefix=ARM64 -# RUN: llvm-gsymutil --convert %t -o %t.gsym 2>&1 | FileCheck %s --check-prefix=FAT +# RUN: gsymutil --convert %t --arch armv7 -o %t.armv7.gsym 2>&1 | FileCheck %s --check-prefix=ARMV7 +# RUN: gsymutil --convert %t --arch arm64 -o %t.arm64.gsym 2>&1 | FileCheck %s --check-prefix=ARM64 +# RUN: gsymutil --convert %t -o %t.gsym 2>&1 | FileCheck %s --check-prefix=FAT # ARMV7: Input file: {{.*\.yaml\.tmp}} # ARMV7-NEXT: Output file (armv7): {{.*\.yaml\.tmp\.armv7\.gsym}} diff --git a/llvm/test/tools/gsymutil/lit.local.cfg b/llvm/test/tools/gsymutil/lit.local.cfg new file mode 100644 --- /dev/null +++ b/llvm/test/tools/gsymutil/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = ['.test', '.yaml'] diff --git a/llvm/test/tools/llvm-gsymutil/mach-dwarf.yaml b/llvm/test/tools/gsymutil/mach-dwarf.yaml rename from llvm/test/tools/llvm-gsymutil/mach-dwarf.yaml rename to llvm/test/tools/gsymutil/mach-dwarf.yaml --- a/llvm/test/tools/llvm-gsymutil/mach-dwarf.yaml +++ b/llvm/test/tools/gsymutil/mach-dwarf.yaml @@ -3,10 +3,10 @@ ## lookups on the newly created GSYM, and finally we dump the entire GSYM. # RUN: yaml2obj %s -o %t -# RUN: llvm-gsymutil --convert %t -o %t.gsym 2>&1 | FileCheck %s --check-prefix=CONVERT -# RUN: llvm-gsymutil --address=0 --address=0x100000000 --address=0x100000f90 --address=0x100000faa --address=0x200000000 %t.gsym 2>&1 | FileCheck %s --check-prefix=ADDR -# RUN: llvm-gsymutil --verbose --address=0x100000000 --address=0x100000f90 --address=0x100000faa %t.gsym 2>&1 | FileCheck %s --check-prefix=ADDRV -# RUN: llvm-gsymutil %t.gsym 2>&1 | FileCheck %s --check-prefix=DUMP +# RUN: gsymutil --convert %t -o %t.gsym 2>&1 | FileCheck %s --check-prefix=CONVERT +# RUN: gsymutil --address=0 --address=0x100000000 --address=0x100000f90 --address=0x100000faa --address=0x200000000 %t.gsym 2>&1 | FileCheck %s --check-prefix=ADDR +# RUN: gsymutil --verbose --address=0x100000000 --address=0x100000f90 --address=0x100000faa %t.gsym 2>&1 | FileCheck %s --check-prefix=ADDRV +# RUN: gsymutil %t.gsym 2>&1 | FileCheck %s --check-prefix=DUMP # CONVERT: Input file: {{.*\.yaml\.tmp}} # CONVERT: Output file (x86_64): {{.*\.yaml\.tmp\.gsym}} diff --git a/llvm/tools/gsymutil/CMakeLists.txt b/llvm/tools/gsymutil/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/llvm/tools/gsymutil/CMakeLists.txt @@ -0,0 +1,13 @@ +set(LLVM_LINK_COMPONENTS + ${LLVM_TARGETS_TO_BUILD} + DebugInfoDWARF + DebugInfoGSYM + Object + Support + Target + ) + +add_llvm_tool(gsymutil + gsymutil.cpp + + ) diff --git a/llvm/tools/llvm-gsym/llvm-gsymutil.cpp b/llvm/tools/gsymutil/gsymutil.cpp rename from llvm/tools/llvm-gsym/llvm-gsymutil.cpp rename to llvm/tools/gsymutil/gsymutil.cpp --- a/llvm/tools/llvm-gsym/llvm-gsymutil.cpp +++ b/llvm/tools/gsymutil/gsymutil.cpp @@ -1,4 +1,4 @@ -//===-- llvm-gsymutil.cpp - GSYM dumping and creation utility for llvm ----===// +//===-- gsymutil.cpp - GSYM dumping and creation utility for llvm ---------===// // // The LLVM Compiler Infrastructure // @@ -428,10 +428,7 @@ PrettyStackTraceProgram X(argc, argv); llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. - llvm::InitializeAllTargetInfos(); - llvm::InitializeAllTargetMCs(); llvm::InitializeAllTargets(); - llvm::InitializeAllAsmPrinters(); const char *Overview = "A tool for dumping, searching and creating GSYM files.\n\n" diff --git a/llvm/tools/llvm-gsym/CMakeLists.txt b/llvm/tools/llvm-gsym/CMakeLists.txt deleted file mode 100644 --- a/llvm/tools/llvm-gsym/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -set(LLVM_LINK_COMPONENTS - ${LLVM_TARGETS_TO_BUILD} - DebugInfoDWARF - DebugInfoGSYM - AsmPrinter - AllTargetsDescs - AllTargetsInfos - MC - Object - Support - Target - ) - -add_llvm_tool(llvm-gsymutil - llvm-gsymutil.cpp - - DEPENDS - intrinsics_gen - ) diff --git a/llvm/utils/gn/secondary/llvm/test/BUILD.gn b/llvm/utils/gn/secondary/llvm/test/BUILD.gn --- a/llvm/utils/gn/secondary/llvm/test/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/test/BUILD.gn @@ -216,7 +216,7 @@ "//llvm/tools/llvm-elfabi", "//llvm/tools/llvm-exegesis", "//llvm/tools/llvm-extract", - "//llvm/tools/llvm-gsym:llvm-gsymutil", + "//llvm/tools/gsymutil:gsymutil", "//llvm/tools/llvm-ifs", "//llvm/tools/llvm-isel-fuzzer", "//llvm/tools/llvm-jitlink", diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-gsym/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/gsymutil/BUILD.gn rename from llvm/utils/gn/secondary/llvm/tools/llvm-gsym/BUILD.gn rename to llvm/utils/gn/secondary/llvm/tools/gsymutil/BUILD.gn --- a/llvm/utils/gn/secondary/llvm/tools/llvm-gsym/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/tools/gsymutil/BUILD.gn @@ -1,4 +1,4 @@ -executable("llvm-gsymutil") { +executable("gsymutil") { deps = [ "//llvm/lib/CodeGen/AsmPrinter", "//llvm/lib/DebugInfo/DWARF", @@ -11,6 +11,6 @@ ] sources = [ # Make `gn format` not collapse this, for sync_source_lists_from_cmake.py. - "llvm-gsymutil.cpp", + "gsymutil.cpp", ] }