- Oct 11, 2017
-
-
Vlad Tsyrklevich authored
Summary: Move llvm-cfi-verify into a class in preparation for CFI analysis to come. Reviewers: vlad.tsyrklevich Reviewed By: vlad.tsyrklevich Subscribers: mgorny, llvm-commits, pcc, kcc Differential Revision: https://reviews.llvm.org/D38379 llvm-svn: 315504
-
Zachary Turner authored
llvm-svn: 315501
-
Zachary Turner authored
Previously we would only look in the current directory for a resource, which might not be the same as the directory of the rc file. Furthermore, MSVC rc supports a /I option, and can also look in the system environment. This patch adds support for this search algorithm. Differential Revision: https://reviews.llvm.org/D38740 llvm-svn: 315499
-
Jake Ehrlich authored
Reland "[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving only program headers and loadable segment data" ubsan caught an issue I made where I was converting a null pointer to a reference. elf utils implements a particularly extreme form of stripping that I'd like to support. eu-strip has an option called "strip-sections" that removes all section headers and leaves only program headers and the segment data. I have implemented this option partly as a test but mainly because in Fuchsia we would like to use this option to minimize the size of our executables. The other strip options that are on my list include --strip-all and --strip-debug. This is a preliminary implementation that I'd like to start using in Fuchsia builds if possible. This change implements such a stripping option for llvm-objcopy Differential Revision: https://reviews.llvm.org/D38335 llvm-svn: 315484
-
Rafael Espindola authored
llvm-svn: 315477
-
Jonas Devlieghere authored
This reverts commit r315456. llvm-svn: 315458
-
Jonas Devlieghere authored
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
-
Simon Dardis authored
llvm-svn: 315447
-
Jake Ehrlich authored
Revert "[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving only program headers and loadable segment data" This reverts commit rL315412 llvm-svn: 315417
-
Jake Ehrlich authored
[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving only program headers and loadable segment data elf utils implements a particularly extreme form of stripping that I'd like to support. eu-strip has an option called "strip-sections" that removes all section headers and leaves only program headers and the segment data. I have implemented this option partly as a test but mainly because in Fuchsia we would like to use this option to minimize the size of our executables. The other strip options that are on my list include --strip-all and --strip-debug. This is a preliminary implementation that I'd like to start using in Fuchsia builds if possible. This change implements such a stripping option for llvm-objcopy Differential Revision: https://reviews.llvm.org/D38335 llvm-svn: 315412
-
Lang Hames authored
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
-
Jake Ehrlich authored
This change adds the ability to use the "-R"/"-remove-section" option multiple times. Differential Revision: https://reviews.llvm.org/D38332 llvm-svn: 315385
-
- Oct 10, 2017
-
-
Jake Ehrlich authored
[llvm-objcopy] Fix latent bug that allowed some Sections to be improperly cast to StringTableSections If a Section had Type SHT_STRTAB (which could happen if you had a .dynstr section) it was possible to cast Section to StringTableSection and get away with any operation that was supported by SectionBase without it being noticed. This change makes this bug easier to notice and fixes it where it occurred. It also made me realize that there was some duplication of efforts in the loop that calls ::initialize. These issues are all fixed by this change. Differential Revision: https://reviews.llvm.org/D38329 llvm-svn: 315372
-
Vlad Tsyrklevich authored
This reverts commit r315363. It has a simple build failure, but more importantly I want to confirm that unit tests run in check-all to make sure that they don't silently break in the future. llvm-svn: 315370
-
Vlad Tsyrklevich authored
Summary: Move llvm-cfi-verify into a class in preparation for CFI analysis to come. Reviewers: vlad.tsyrklevich Reviewed By: vlad.tsyrklevich Subscribers: mgorny, llvm-commits, pcc, kcc Differential Revision: https://reviews.llvm.org/D38379 llvm-svn: 315363
-
Roman Lebedev authored
Summary: D36624 added some python3 compatibility. But that fix has a problem.. With python2 (which is specified by `#!/usr/bin/env python2.7`), if the env variables do not specify the UTF8, and the source file is UTF8 (contains non-ASCII symbols), then the `.decode('utf-8')` causes the following exception: ``` Reading YAML files... Rendering HTML files... 8 of 41Traceback (most recent call last): File "/build/llvm/tools/opt-viewer/opt-viewer.py", line 277, in <module> print_progress) File "/build/llvm/tools/opt-viewer/opt-viewer.py", line 213, in generate_report should_print_progress) File "/build/llvm/tools/opt-viewer/optpmap.py", line 45, in pmap result = map(_wrapped_func, func_and_args, *args, **kwargs) File "/build/llvm/tools/opt-viewer/optpmap.py", line 25, in _wrapped_func return func(argument) File "/build/llvm/tools/opt-viewer/opt-viewer.py", line 174, in _render_file SourceFileRenderer(source_dir, output_dir, filename).render(remarks) File "/build/llvm/tools/opt-viewer/opt-viewer.py", line 125, in render self.render_source_lines(self.source_stream, line_remarks) File "/build/llvm/tools/opt-viewer/opt-viewer.py", line 79, in render_source_lines </tr>'''.format(**locals()), file=self.stream) UnicodeEncodeError: 'ascii' codec can't encode character u'\xf4' in position 47: ordinal not in range(128) ``` This is similar to https://bugs.llvm.org/show_bug.cgi?id=33548, which was fixed by https://reviews.llvm.org/D37661 Unlike that fix, here, *removing* `.decode('utf-8')` actually fixes it. Since i assume that the original fix is needed, i simply made that fix conditional, since for python2 it actually breaks things. Reviewers: modocache, anemet Reviewed By: anemet Subscribers: fhahn, llvm-commits Differential Revision: https://reviews.llvm.org/D38289 llvm-svn: 315350
-
Jake Ehrlich authored
This change adds support for removing sections using the -R field (as GNU objcopy does as well). This change should let us add many helpful tests and is a proper stepping stone for adding more general kinds of stripping. Differential Revision: https://reviews.llvm.org/D38260 llvm-svn: 315346
-
Jake Ehrlich authored
I forgot to add a proper commit message. I'm reverting this to fix that. This reverts commit r315344. llvm-svn: 315345
-
Jake Ehrlich authored
llvm-svn: 315344
-
Zachary Turner authored
llvm-svn: 315248
-
- Oct 09, 2017
-
-
Francis Ricci authored
llvm-svn: 315243
-
Zachary Turner authored
Some functions were taking Twine's not by const&, these are all fixed to take by const&. We also had a case where some functions were overloaded to accept by const& and &&. Now there is only one version which accepts by value and move's the value. llvm-svn: 315229
-
Francis Ricci authored
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
-
Zachary Turner authored
This allows rc files to have comments. Eventually we should just use clang's c preprocessor, but that's a bit larger effort for minimal gain, and this is straightforward. Differential Revision: https://reviews.llvm.org/D38651 llvm-svn: 315207
-
- Oct 08, 2017
-
-
Benjamin Kramer authored
llvm-svn: 315185
-
- Oct 07, 2017
-
-
Zachary Turner authored
llvm-svn: 315128
-
Zachary Turner authored
This allows the escape sequences (\a, \n, \r, \t, \\, \x[0-9a-f]*, \[0-7]*, "") to appear in .rc scripts. These are parsed and output in the same way as it's done in original MS implementation. The way these sequences are processed depends on the type of the resource it resides in, and on whether the user declared the string to be "wide" or "narrow". I tried to maintain the maximum compatibility with the original tool (and fail in some erroneous situations that are accepted by .rc). However, there are some (extremely rare) cases where Microsoft tool outputs nonsense. I found it infeasible to detect such casses. Patch by Marek Sokolowski Differential Revision: https://reviews.llvm.org/D38426 llvm-svn: 315118
-
- Oct 06, 2017
-
-
Zachary Turner authored
This allows rc to serialize user-defined resources, as documented at: msdn.microsoft.com/en-us/library/windows/desktop/aa381054.aspx Escape sequences are yet unavailable, and are to be added in one of child patches. Patch by: Marek Sokolowski Differential Revision: https://reviews.llvm.org/D38423 llvm-svn: 315117
-
Zachary Turner authored
This allows llvm-rc to serialize STRINGTABLE resources. These are output in an unusual way: we locate them at the end of the file, and strings are merged into bundles of max 16 strings, depending on their IDs, language, and characteristics. Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa381050.aspx Patch by: Marek Sokolowski Differential Revision: https://reviews.llvm.org/D38420 llvm-svn: 315112
-
Zachary Turner authored
This is now able to dump VERSIONINFO resources. Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx Differential Revision: https://reviews.llvm.org/D38410 Patch by: Marek Sokolowski llvm-svn: 315110
-
Zachary Turner authored
This is part 6 of llvm-rc serialization. This adds ability to output cursors and icons as resources. Unfortunately, we can't just copy .cur or .ico files to output - as each file might contain multiple images, each of them needs to be unpacked and stored as a separate resource. This forces us to parse cursor and icon contents. (Fortunately, these formats are pretty similar and can be processed by mostly common code). As test files are binary, here is a short explanation of .cur and .ico files stored: cursor.cur, cursor-8.cur, cursor-32.cur are sample correct cursor files, differing in their bit depth. icon-old.ico, icon-new.ico are sample correct icon files; icon-png.ico is a sample correct icon file in PNG format (instead of usual BMP); cursor-eof.cur is an incorrect cursor file - this is cursor.cur with some of its final bytes removed. cursor-bad-offset.cur is an incorrect cursor file - image header states that image data begins at offset 0xFFFFFFFF. Sample correct cursors and icons were created by Nico Weber. Patch by Marek Sokolowski Differential Revision: https://reviews.llvm.org/D37878 llvm-svn: 315109
-
Zachary Turner authored
This is part 5 of llvm-rc serialization support. This allows DIALOG and DIALOGEX to serialize if dialog-specific optional statements are provided. These are (as of now): CAPTION, FONT, and STYLE. Notably, FONT statement can take more than two arguments when describing DIALOGEX resources (as in msdn.microsoft.com/en-us/library/windows/desktop/aa381013.aspx). I made some changes to the parser to reflect this fact. Patch by Marek Sokolowski Differential Revision: https://reviews.llvm.org/D37864 llvm-svn: 315104
-
Adrian Prantl authored
llvm-svn: 315102
-
Adrian Prantl authored
At the last LLVM dev meeting we had a debug info for optimized code BoF session. In that session I presented some graphs that showed how the quality of the debug info produced by LLVM changed over the last couple of years. This is a cleaned up version of the patch I used to collect the this data. It is implemented as an extension of llvm-dwarfdump, adding a new --statistics option. The intended use-case is to automatically run this on the debug info produced by, e.g., our bots, to identify eyebrow-raising changes or regressions introduced by new transformations that we could act on. In the current form, two kinds of data are being collected: - The number of variables that have a debug location versus the number of variables in total (this takes into account inlined instances of the same function, so if a variable is completely missing form only one instance it will be found). - The PC range covered by variable location descriptions versus the PC range of all variables' containing lexical scopes. The output format is versioned and extensible, so I'm looking forward to both bug fixes and ideas for other data that would be interesting to track. Differential Revision: https://reviews.llvm.org/D36627 llvm-svn: 315101
-
Francis Ricci authored
This reverts commit r315082, which fails on non-darwin buildbots. llvm-svn: 315088
-
Francis Ricci authored
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
-
Francis Ricci authored
llvm-svn: 315072
-
Francis Ricci authored
Summary: xar_open and xar_iter_new require manual calls to close/free functions to deallocate resources. This makes it easy to introduce memory leaks, so add RAII struct wrappers for these resources. Reviewers: enderby, rafael, compnerd, lhames, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38598 llvm-svn: 315069
-
Francis Ricci authored
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
-
Francis Ricci authored
Breaks aarch64 builders This reverts commit r315014. llvm-svn: 315034
-