Skip to content
  1. Oct 11, 2017
  2. Oct 10, 2017
    • Jake Ehrlich's avatar
      [llvm-objcopy] Fix latent bug that allowed some Sections to be improperly cast... · 70bd75f8
      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
      70bd75f8
    • Vlad Tsyrklevich's avatar
      Revert "Classify llvm-cfi-verify." · a45919f5
      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
      a45919f5
    • Vlad Tsyrklevich's avatar
      Classify llvm-cfi-verify. · b5488a22
      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
      b5488a22
    • Roman Lebedev's avatar
      [opt-viewer] Don't Decode HTML bytes for Python 2 · afd049b6
      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
      afd049b6
    • Jake Ehrlich's avatar
      [llvm-objcopy] Add support for removing sections · 36a2eb34
      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
      36a2eb34
    • Jake Ehrlich's avatar
      Revert "temporary" · c5ff7270
      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
      c5ff7270
    • Jake Ehrlich's avatar
      temporary · 77ec1ffe
      Jake Ehrlich authored
      llvm-svn: 315344
      77ec1ffe
    • Zachary Turner's avatar
      [llvm-rc] Try again to fix errors on big endian systems. · 1e2c8b11
      Zachary Turner authored
      llvm-svn: 315248
      1e2c8b11
  3. Oct 09, 2017
  4. Oct 08, 2017
  5. Oct 07, 2017
    • Zachary Turner's avatar
      [llvm-rc] Fix some endianness errors. · b12792a4
      Zachary Turner authored
      llvm-svn: 315128
      b12792a4
    • Zachary Turner's avatar
      [llvm-rc] Implement escape sequences in .rc files. · a92eb33a
      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
      a92eb33a
  6. Oct 06, 2017
    • Zachary Turner's avatar
      [llvm-rc] Serialize user-defined resources to .res files. · 9d8b358a
      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
      9d8b358a
    • Zachary Turner's avatar
      [llvm-rc] Serialize STRINGTABLE statements to .res file. · da366693
      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
      da366693
    • Zachary Turner's avatar
      [llvm-rc] Serialize VERSIONINFO resources to .res files. · 07bc04ff
      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
      07bc04ff
    • Zachary Turner's avatar
      [llvm-rc] Serialize CURSOR and ICON resources to .res · c3ab013a
      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
      c3ab013a
    • Zachary Turner's avatar
      [llvm-rc] Add optional serialization support for DIALOG(EX) resources. · 420090af
      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
      420090af
    • Adrian Prantl's avatar
      Unify spelling. · 214babea
      Adrian Prantl authored
      llvm-svn: 315102
      214babea
    • Adrian Prantl's avatar
      llvm-dwarfdump: Add an option to collect debug info quality metrics. · 59f30b88
      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
      59f30b88
    • Francis Ricci's avatar
      Revert "[dsymutil] Emit valid debug locations when no symbol flags are set" · 85255eda
      Francis Ricci authored
      This reverts commit r315082, which fails on non-darwin buildbots.
      
      llvm-svn: 315088
      85255eda
    • Francis Ricci's avatar
      [dsymutil] Emit valid debug locations when no symbol flags are set · b468fd64
      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
      b468fd64
    • Francis Ricci's avatar
      Guard xar RAII behind HAVE_LIBXAR · 195a66f6
      Francis Ricci authored
      llvm-svn: 315072
      195a66f6
    • Francis Ricci's avatar
      [llvm-objdump] Add RAII for xar apis · 6f942974
      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
      6f942974
    • Francis Ricci's avatar
      [llvm-dsymutil] Add support for __swift_ast MachO DWARF section · 8aedfde2
      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
      8aedfde2
    • Francis Ricci's avatar
      Revert "[llvm-dsymutil] Add support for __swift_ast MachO DWARF section" · b4e77d98
      Francis Ricci authored
      Breaks aarch64 builders
      
      This reverts commit r315014.
      
      llvm-svn: 315034
      b4e77d98
Loading