Skip to content
  1. Feb 17, 2012
    • Douglas Gregor's avatar
      Rework the Sema/AST/IRgen dance for the lambda closure type's · 355efbb2
      Douglas Gregor authored
      conversion to function pointer. Rather than having IRgen synthesize
      the body of this function, we instead introduce a static member
      function "__invoke" with the same signature as the lambda's
      operator() in the AST. Sema then generates a body for the conversion
      to function pointer which simply returns the address of __invoke. This
      approach makes it easier to evaluate a call to the conversion function
      as a constant, makes the linkage of the __invoke function follow the
      normal rules for member functions, and may make life easier down the
      road if we ever want to constexpr'ify some of lambdas.
      
      Note that IR generation is responsible for filling in the body of
      __invoke (Sema just adds a dummy body), because the body can't
      generally be expressed in C++.
      
      Eli, please review!
      
      llvm-svn: 150783
      355efbb2
    • Richard Smith's avatar
      PR12012: Fix a regression in r150419 where we would try (and fail) to · 5d108606
      Richard Smith authored
      zero-initialize class types with virtual bases when constant-evaluating an
      initializer.
      
      llvm-svn: 150770
      5d108606
  2. Feb 16, 2012
    • Eric Christopher's avatar
      Reapply r150631: · 4c006e55
      Eric Christopher authored
          "Add a completed/incomplete type difference. This allows us to have
          partial types for contexts and forward decls while allowing us to
          complete types later on for debug purposes.
      
          This piggy-backs on the metadata replacement and rauw changes
          for temporary nodes and takes advantage of the incremental
          support I added in earlier. This allows us to, if we decide,
          to limit adding methods and variables to structures in order
          to limit the amount of debug information output into a .o file.
      
          The caching is a bit complicated though so any thoughts on
          untangling that are welcome."
      
      with a fix:
      
       - Remove all RAUW during type construction by adding stub versions
         of types that we later complete.
      
      and some TODOs:
      
       - Add an RAUW cache for forward declared types so that we can replace
         them at the end of compilation.
       - Remove the code that updates on completed types because we no
         longer need to have that happen. We emit incomplete types on
         purpose and only want to know when we want to complete them.
      
      llvm-svn: 150752
      4c006e55
    • Eli Friedman's avatar
      Elide copy construction in new expressions. PR11757. · b971d497
      Eli Friedman authored
      llvm-svn: 150738
      b971d497
    • Richard Smith's avatar
      C++11 allows unions to have static data members. Remove the corresponding · 42973755
      Richard Smith authored
      restriction and add some tests.
      
      llvm-svn: 150721
      42973755
    • Eric Christopher's avatar
      Revert "Add a completed/incomplete type difference. This allows us to have" · 9a89705d
      Eric Christopher authored
      This reverts commit 9a68d4584afcd0853b930bd80235b58736e785b4.
      
      llvm-svn: 150637
      9a89705d
    • Eric Christopher's avatar
      Add a completed/incomplete type difference. This allows us to have · 7381907e
      Eric Christopher authored
      partial types for contexts and forward decls while allowing us to
      complete types later on for debug purposes.
      
      This piggy-backs on the metadata replacement and rauw changes
      for temporary nodes and takes advantage of the incremental
      support I added in earlier. This allows us to, if we decide,
      to limit adding methods and variables to structures in order
      to limit the amount of debug information output into a .o file.
      
      The caching is a bit complicated though so any thoughts on
      untangling that are welcome.
      
      llvm-svn: 150631
      7381907e
  3. Feb 15, 2012
    • John McCall's avatar
      Split reinterpret_casts of member pointers out from CK_BitCast; this · c62bb391
      John McCall authored
      is general goodness because representations of member pointers are
      not always equivalent across member pointer types on all ABIs
      (even though this isn't really standard-endorsed).
      
      Take advantage of the new information to teach IR-generation how
      to do these reinterprets in constant initializers.  Make sure this
      works when intermingled with hierarchy conversions (although
      this is not part of our motivating use case).  Doing this in the
      constant-evaluator would probably have been better, but that would
      require a *lot* of extra structure in the representation of
      constant member pointers:  you'd really have to track an arbitrary
      chain of hierarchy conversions and reinterpretations in order to
      get this right.  Ultimately, this seems less complex.  I also
      wasn't quite sure how to extend the constant evaluator to handle
      foldings that we don't actually want to treat as extended
      constant expressions.
      
      llvm-svn: 150551
      c62bb391
  4. Feb 14, 2012
  5. Feb 13, 2012
  6. Feb 09, 2012
  7. Feb 08, 2012
  8. Feb 06, 2012
  9. Feb 04, 2012
  10. Feb 03, 2012
  11. Feb 02, 2012
  12. Feb 01, 2012
  13. Jan 30, 2012
  14. Jan 29, 2012
  15. Jan 27, 2012
  16. Jan 26, 2012
    • Douglas Gregor's avatar
      Extend the ExternalASTSource interface to allow the AST source to · e9fc377a
      Douglas Gregor authored
      provide the layout of records, rather than letting Clang compute
      the layout itself. LLDB provides the motivation for this feature:
      because various layout-altering attributes (packed, aligned, etc.)
      don't get reliably get placed into DWARF, the record layouts computed
      by LLDB from the reconstructed records differ from the actual layouts,
      and badness occurs. This interface lets the DWARF data drive layout,
      so we don't need the attributes preserved to get the answer write.
      
      The testing methodology for this change is fun. I've introduced a
      variant of -fdump-record-layouts called -fdump-record-layouts-simple
      that always has the simple C format and provides size/alignment/field
      offsets. There is also a -cc1 option -foverride-record-layout=<file>
      to take the output of -fdump-record-layouts-simple and parse it to
      produce a set of overridden layouts, which is introduced into the AST
      via a testing-only ExternalASTSource (called
      LayoutOverrideSource). Each test contains a number of records to lay
      out, which use various layout-changing attributes, and then dumps the
      layouts. We then run the test again, using the preprocessor to
      eliminate the layout-changing attributes entirely (which would give us
      different layouts for the records), but supplying the
      previously-computed record layouts. Finally, we diff the layouts
      produced from the two runs to be sure that they are identical.
      
      Note that this code makes the assumption that we don't *have* to
      provide the offsets of bases or virtual bases to get the layout right,
      because the alignment attributes don't affect it. I believe this
      assumption holds, but if it does not, we can extend
      LayoutOverrideSource to also provide base offset information.
      
      Fixes the Clang side of <rdar://problem/10169539>.
      
      llvm-svn: 149055
      e9fc377a
    • Chris Lattner's avatar
      fix to go along with an llvm change: VMCore now returns an UndefValue · e8c94f7d
      Chris Lattner authored
      when asking for a ConstantStruct with all undef elements.
      
      llvm-svn: 149025
      e8c94f7d
    • Rafael Espindola's avatar
      Fix our handling of #pragma GCC visibility. · 273fd772
      Rafael Espindola authored
      Now the lexer just produces a token and the parser is the one responsible for
      activating it.
      This fixes problem like the one pr11797 where the lexer and the parser were not
      in sync. This also let us be more strict on where in the file we accept
      these pragmas.
      
      llvm-svn: 149014
      273fd772
    • Eli Friedman's avatar
      Don't stack-allocate an IntegerLiteral which can be referred to after the... · 9562f39e
      Eli Friedman authored
      Don't stack-allocate an IntegerLiteral which can be referred to after the current method returns.  PR11744, part 2.
      
      llvm-svn: 148995
      9562f39e
  17. Jan 25, 2012
  18. Jan 20, 2012
  19. Jan 19, 2012
  20. Jan 18, 2012
  21. Jan 16, 2012
Loading