Skip to content
  1. Mar 04, 2014
    • David Blaikie's avatar
      DebugInfo: Emit only the declaration of a class template that has an explicit... · 0e716b42
      David Blaikie authored
      DebugInfo: Emit only the declaration of a class template that has an explicit instantiation declaration (& always emit such a type when there's an explicit instantiation definition)
      
      We should only have this optimization fire when the explicit
      instantiation definition would cause at  least one member function to be
      emitted, thus ensuring that even a compiler not performing this
      optimization would still emit the full type information elsewhere.
      
      But we should also pessimize output still by always emitting the
      definition when the explicit instantiation definition appears so that at
      some point in the future we can depend on that information even when no
      code had to be emitted in that TU. (this shouldn't happen very often,
      since people mostly use explicit spec decl/defs to reduce code size -
      but perhaps one day they could use it to explicitly reduce debug info
      size too)
      
      This was worth about 2% for Clang and LLVM - so not a huge win, but a
      win. It looks really great for simple STL programs (include <string> and
      just declare a string - 14k -> 1.4k of .dwo)
      
      llvm-svn: 202769
      0e716b42
  2. Mar 03, 2014
    • Diego Novillo's avatar
      Schedule discriminator pass. · b56be645
      Diego Novillo authored
      This needs to modify a line table test to account for the new lexical
      block created to hold the new discriminator value.
      
      llvm-svn: 202754
      b56be645
  3. Mar 02, 2014
    • David Majnemer's avatar
      Normalize line endings · b1004103
      David Majnemer authored
      Some files had CRLF line terminators, some only had a mixture of
      CRLF and LF.  Switch to LF.
      
      llvm-svn: 202659
      b1004103
  4. Feb 27, 2014
  5. Feb 26, 2014
  6. Feb 25, 2014
  7. Feb 24, 2014
    • Kevin Qin's avatar
      [AArch64] Change int64_t from 'long long int' to 'long int' for AArch64 target. · ad64f6d4
      Kevin Qin authored
      Most 64-bit targets define int64_t as long int, and AArch64 should
      make same definition to follow LP64 model. In GNU tool chain, int64_t
      is defined as long int for 64-bit target. So to get consistent with GNU,
      it's better Changing int64_t from 'long long int' to 'long int',
      otherwise clang will get different name mangling suffix compared with g++.
      
      llvm-svn: 202004
      ad64f6d4
  8. Feb 22, 2014
    • Warren Hunt's avatar
      Complete Rewrite of CGRecordLayoutBuilder · fb00c887
      Warren Hunt authored
      CGRecordLayoutBuilder was aging, complex, multi-pass, and shows signs of 
      existing before ASTRecordLayoutBuilder.  It redundantly performed many 
      layout operations that are now performed by ASTRecordLayoutBuilder and 
      asserted that the results were the same.  With the addition of support 
      for the MS-ABI, such as placement of vbptrs, vtordisps, different 
      bitfield layout and a variety of other features, CGRecordLayoutBuilder 
      was growing unwieldy in its redundancy.
      
      This patch re-architects CGRecordLayoutBuilder to not perform any 
      redundant layout but rather, as directly as possible, lower an 
      ASTRecordLayout to an llvm::type.  The new architecture is significantly 
      smaller and simpler than the CGRecordLayoutBuilder and contains fewer 
      ABI-specific code paths.  It's also one pass.
      
      The architecture of the new system is described in the comments. For the 
      most part, the new system simply takes all of the fields and bases from 
      an ASTRecordLayout, sorts them, inserts padding and dumps a record. 
      Bitfields, unions and primary virtual bases make this process a bit more 
      complicated.  See the inline comments.
      
      In addition, this patch updates a few lit tests due to the fact that the 
      new system computes more accurate llvm types than CGRecordLayoutBuilder. 
      Each change is commented individually in the review.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2795
      
      llvm-svn: 201907
      fb00c887
  9. Feb 21, 2014
    • Reid Kleckner's avatar
      MS ABI: Include the vfptr offset in memptrs to virtual methods · e4a5220d
      Reid Kleckner authored
      Virtual methods expect 'this' to point to the vfptr containing the
      virtual method, and this extends to virtual member pointer thunks.  The
      relevant vfptr is always at offset zero on entry to the thunk, and no
      this adjustment is needed.
      
      Previously we would not include the vfptr adjustment in the member
      pointer, and we'd look at the vfptr offset when loading from the vftable
      in the thunk.
      
      Fixes PR18917.
      
      llvm-svn: 201835
      e4a5220d
    • David Majnemer's avatar
      Sema: Do not assert when dereferencing member pointer using virtual... · 2b0d66df
      David Majnemer authored
      Sema: Do not assert when dereferencing member pointer using virtual inheritance with an incomplete class type
      
      The MS ABI requires that we determine the vbptr offset if have a
      virtual inheritance model.  Instead, raise an error pointing to the
      diagnostic when this happens.
      
      This fixes PR18583.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2842
      
      llvm-svn: 201824
      2b0d66df
  10. Feb 19, 2014
    • Reid Kleckner's avatar
      MS ABI: Let non-virtual method overloads participate in vftable ordering · 6701de2a
      Reid Kleckner authored
      In the Microsoft ABI, the vftable is laid out as if all methods in every
      overload set were declared in reverse order of declaration at the point
      of declaration of the first overload in the set.
      
      Previously we only considered virtual methods in an overload set, but
      MSVC includes non-virtual methods for ordering purposes.
      
      Fixes PR18902.
      
      llvm-svn: 201722
      6701de2a
  11. Feb 18, 2014
  12. Feb 17, 2014
    • Bob Wilson's avatar
      Change PGO instrumentation to compute counts in a separate AST traversal. · bf854f0f
      Bob Wilson authored
      Previously, we made one traversal of the AST prior to codegen to assign
      counters to the ASTs and then propagated the count values during codegen. This
      patch now adds a separate AST traversal prior to codegen for the
      -fprofile-instr-use option to propagate the count values. The counts are then
      saved in a map from which they can be retrieved during codegen.
      
      This new approach has several advantages:
      
      1. It gets rid of a lot of extra PGO-related code that had previously been
      added to codegen.
      
      2. It fixes a serious bug. My original implementation (which was mailed to the
      list but never committed) used 3 counters for every loop. Justin improved it to
      move 2 of those counters into the less-frequently executed breaks and continues,
      but that turned out to produce wrong count values in some cases. The solution
      requires visiting a loop body before the condition so that the count for the
      condition properly includes the break and continue counts. Changing codegen to
      visit a loop body first would be a fairly invasive change, but with a separate
      AST traversal, it is easy to control the order of traversal. I've added a
      testcase (provided by Justin) to make sure this works correctly.
      
      3. It improves the instrumentation overhead, reducing the number of counters for
      a loop from 3 to 1. We no longer need dedicated counters for breaks and
      continues, since we can just use the propagated count values when visiting
      breaks and continues.
      
      To make this work, I needed to make a change to the way we count case
      statements, going back to my original approach of not including the fall-through
      in the counter values. This was necessary because there isn't always an AST node
      that can be used to record the fall-through count. Now case statements are
      handled the same as default statements, with the fall-through paths branching
      over the counter increments.  While I was at it, I also went back to using this
      approach for do-loops -- omitting the fall-through count into the loop body
      simplifies some of the calculations and make them behave the same as other
      loops. Whenever we start using this instrumentation for coverage, we'll need
      to add the fall-through counts into the counter values.
      
      llvm-svn: 201528
      bf854f0f
  13. Feb 16, 2014
  14. Feb 15, 2014
  15. Feb 12, 2014
  16. Feb 08, 2014
  17. Feb 06, 2014
  18. Feb 05, 2014
    • Reid Kleckner's avatar
      MS ABI: Fix mangling of static methods and function references · 09b47d16
      Reid Kleckner authored
      Function references always use $1? like function pointers and never $E?
      like var decl references.  Static methods are mangled like function
      pointers.
      
      llvm-svn: 200869
      09b47d16
    • Reid Kleckner's avatar
      MS ABI: Mangle member pointer template arguments · 96f8f933
      Reid Kleckner authored
      Member pointers are mangled as they would be represented at runtime.
      They can be a single integer literal, single decl, or a tuple with some
      more numbers tossed in.  With Clang today, most of those numbers will be
      zero because we reject pointers to members of virtual bases.
      
      This change required moving VTableContextBase ownership from
      CodeGenVTables to ASTContext, because mangling now depends on vtable
      layout.
      
      I also hoisted the inheritance model helpers up to be inline static
      methods of MSInheritanceAttr.  This makes the AST code that deals with
      member pointers much more readable.
      
      MSVC doesn't appear to have stable manglings of null member pointers:
      - Null data memptrs in function templates have a mangling collision with
        the first field of a non-polymorphic single inheritance class.
      - The mangling of null data memptrs changes if you add casts.
      - Large null function memptrs in class templates crash MSVC.
      
      Clang uses the class template mangling for null data memptrs and the
      function template mangling for null function memptrs to deal with this.
      
      Reviewers: majnemer
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2695
      
      llvm-svn: 200857
      96f8f933
    • Hans Wennborg's avatar
      Don't mark decls with mismatching exception specs invalid in MS mode (PR18683) · 39a509aa
      Hans Wennborg authored
      We accept these with a warning in MS mode, but we would previously mark them
      invalid, causing us not to emit code for them.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2681
      
      llvm-svn: 200815
      39a509aa
    • David Blaikie's avatar
      Further simplify r200797 and add an explanatory comment. · 535083ef
      David Blaikie authored
      llvm-svn: 200805
      535083ef
Loading