Skip to content
  1. Jan 26, 2018
  2. Jan 25, 2018
    • Jake Ehrlich's avatar
      [llvm-objcopy] Refactor llvm-objcopy to use reader and writer objects · 76e9110f
      Jake Ehrlich authored
      While writing code for input and output formats in llvm-objcopy it became
      apparent that there was a code health problem. This change attempts to solve
      that problem by refactoring the code to use Reader and Writer objects that can
      read in different objects in different formats, convert them to a single shared
      internal representation, and then write them to any other representation.
      
      New classes:
      Reader: the base class used to construct instances of the internal
      representation
      Writer: the base class used to write out instances of the internal
      representation
      ELFBuilder: a helper class for ELFWriter that takes an ELFFile and converts it
      to a Object
      SectionVisitor: it became necessary to remove writeSection from SectionBase
      because, under the new Reader/Writer scheme, it's possible to convert between
      ELF Types such as ELF32LE and ELF32BE. This isn't possible with writeSection
      because it (dynamically) depends on the underlying section type *and*
      (statically) depends on the ELF type. Bad things would happen if the underlying
      sections for ELF32LE were used for writing to ELF64BE. To avoid this code smell
      (which would have compiled, run, and output some nonsesnse) I decoupled writing
      of sections from a class.
      SectionWriter: This is just the ELFT templated implementation of
      SectionVisitor. Many classes now have this class as a friend so that the
      writing methods in this class can write out private data.
      ELFWriter: This is the Writer that outputs to ELF
      BinaryWriter: This is the Writer that outputs to Binary
      ElfType: Because the ELF Type is not a part of the Object anymore we need a way
      to construct the correct default Writer based on properties of the Reader. This
      enum just keeps track of the ELF type of the input so it can be used as the
      default output type as well.
      
      Object has correspondingly undergone some serious changes as well. It now has
      more generic methods for building and manipulating ELF binaries. This interface
      makes ELFBuilder easy enough to use and will make the BinaryReader/Builder easy
      to create as well. Most changes in this diff are cosmetic and deal with the
      fact that a method has been moved from one class to another or a change from a
      pointer to a reference. Almost no changes should result in a functional
      difference (this is after all a refactor). One minor functional change was made
      and the result can be seen in remove-shstrtab-error.test. The fact that it
      fails hasn't changed but the error message has changed because that failure is
      detected at a later point in the code now (because WriteSectionHeaders is a
      property of the ElfWriter *not* a property of the Object). I'd say roughly
      80-90% of this code is cosmetically different, 10-19% is different but
      functionally the same, and 1-5% is functionally different despite not causing a
      change in tests.
      
      Differential Revision: https://reviews.llvm.org/D42222
      
      llvm-svn: 323480
      76e9110f
    • Marshall Clow's avatar
      Mark 2903 as complete; we already do this · 8abbc96c
      Marshall Clow authored
      llvm-svn: 323479
      8abbc96c
    • Easwaran Raman's avatar
      Add testcase accidentally left out from r323460. · 6b7209b3
      Easwaran Raman authored
      llvm-svn: 323478
      6b7209b3
    • Jake Ehrlich's avatar
      [llvm-objcopy] Add --add-gnu-debuglink · ea07d3cf
      Jake Ehrlich authored
      This change adds support for --add-gnu-debuglink to llvm-objcopy
      
      Differential Revision: https://reviews.llvm.org/D41731
      
      llvm-svn: 323477
      ea07d3cf
    • Paul Robinson's avatar
      [DWARFv5] Support DW_FORM_line_strp in llvm-dwarfdump. · b6aa01ca
      Paul Robinson authored
      This form is like DW_FORM_strp, but points to .debug_line_str instead
      of .debug_str as the string section.  It's intended to be used from
      the line-table header, and allows string-pooling of directory and
      filenames across compilation units.
      
      Differential Revision: https://reviews.llvm.org/D42553
      
      llvm-svn: 323476
      b6aa01ca
    • Easwaran Raman's avatar
      [SyntheticCounts] Rewrite the code using only graph traits. · 8410c374
      Easwaran Raman authored
      Summary:
      The intent of this is to allow the code to be used with ThinLTO. In
      Thinlink phase, a traditional Callgraph can not be computed even though
      all the necessary information (nodes and edges of a call graph) is
      available. This is due to the fact that CallGraph class is closely tied
      to the IR. This patch first extends GraphTraits to add a CallGraphTraits
      graph. This is then used to implement a version of counts propagation
      on a generic callgraph.
      
      Reviewers: davidxl
      
      Subscribers: mehdi_amini, tejohnson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D42311
      
      llvm-svn: 323475
      8410c374
    • Joel Jones's avatar
      [AArch64] Enable aggressive FMA on T99 and provide AArch64 options for others. · 0715092c
      Joel Jones authored
      This patch enables aggressive FMA by default on T99, and provides a -mllvm
      option to enable the same on other AArch64 micro-arch's (-mllvm
      -aarch64-enable-aggressive-fma).
      
      Test case demonstrating the effects on T99 is included.
      
      Patch by: steleman (Stefan Teleman)
      
      Differential Revision: https://reviews.llvm.org/D40696
      
      llvm-svn: 323474
      0715092c
    • Nico Weber's avatar
      Don't let test write to the source dir after r323426. · 2d05fe5f
      Nico Weber authored
      llvm-svn: 323473
      2d05fe5f
    • Vedant Kumar's avatar
      [Debug] Add dbg.value intrinsics for PHIs created during LCSSA. · 60f54084
      Vedant Kumar authored
      This patch is an enhancement to propagate dbg.value information when
      Phis are created on behalf of LCSSA.  I noticed a case where a value
      carried across a loop was reported as <optimized out>.
      
      Specifically this case:
      
        int bar(int x, int y) {
          return x + y;
        }
      
        int foo(int size) {
          int val = 0;
          for (int i = 0; i < size; ++i) {
            val = bar(val, i);  // Both val and i are correct
          }
          return val; // <optimized out>
        }
      
      In the above case, after all of the interesting computation completes
      our value is reported as "optimized out." This change will add a
      dbg.value to correct this.
      
      This patch also moves the dbg.value insertion routine from
      LoopRotation.cpp into Local.cpp, so that we can share it in both places
      (LoopRotation and LCSSA).
      
      Patch by Matt Davis!
      
      Differential Revision: https://reviews.llvm.org/D42551
      
      llvm-svn: 323472
      60f54084
    • Vedant Kumar's avatar
      [Debug] Add a utility to propagate dbg.value to new PHIs, NFC · 6bfc869c
      Vedant Kumar authored
      This simply moves an existing utility to Utils for reuse.
      
      Split out of: https://reviews.llvm.org/D42551
      
      Patch by Matt Davis!
      
      llvm-svn: 323471
      6bfc869c
    • Evgeniy Stepanov's avatar
      [asan] Fix kernel callback naming in instrumentation module. · 31475a03
      Evgeniy Stepanov authored
      Right now clang uses "_n" suffix for some user space callbacks and "N" for the matching kernel ones. There's no need for this and it actually breaks kernel build with inline instrumentation. Use the same callback names for user space and the kernel (and also make them consistent with the names GCC uses).
      
      Patch by Andrey Konovalov.
      
      Differential Revision: https://reviews.llvm.org/D42423
      
      llvm-svn: 323470
      31475a03
Loading