summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil
Commit message (Collapse)AuthorAgeFilesLines
...
* [dsymutil] Make NonRelocatableStringPool a wrapper around ↵Jonas Devlieghere2018-01-243-57/+64
| | | | | | | | | | | DwarfStringPoolEntry. NFC This is needed in order to use our StringPool entries in the Apple accelerator tables. As this is NFC we rely on the existing tests for correctness. llvm-svn: 323339
* Thread MCSubtargetInfo through Target::createMCAsmBackendAlex Bradbury2018-01-031-5/+5
| | | | | | | | | | | | | | | | | | | | | Currently it's not possible to access MCSubtargetInfo from a TgtMCAsmBackend. D20830 threaded an MCSubtargetInfo reference through MCAsmBackend::relaxInstruction, but this isn't the only function that would benefit from access. This patch removes the Triple and CPUString arguments from createMCAsmBackend and replaces them with MCSubtargetInfo. This patch just changes the interface without making any intentional functional changes. Once in, several cleanups are possible: * Get rid of the awkward MCSubtargetInfo handling in ARMAsmBackend * Support 16-bit instructions when valid in MipsAsmBackend::writeNopData * Get rid of the CPU string parsing in X86AsmBackend and just use a SubtargetFeature for HasNopl * Emit 16-bit nops in RISCVAsmBackend::writeNopData if the compressed instruction set extension is enabled (see D41221) This change initially exposed PR35686, which has since been resolved in r321026. Differential Revision: https://reviews.llvm.org/D41349 llvm-svn: 321692
* [dsymutil][NFC] Replace calls to CoreFoundation with LLVM equivalent.Jonas Devlieghere2017-12-281-54/+34
| | | | | | | | This patch replaces a block of logic that was implemented using CoreFoundations calls with functionally equivalent logic that makes use of LLVM libraries. llvm-svn: 321522
* [YAML] Add support for non-printable charactersFrancis Visoiu Mistrih2017-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LLVM IR function names which disable mangling start with '\01' (https://www.llvm.org/docs/LangRef.html#identifiers). When an identifier like "\01@abc@" gets dumped to MIR, it is quoted, but only with single quotes. http://www.yaml.org/spec/1.2/spec.html#id2770814: "The allowed character range explicitly excludes the C0 control block allowed), the surrogate block #xD800-#xDFFF, #xFFFE, and #xFFFF." http://www.yaml.org/spec/1.2/spec.html#id2776092: "All non-printable characters must be escaped. [...] Note that escape sequences are only interpreted in double-quoted scalars." This patch adds support for printing escaped non-printable characters between double quotes if needed. Should also fix PR31743. Differential Revision: https://reviews.llvm.org/D41290 llvm-svn: 320996
* Remove redundant includes from tools.Michael Zolotukhin2017-12-131-1/+0
| | | | llvm-svn: 320631
* [dsymutil] Re-enable threadingJonas Devlieghere2017-12-131-28/+27
| | | | | | | | | | | | | | | | Threading was disabled in r317263 because it broke a test in combination with `-DLLVM_ENABLE_THREADS=OFF`. This was because a ThreadPool warning was piped to llvm-dwarfdump which was expecting to read an object from stdin. This patch re-enables threading and fixes the offending test. Unfortunately this required more than just moving the ThreadPool out of the for loop because of the TempFile refactoring that took place in the meantime. Differential revision: https://reviews.llvm.org/D41180 llvm-svn: 320601
* [dsymutil] Accept line tables up to DWARFv5.Jonas Devlieghere2017-12-121-3/+8
| | | | | | | | | | | This patch removes the hard-coded check for DWARFv2 line tables. Now dsymutil accepts line tables for DWARF versions 2 to 5 (inclusive). Differential revision: https://reviews.llvm.org/D41084 rdar://35968319 llvm-svn: 320469
* [dsymutil] Add -verify option to run DWARF verifier after linking.Jonas Devlieghere2017-12-071-0/+41
| | | | | | | | | | | This patch adds support for running the DWARF verifier on the linked debug info files. If the -verify options is specified and verification fails, dsymutil exists with abort with non-zero exit code. This behavior is *not* enabled by default. Differential revision: https://reviews.llvm.org/D40777 llvm-svn: 320033
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 llvm-svn: 319840
* [dsymutil] Exclude namespace from ifdef in CFBundleJonas Devlieghere2017-11-301-0/+2
| | | | | | Should fix build failure introduced by r319416 on non-darwin hosts. llvm-svn: 319417
* [dsymutil] Upstream getBundleInfo implementationJonas Devlieghere2017-11-304-17/+255
| | | | | | | | | | | | | This patch implements `getBundleInfo`, which uses CoreFoundation to obtain information about the CFBundle. This information is needed to populate the Plist in the dSYM bundle. This change only applies to darwin and is an NFC as far as other platforms are concerned. Differential revision: https://reviews.llvm.org/D40244 llvm-svn: 319416
* Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular ↵David Blaikie2017-11-271-1/+1
| | | | | | header as much as it is for stamping out some global/static variables llvm-svn: 319086
* Try to fix the windows build.Rafael Espindola2017-11-171-2/+2
| | | | llvm-svn: 318535
* Use TempFile in dsymutil.Rafael Espindola2017-11-171-60/+49
| | | | | | | I don't think there is any functionality change, but the code is easier to understand IMHO. llvm-svn: 318534
* make exitDsymutil static.Rafael Espindola2017-11-163-17/+23
| | | | | | | | | The objective is to remove it completelly. This first patch removes the last use outside dsymutil.cpp and makes it static. llvm-svn: 318429
* Simplify file handling in dsymutil.Rafael Espindola2017-11-153-33/+27
| | | | | | | | | | | This moves the file handling out of DwarfLinker.cpp. This fixes what is at least an oddity if not a bug. DwarfLinker.cpp was using ToolOutputFile, which uses RemoveFileOnSignal. The issue is that dsymutil.cpp uses that too. It is now clear from the interface that only dsymutil.cpp is responsible for creating and deleting files. llvm-svn: 318334
* [DWARFv5] Support DW_FORM_strp in the .debug_line header.Paul Robinson2017-11-071-3/+3
| | | | | | | | Supporting this form in .debug_line.dwo will be done as a follow-up. Differential Revision: https://reviews.llvm.org/D33155 llvm-svn: 317607
* Fix llvm-dsymutil test in -DLLVM_ENABLE_THREADS=OFF modeHans Wennborg2017-11-021-4/+5
| | | | | | | After r316999, tools/dsymutil/X86/alias.test started failing in builds that have threading disabled. llvm-svn: 317263
* [dsymutil][doc] Improve wording in manpage and rename file.Jonas Devlieghere2017-11-021-2/+2
| | | | | | | | | | - Improve wording - Rename llvm-dsymutil to dsymutil - Name -arch=<arch> argument Differential revision: https://reviews.llvm.org/D39561 llvm-svn: 317226
* [dsymutil, llvm-objcopy] Fix some Clang-tidy modernize and Include What You ↵Eugene Zelenko2017-11-016-112/+285
| | | | | | Use warnings; other minor fixes (NFC). llvm-svn: 317123
* [dsymutil][NFC} Rename thread related command line optionsJonas Devlieghere2017-11-011-6/+6
| | | | | | | | | | | This makes the command line options consistent with llvm-cov and llvm-profdata, which both use `-num-threads` and `-j`. This also addresses the conflict reported after landing D39355. Differential revision: https://reviews.llvm.org/D39496 llvm-svn: 317104
* [dsymutil] Implement the --threads optionJonas Devlieghere2017-10-312-10/+46
| | | | | | | | | | | | | | This patch adds the --threads option to dsymutil to process architectures in parallel. The feature is already present in the version distributed with Xcode, but was not yet upstreamed. This is NFC as far as the linking behavior is concerned. As threads are used automatically, the current tests cover the change in implementation. Differential revision: https://reviews.llvm.org/D39355 llvm-svn: 316999
* [dsymutil] Check AttrInfo.Name validity before using itKeno Fischer2017-10-261-1/+2
| | | | | | | | | | | | | | | | | | Summary: This upstreams a patch from the osxcross [1] toolchain. It appears that llvm-dsymutil crashes at this place during GCC bootstrap. Adding the check here seems reasonable, since it operates on arbitrary input DWARF, not necessarily generated by the LLVM toolchain, and it seems the un-mangled name need not necessarily exist. Patch by Thomas Pöchtrager [1] https://github.com/tpoechtrager/osxcross Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D39336 llvm-svn: 316678
* Re-land "[dsymutil] Timestmap verification for __swift_ast"Jonas Devlieghere2017-10-134-20/+40
| | | | | | | | | | This patch adds timestamp verification for swiftmodule files. A new flag is provided to allows us to disable this check in order to allow testing of this feature. Differential revision: https://reviews.llvm.org/D38686 llvm-svn: 315684
* [MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.Lang Hames2017-10-111-2/+3
| | | | | | | | MCObjectStreamer owns its MCCodeEmitter -- this fixes the types to reflect that, and allows us to remove the last instance of MCObjectStreamer's weird "holding ownership via someone else's reference" trick. llvm-svn: 315531
* Revert "[dsymutil] Timestmap verification for __swift_ast"Jonas Devlieghere2017-10-114-40/+20
| | | | | | This reverts commit r315456. llvm-svn: 315458
* [dsymutil] Timestmap verification for __swift_astJonas Devlieghere2017-10-114-20/+40
| | | | | | | | | | | | This patch adds timestamp verification for swiftmodule files. - A new flag is provided to allows us to continue testing of the code for embedding the__swift_ast. (git doesn't maintain timestamps) - Adds a new test for fat (arm) binaries. Differential revision: https://reviews.llvm.org/D38686 llvm-svn: 315456
* [MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.Lang Hames2017-10-111-2/+2
| | | | | | | | MCObjectStreamer owns its MCAsmBackend -- this fixes the types to reflect that, and allows us to remove another instance of MCObjectStreamer's weird "holding ownership via someone else's reference" trick. llvm-svn: 315410
* [dsymutil] Emit valid debug locations when no symbol flags are setFrancis Ricci2017-10-091-1/+3
| | | | | | | | | | | | | | | | | Summary: swiftc emits symbols without flags set, which led dsymutil to ignore them when searching for global symbols, causing dwarf location data to be omitted. Xcode's dsymutil handles this case correctly, and emits valid location data. Add this functionality to llvm-dsymutil by allowing parsing of symbols with no flags set. Reviewers: aprantl, friss, JDevlieghere Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38587 llvm-svn: 315218
* Revert "[dsymutil] Emit valid debug locations when no symbol flags are set"Francis Ricci2017-10-061-3/+1
| | | | | | This reverts commit r315082, which fails on non-darwin buildbots. llvm-svn: 315088
* [dsymutil] Emit valid debug locations when no symbol flags are setFrancis Ricci2017-10-061-1/+3
| | | | | | | | | | | | | | | | | Summary: swiftc emits symbols without flags set, which led dsymutil to ignore them when searching for global symbols, causing dwarf location data to be omitted. Xcode's dsymutil handles this case correctly, and emits valid location data. Add this functionality to llvm-dsymutil by allowing parsing of symbols with no flags set. Reviewers: aprantl, friss, JDevlieghere Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38587 llvm-svn: 315082
* [llvm-dsymutil] Add support for __swift_ast MachO DWARF sectionFrancis Ricci2017-10-065-16/+55
| | | | | | | | | | | | | | | | | | | | Summary: Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging, and which contains a byte-for-byte dump of the swiftmodule file. Add this feature to llvm-dsymutil. Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of `__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil (Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the __swift_ast section). Reviewers: aprantl, friss Subscribers: llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D38504 llvm-svn: 315066
* Revert "[llvm-dsymutil] Add support for __swift_ast MachO DWARF section"Francis Ricci2017-10-055-55/+16
| | | | | | | | Breaks aarch64 builders This reverts commit r315014. llvm-svn: 315034
* [llvm-dsymutil] Add support for __swift_ast MachO DWARF sectionFrancis Ricci2017-10-055-16/+55
| | | | | | | | | | | | | | | | | | | | Summary: Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging, and which contains a byte-for-byte dump of the swiftmodule file. Add this feature to llvm-dsymutil. Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of `__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil (Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the __swift_ast section). Reviewers: aprantl, friss Subscribers: llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D38504 llvm-svn: 315014
* Revert "[llvm-dsymutil] Add support for __swift_ast MachO DWARF section"Francis Ricci2017-10-055-55/+16
| | | | | | This reverts commit r315004, because of a failing test on non-apple platforms llvm-svn: 315009
* [dsymutil] Fix unused variable warningFrancis Ricci2017-10-051-1/+1
| | | | llvm-svn: 315006
* [llvm-dsymutil] Add support for __swift_ast MachO DWARF sectionFrancis Ricci2017-10-055-16/+55
| | | | | | | | | | | | | | | | | | | | Summary: Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging, and which contains a byte-for-byte dump of the swiftmodule file. Add this feature to llvm-dsymutil. Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of `__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil (Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the __swift_ast section). Reviewers: aprantl, friss Subscribers: llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D38504 llvm-svn: 315004
* Fix 80 column violationsAdrian Prantl2017-09-301-4/+8
| | | | llvm-svn: 314575
* [dsymutil] Better support for symbol aliasesJonas Devlieghere2017-09-261-0/+24
| | | | | | | | | | | This patch adds logic to follow a symbol's aliases when the symbol name cannot be found in the current object file. It checks the main binary for the symbol's address and queries the current object for its aliases (symbols with the same address) before printing out a warning. Differential revision: https://reviews.llvm.org/D38230 llvm-svn: 314198
* [dsymutil] Don't resolve DIE reference to NULL DIE.Jonas Devlieghere2017-09-211-2/+6
| | | | | | | | | | | | | This patch prevents dsymutil from resolving a reference to a NULL DIE when a bogus reference happens to be coincidentally referencing a NULL DIE. Now this is detected as an invalid reference and a warning is printed. Fixes: https://bugs.llvm.org/show_bug.cgi?id=33873 Differential revision: https://reviews.llvm.org/D38078 llvm-svn: 313872
* llvm-dwarfdump: implement --recurse-depth=<N>Adrian Prantl2017-09-201-4/+8
| | | | | | | | | | This patch implements the Darwin dwarfdump option --recurse-depth=<N>, which limits the recursion depth when selectively printing DIEs at an offset. Differential Revision: https://reviews.llvm.org/D38064 llvm-svn: 313778
* Convenience/safety fix for llvm::sys::Execute(And|No)WaitAlexander Kornienko2017-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Change the type of the Redirects parameter of llvm::sys::ExecuteAndWait, ExecuteNoWait and other APIs that wrap them from `const StringRef **` to `ArrayRef<Optional<StringRef>>`, which is safer and simplifies the use of these APIs (no more local StringRef variables just to get a pointer to). Corresponding clang changes will be posted as a separate patch. Reviewers: bkramer Reviewed By: bkramer Subscribers: vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D37563 llvm-svn: 313155
* [dwarfdump] Rename Brief to Verbose in DIDumpOptionsJonas Devlieghere2017-09-131-6/+17
| | | | | | | | | | | This patches renames "brief" to "verbose" in de DIDumpOptions and inverts the logic to match the new behavior where brief is the default. Changing the default value uncovered some bugs related to the DIDumpOptions not being propagated and have been fixed as well. Differential revision: https://reviews.llvm.org/D37745 llvm-svn: 313139
* Don't call exit from cl::PrintHelpMessage.Rafael Espindola2017-09-071-1/+3
| | | | | | | | | Most callers were not expecting the exit(0) and trying to exit with a different value. This also adds back the call to cl::PrintHelpMessage in llvm-ar. llvm-svn: 312761
* [dsymutil] Don't mark forward declarations as canonical.Jonas Devlieghere2017-08-311-17/+45
| | | | | | | | | | | | | | | | | | This patch completes the work done by Frederic Riss to addresses dsymutil incorrectly considering forward declaration as canonical during uniquing. This resulted in references to the forward declaration even after the definition was encountered. In addition to the test provided by Alexander Shaposhnikov in D29609, I added another test to cover several scenarios that were mentioned in his conversation with Fred. We now also check that uniquing still occurs after the definition was encountered. For more context please refer to D29609 Differential revision: https://reviews.llvm.org/D37127 llvm-svn: 312274
* Revert "[dsymutil] Don't mark forward declarations as canonical."Jonas Devlieghere2017-08-311-45/+17
| | | | | | This reverts commit r312264. llvm-svn: 312271
* [dsymutil] Don't mark forward declarations as canonical.Jonas Devlieghere2017-08-311-17/+45
| | | | | | | | | | | | | | | | | | This patch completes the work done by Frederic Riss to addresses dsymutil incorrectly considering forward declaration as canonical during uniquing. This resulted in references to the forward declaration even after the definition was encountered. In addition to the test provided by Alexander Shaposhnikov in D29609, I added another test to cover several scenarios that were mentioned in his conversation with Fred. We now also check that uniquing still occurs after the definition was encountered. For more context please refer to D29609 Differential revision: https://reviews.llvm.org/D37127 llvm-svn: 312264
* dsymutil: don't copy compile units without children from PCM filesAdrian Prantl2017-08-221-0/+2
| | | | | | rdar://problem/33830532 llvm-svn: 311416
* dsymutil: support dwarf version mismatches between object and clang moduleAdrian Prantl2017-08-081-1/+3
| | | | | | | | | | This adds a missing call to maybeUpdateMaxDwarfVersion when visitng a clang module. Failing to do so will cause a failure when emitting DWARF 4 forms into a CU that AsmPrinter believes to be DWARF 2. rdar://problem/33666528 llvm-svn: 310392
* Don't pass the code model to MCRafael Espindola2017-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I was surprised to see the code model being passed to MC. After all, it assembles code, it doesn't create it. The one place it is used is in the expansion of .cfi directives to handle .eh_frame being more that 2gb away from the code. As far as I can tell, gnu assembler doesn't even have an option to enable this. Compiling a c file with gcc -mcmodel=large produces a regular looking .eh_frame. This is probably because in practice linker parse and recreate .eh_frames. In llvm this is used because the JIT can place the code and .eh_frame very far apart. Ideally we would fix the jit and delete this option. This is hard. Apart from confusion another problem with the current interface is that most callers pass CodeModel::Default, which is bad since MC has no way to map it to the target default if it actually needed to. This patch then replaces the argument with a boolean with a default value. The vast majority of users don't ever need to look at it. In fact, only CodeGen and llvm-mc use it and llvm-mc just to enable more testing. llvm-svn: 309884
OpenPOWER on IntegriCloud