[llvm] r244269 - [dsymutil] Add (unimplemented) --flat option

Frederic Riss via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 14:05:02 PDT 2015


Author: friss
Date: Thu Aug  6 16:05:01 2015
New Revision: 244269

URL: http://llvm.org/viewvc/llvm-project?rev=244269&view=rev
Log:
[dsymutil] Add (unimplemented) --flat option

dsymutil should by default generate dSYM bundles which are filesystem
hierarchies containing the debug info and an additional Info.plist.
Currently llvm-dsymutil emits raw binaries containing the debug info.
This is what we call the 'flat mode'. Add a -f/-flat option that is
supposed to enable that flat mode, but don't wire it for now, only
pass it to the tests that will need it to stay functional once we
do bundle generation by default.
This basically makes this commit NFC and removes the noise from the
actual commit that adds support for bundle generation.

Modified:
    llvm/trunk/test/tools/dsymutil/ARM/fat-arch-not-found.test
    llvm/trunk/test/tools/dsymutil/X86/basic-linking-x86.test
    llvm/trunk/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test
    llvm/trunk/test/tools/dsymutil/X86/basic-lto-linking-x86.test
    llvm/trunk/test/tools/dsymutil/X86/fat-archive-input-i386.test
    llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64.test
    llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64h.test
    llvm/trunk/test/tools/dsymutil/X86/frame-1.test
    llvm/trunk/test/tools/dsymutil/X86/frame-2.test
    llvm/trunk/test/tools/dsymutil/X86/multiple-inputs.test
    llvm/trunk/test/tools/dsymutil/X86/odr-1.test
    llvm/trunk/test/tools/dsymutil/fat-binary-output.test
    llvm/trunk/tools/dsymutil/dsymutil.cpp

Modified: llvm/trunk/test/tools/dsymutil/ARM/fat-arch-not-found.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/ARM/fat-arch-not-found.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/ARM/fat-arch-not-found.test (original)
+++ llvm/trunk/test/tools/dsymutil/ARM/fat-arch-not-found.test Thu Aug  6 16:05:01 2015
@@ -1,5 +1,5 @@
 # REQUIRES: object-emission
-# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - 2>&1 | FileCheck %s
+# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - 2>&1 | FileCheck %s
 
 ---
 triple:          'armv7-apple-darwin'

Modified: llvm/trunk/test/tools/dsymutil/X86/basic-linking-x86.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/basic-linking-x86.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/basic-linking-x86.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/basic-linking-x86.test Thu Aug  6 16:05:01 2015
@@ -1,13 +1,13 @@
 REQUIRES: shell
 RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
-RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t1
+RUN: llvm-dsymutil -f -oso-prepend-path=%p/.. %t1
 RUN: llvm-dwarfdump %t1.dwarf | FileCheck %s
-RUN: llvm-dsymutil -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
+RUN: llvm-dsymutil -f -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
 RUN: llvm-dwarfdump %t2 | FileCheck %s
-RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
-RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
-RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dsymutil -y -o - - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
-RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dsymutil -o - -y - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
+RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
+RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
+RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dsymutil -f -y -o - - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
+RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
 
 CHECK: file format Mach-O 64-bit x86-64
 

Modified: llvm/trunk/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test Thu Aug  6 16:05:01 2015
@@ -1,5 +1,5 @@
 REQUIRES: shell
-RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
+RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
 
 CHECK: file format Mach-O 64-bit x86-64
 

Modified: llvm/trunk/test/tools/dsymutil/X86/basic-lto-linking-x86.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/basic-lto-linking-x86.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/basic-lto-linking-x86.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/basic-lto-linking-x86.test Thu Aug  6 16:05:01 2015
@@ -1,6 +1,6 @@
 REQUIRES: shell
-RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
-RUN: llvm-dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | llvm-dsymutil -o - -y - | llvm-dwarfdump - | FileCheck %s
+RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
+RUN: llvm-dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump - | FileCheck %s
 
 CHECK: file format Mach-O 64-bit x86-64
 

Modified: llvm/trunk/test/tools/dsymutil/X86/fat-archive-input-i386.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/fat-archive-input-i386.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/fat-archive-input-i386.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/fat-archive-input-i386.test Thu Aug  6 16:05:01 2015
@@ -1,5 +1,5 @@
 # REQUIRES: object-emission
-# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
 
 ---
 triple:          'i386-apple-darwin'

Modified: llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64.test Thu Aug  6 16:05:01 2015
@@ -1,5 +1,5 @@
 # REQUIRES: object-emission
-# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
 
 ---
 triple:          'x86_64-apple-darwin'

Modified: llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64h.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64h.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64h.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/fat-object-input-x86_64h.test Thu Aug  6 16:05:01 2015
@@ -1,5 +1,5 @@
 # REQUIRES: object-emission
-# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
 
 ---
 triple:          'x86_64h-apple-darwin'

Modified: llvm/trunk/test/tools/dsymutil/X86/frame-1.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/frame-1.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/frame-1.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/frame-1.test Thu Aug  6 16:05:01 2015
@@ -2,7 +2,7 @@
 # RUN: rm -rf %t
 # RUN: mkdir -p %t
 # RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o
-# RUN: llvm-dsymutil -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
+# RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
 
 # This test is meant to verify that identical CIEs will get reused
 # in the same file but also inbetween files. For this to happen, we

Modified: llvm/trunk/test/tools/dsymutil/X86/frame-2.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/frame-2.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/frame-2.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/frame-2.test Thu Aug  6 16:05:01 2015
@@ -3,7 +3,7 @@
 # RUN: mkdir -p %t
 # RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o
 # RUN: llc -filetype=obj %p/../Inputs/frame-dw4.ll -o %t/frame-dw4.o
-# RUN: llvm-dsymutil -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
+# RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
 
 # Check the handling of multiple different CIEs. To have CIEs that
 # appear to be different, use a dwarf2 version of the file along with

Modified: llvm/trunk/test/tools/dsymutil/X86/multiple-inputs.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/multiple-inputs.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/multiple-inputs.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/multiple-inputs.test Thu Aug  6 16:05:01 2015
@@ -3,7 +3,7 @@ RUN: cat %p/../Inputs/basic.macho.x86_64
 RUN: cat %p/../Inputs/basic-archive.macho.x86_64 > %t2
 RUN: cat %p/../Inputs/basic-lto.macho.x86_64 > %t3
 RUN: cat %p/../Inputs/basic-lto-dw4.macho.x86_64 > %t4
-RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t1 %t2 %t3 %t4
+RUN: llvm-dsymutil -f -oso-prepend-path=%p/.. %t1 %t2 %t3 %t4
 RUN: llvm-dwarfdump %t1.dwarf \
 RUN:   | FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=BASIC
 RUN: llvm-dwarfdump %t2.dwarf \

Modified: llvm/trunk/test/tools/dsymutil/X86/odr-1.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/odr-1.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/odr-1.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/odr-1.test Thu Aug  6 16:05:01 2015
@@ -8,8 +8,8 @@
 # RUN: llc -filetype=obj %p/../Inputs/odr5.ll -o %t/odr5.o
 # RUN: llc -filetype=obj %p/../Inputs/odr6.ll -o %t/odr6.o
 # RUN: llc -filetype=obj %p/../Inputs/odr7.ll -o %t/odr7.o
-# RUN: llvm-dsymutil -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=ODR -check-prefix=CHECK %s
-# RUN: llvm-dsymutil -oso-prepend-path=%t -y %s -no-odr -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=NOODR -check-prefix=CHECK %s
+# RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=ODR -check-prefix=CHECK %s
+# RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -no-odr -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=NOODR -check-prefix=CHECK %s
 
 # Totally made up debug map to test ODR uniquing
 

Modified: llvm/trunk/test/tools/dsymutil/fat-binary-output.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/fat-binary-output.test?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/fat-binary-output.test (original)
+++ llvm/trunk/test/tools/dsymutil/fat-binary-output.test Thu Aug  6 16:05:01 2015
@@ -1,4 +1,4 @@
-RUN: llvm-dsymutil -verbose -no-output %p/Inputs/fat-test.dylib -oso-prepend-path %p | FileCheck %s
+RUN: llvm-dsymutil -f -verbose -no-output %p/Inputs/fat-test.dylib -oso-prepend-path %p | FileCheck %s
 
 This test doesn't produce any filesytstem output, we just look at the verbose
 log output.

Modified: llvm/trunk/tools/dsymutil/dsymutil.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/dsymutil.cpp?rev=244269&r1=244268&r2=244269&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/dsymutil.cpp (original)
+++ llvm/trunk/tools/dsymutil/dsymutil.cpp Thu Aug  6 16:05:01 2015
@@ -47,6 +47,11 @@ static opt<std::string> OsoPrependPath(
     desc("Specify a directory to prepend to the paths of object files."),
     value_desc("path"), cat(DsymCategory));
 
+static opt<bool> FlatOut("flat",
+                         desc("Produce a flat dSYM file (not a bundle)."),
+                         init(false), cat(DsymCategory));
+static alias FlatOutA("f", desc("Alias for --flat"), aliasopt(FlatOut));
+
 static opt<bool> Verbose("verbose", desc("Verbosity level"), init(false),
                          cat(DsymCategory));
 
@@ -156,8 +161,13 @@ int main(int argc, char **argv) {
   llvm::InitializeAllTargets();
   llvm::InitializeAllAsmPrinters();
 
-  if (InputFiles.size() > 1 && !OutputFileOpt.empty()) {
-    llvm::errs() << "error: cannot use -o with multiple inputs\n";
+  if (!FlatOut && OutputFileOpt == "-") {
+    llvm::errs() << "error: cannot emit to standard output without --flat\n";
+    return 1;
+  }
+
+  if (InputFiles.size() > 1 && FlatOut && !OutputFileOpt.empty()) {
+    llvm::errs() << "error: cannot use -o with multiple inputs in flat mode\n";
     return 1;
   }
 




More information about the llvm-commits mailing list