Skip to content
Snippets Groups Projects
  1. Jun 20, 2016
  2. May 31, 2016
    • Manman Ren's avatar
      PCH + module: make sure we write out macros associated with builtin identifiers. · f8601b27
      Manman Ren authored
      When we import a module that defines a builtin identifier from prefix header and
      precompile the prefix header, the macro information related to the identifier
      is lost.
      
      If we don't precompile the prefix header, the source file can still see the
      macro information. The reason is that we write out the identifier in the pch
      but not the macro information since the macro is not defined locally.
      
      This is related to r251565. In that commit, if we read a builtin identifier from
      a module that wasn't "interesting" to that module, we will still write it out to
      a PCH that imports that module.
      
      The fix is to write exported module macros for PCH as well.
      
      rdar://24666630
      
      Differential Revision: http://reviews.llvm.org/D20383
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271310 91177308-0d34-0410-b5e6-96231b3b80d8
      f8601b27
  3. May 13, 2016
  4. May 09, 2016
  5. Apr 29, 2016
  6. Apr 28, 2016
  7. Apr 27, 2016
  8. Apr 18, 2016
  9. Apr 14, 2016
  10. Apr 13, 2016
  11. Apr 08, 2016
  12. Apr 06, 2016
  13. Apr 02, 2016
  14. Mar 30, 2016
    • Vassil Vassilev's avatar
      [modules] Write out identifiers if the ID is local, too. · f7eadeaf
      Vassil Vassilev authored
      In some cases a slot for an identifier is requested but it gets written to
      another module, causing an assertion.
      
      At the point when we start serializing Rtypes, we have no imported IdentifierID
      for float_round_style. We start serializing stuff and allocate an ID for it.
      Then, during the serialization process, we pull in the identifier info for it
      from TSchemaHelper. Finally, WriteIdentifierTable decides that the identifier
      has not changed since it was deserialized, so doesn't emit it.
      
      Fixes https://llvm.org/bugs/show_bug.cgi?id=27041
      
      Discussed on IRC with Richard Smith. Agreed on post commit review if needed.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264913 91177308-0d34-0410-b5e6-96231b3b80d8
      f7eadeaf
  15. Mar 27, 2016
  16. Mar 21, 2016
    • Faisal Vali's avatar
      [Cxx1z] Implement Lambda Capture of *this by Value as [=,*this] (P0018R3) · 60783472
      Faisal Vali authored
      Implement lambda capture of *this by copy.
      For e.g.:
      struct A {
      
        int d = 10;
        auto foo() { return [*this] (auto a) mutable { d+=a; return d; }; }
      
      };
      
      auto L = A{}.foo(); // A{}'s lifetime is gone.
      
      // Below is still ok, because *this was captured by value.
      assert(L(10) == 20);
      assert(L(100) == 120);
      
      If the capture was implicit, or [this] (i.e. *this was captured by reference), this code would be otherwise undefined.
      
      Implementation Strategy:
        - amend the parser to accept *this in the lambda introducer
        - add a new king of capture LCK_StarThis
        - teach Sema::CheckCXXThisCapture to handle by copy captures of the
          enclosing object (i.e. *this)
        - when CheckCXXThisCapture does capture by copy, the corresponding 
          initializer expression for the closure's data member 
          direct-initializes it thus making a copy of '*this'.
        - in codegen, when assigning to CXXThisValue, if *this was captured by 
          copy, make sure it points to the corresponding field member, and
          not, unlike when captured by reference, what the field member points
          to.
        - mark feature as implemented in svn
      
      Much gratitude to Richard Smith for his carefully illuminating reviews!   
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263921 91177308-0d34-0410-b5e6-96231b3b80d8
      60783472
  17. Mar 16, 2016
  18. Mar 03, 2016
  19. Mar 01, 2016
  20. Feb 24, 2016
    • Nico Weber's avatar
      Fix rejects-valid caused by r261297. · 2f89cf41
      Nico Weber authored
      r261297 called hasUserProvidedDefaultConstructor() to check if defining a
      const object is ok.  This is incorrect for this example:
      
        struct X { template<typename ...T> X(T...); int n; };
        const X x; // formerly OK, now bogus error
      
      Instead, track if a class has a defaulted default constructor, and disallow
      a const object for classes that either have defaulted default constructors or
      if they need an implicit constructor.
      
      Bug report and fix approach by Richard Smith, thanks!
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261770 91177308-0d34-0410-b5e6-96231b3b80d8
      2f89cf41
  21. Feb 19, 2016
  22. Feb 06, 2016
  23. Feb 05, 2016
  24. Feb 04, 2016
    • Ben Langmuir's avatar
      Fix predefine for __NSConstantString struct type · 9b1a0158
      Ben Langmuir authored
      Per review feedback the name was wrong and it can be used outside
      Objective-C.
      
      Unfortunately, making the internal struct visible broke some ASTMatchers
      tests that assumed that the first record decl would be from user code,
      rather than a builtin type.  I'm worried that this will also affect
      users' code.  So this patch adds a typedef to wrap the internal struct
      and only makes the typedef visible to namelookup.  This is sufficient to
      allow the ASTReader to merge the decls we need without making the struct
      itself visible.
      
      rdar://problem/24425801
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259734 91177308-0d34-0410-b5e6-96231b3b80d8
      9b1a0158
  25. Feb 03, 2016
    • Quentin Colombet's avatar
      Reapply r259624, it is likely not the commit causing the bot failures. · 806d823f
      Quentin Colombet authored
      Original message:
      Make CF constant string decl visible to name lookup to fix module errors
      
      The return type of the __builtin___*StringMakeConstantString functions
      is a pointer to a struct, so we need that struct to be visible to name
      lookup so that we will correctly merge multiple declarations of that
      type if they come from different modules.
      
      Incidentally, to make this visible to name lookup we need to rename the
      type to __NSConstantString, since the real NSConstantString is an
      Objective-C interface type.  This shouldn't affect anyone outside the
      compiler since users of the constant string builtins cast the result
      immediately to CFStringRef.
      
      Since this struct type is otherwise implicitly created by the AST
      context and cannot access namelookup, we make this a predefined type
      and initialize it in Sema.
      
      Note: this issue of builtins that refer to types not visible to name
      lookup technically also affects other builtins (e.g. objc_msgSendSuper),
      but in all other cases the builtin is a library builtin and the issue
      goes away if you include the library that defines the types it uses,
      unlike for these constant string builtins.
      
      rdar://problem/24425801
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259721 91177308-0d34-0410-b5e6-96231b3b80d8
      806d823f
    • Quentin Colombet's avatar
      Revert r259624 - Make CF constant string decl visible to name lookup to fix module errors. · 9feb9642
      Quentin Colombet authored
      This breaks some internal bots in stage2: clang seg fault.
      Looking with Ben to see what is going on.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259715 91177308-0d34-0410-b5e6-96231b3b80d8
      9feb9642
    • Ben Langmuir's avatar
      Make CF constant string decl visible to name lookup to fix module errors · f4907ca1
      Ben Langmuir authored
      The return type of the __builtin___*StringMakeConstantString functions
      is a pointer to a struct, so we need that struct to be visible to name
      lookup so that we will correctly merge multiple declarations of that
      type if they come from different modules.
      
      Incidentally, to make this visible to name lookup we need to rename the
      type to __NSConstantString, since the real NSConstantString is an
      Objective-C interface type.  This shouldn't affect anyone outside the
      compiler since users of the constant string builtins cast the result
      immediately to CFStringRef.
      
      Since this struct type is otherwise implicitly created by the AST
      context and cannot access namelookup, we make this a predefined type
      and initialize it in Sema.
      
      Note: this issue of builtins that refer to types not visible to name
      lookup technically also affects other builtins (e.g. objc_msgSendSuper),
      but in all other cases the builtin is a library builtin and the issue
      goes away if you include the library that defines the types it uses,
      unlike for these constant string builtins.
      
      rdar://problem/24425801
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259624 91177308-0d34-0410-b5e6-96231b3b80d8
      f4907ca1
  26. Jan 09, 2016
  27. Jan 06, 2016
    • John McCall's avatar
      Only instantiate a default argument once. · d201541d
      John McCall authored
      By storing the instantiated expression back in the ParmVarDecl,
      we remove the last need for separately storing the sub-expression
      of a CXXDefaultArgExpr.  This makes PCH/Modules merging quite
      simple: CXXDefaultArgExpr records are serialized as references
      to the ParmVarDecl, and we ignore redundant attempts to overwrite
      the instantiated expression.
      
      This has some extremely marginal impact on user-facing semantics.
      However, the major effect is that it avoids IRGen errors about
      conflicting definitions due to lambdas in the argument being
      instantiated multiple times while sharing the same mangling.
      It should also slightly improve memory usage and module file size.
      
      rdar://23810407
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256983 91177308-0d34-0410-b5e6-96231b3b80d8
      d201541d
Loading