Skip to content
Snippets Groups Projects
  1. Sep 07, 2013
  2. Aug 28, 2013
    • Reid Kleckner's avatar
      Delete CC_Default and use the target default CC everywhere · ef072033
      Reid Kleckner authored
      Summary:
      Makes functions with implicit calling convention compatible with
      function types with a matching explicit calling convention.  This fixes
      things like calls to qsort(), which has an explicit __cdecl attribute on
      the comparator in Windows headers.
      
      Clang will now infer the calling convention from the declarator.  There
      are two cases when the CC must be adjusted during redeclaration:
      1. When defining a non-inline static method.
      2. When redeclaring a function with an implicit or mismatched
      convention.
      
      Fixes PR13457, and allows clang to compile CommandLine.cpp for the
      Microsoft C++ ABI.
      
      Excellent test cases provided by Alexander Zinenko!
      
      Reviewers: rsmith
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1231
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189412 91177308-0d34-0410-b5e6-96231b3b80d8
      ef072033
  3. Aug 22, 2013
    • Manuel Klimek's avatar
      Revert "Implement a rudimentary form of generic lambdas." · 152b4e46
      Manuel Klimek authored
      This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189004 91177308-0d34-0410-b5e6-96231b3b80d8
      152b4e46
    • Craig Topper's avatar
      Constify more uses of ASTContext&. No functional change. · 32b5a1e8
      Craig Topper authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188991 91177308-0d34-0410-b5e6-96231b3b80d8
      32b5a1e8
    • Faisal Vali's avatar
      Implement a rudimentary form of generic lambdas. · ecb5819a
      Faisal Vali authored
      Specifically, the following features are not included in this commit:
        - any sort of capturing within generic lambdas 
        - nested lambdas
        - conversion operator for captureless lambdas
        - ensuring all visitors are generic lambda aware
      
      
      As an example of what compiles:
      
      template <class F1, class F2>
      struct overload : F1, F2 {
          using F1::operator();
          using F2::operator();
          overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
        };
      
        auto Recursive = [](auto Self, auto h, auto ... rest) {
          return 1 + Self(Self, rest...);
        };
        auto Base = [](auto Self, auto h) {
            return 1;
        };
        overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
        int num_params =  O(O, 5, 3, "abc", 3.14, 'a');
      
      Please see attached tests for more examples.
      
      Some implementation notes:
      
        - Add a new Declarator context => LambdaExprParameterContext to 
          clang::Declarator to allow the use of 'auto' in declaring generic
          lambda parameters
          
        - Augment AutoType's constructor (similar to how variadic 
          template-type-parameters ala TemplateTypeParmDecl are implemented) to 
          accept an IsParameterPack to encode a generic lambda parameter pack.
        
        - Add various helpers to CXXRecordDecl to facilitate identifying
          and querying a closure class
        
        - LambdaScopeInfo (which maintains the current lambda's Sema state)
          was augmented to house the current depth of the template being
          parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
          so that Sema::ActOnLambdaAutoParameter may use it to create the 
          appropriate list of corresponding TemplateTypeParmDecl for each
          auto parameter identified within the generic lambda (also stored
          within the current LambdaScopeInfo).  Additionally, 
          a TemplateParameterList data-member was added to hold the invented
          TemplateParameterList AST node which will be much more useful
          once we teach TreeTransform how to transform generic lambdas.
          
        - SemaLambda.h was added to hold some common lambda utility
          functions (this file is likely to grow ...)
          
        - Teach Sema::ActOnStartOfFunctionDef to check whether it
          is being called to instantiate a generic lambda's call
          operator, and if so, push an appropriately prepared
          LambdaScopeInfo object on the stack.
          
        - Teach Sema::ActOnStartOfLambdaDefinition to set the
          return type of a lambda without a trailing return type
          to 'auto' in C++1y mode, and teach the return type
          deduction machinery in SemaStmt.cpp to process either
          C++11 and C++14 lambda's correctly depending on the flag.    
      
        - various tests were added - but much more will be needed.
      
      A greatful thanks to all reviewers including Eli Friedman,  
      James Dennett and the ever illuminating Richard Smith.  And 
      yet I am certain that I have allowed unidentified bugs to creep in; 
      bugs, that I will do my best to slay, once identified!
      
      Thanks!
      
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188977 91177308-0d34-0410-b5e6-96231b3b80d8
      ecb5819a
  4. Aug 16, 2013
  5. Aug 13, 2013
  6. Aug 10, 2013
  7. Jun 18, 2013
  8. May 16, 2013
  9. May 05, 2013
  10. Apr 21, 2013
  11. Mar 08, 2013
  12. Feb 22, 2013
  13. Jan 12, 2013
  14. Dec 25, 2012
  15. Dec 19, 2012
    • Richard Smith's avatar
      PR13470: Ensure that copy-list-initialization isntantiates as · c83c2300
      Richard Smith authored
      copy-list-initialization (and doesn't add an additional copy step):
      
      Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it
      when instantiating initializers in order to correctly handle instantiation of
      copy-list-initialization. Teach TreeTransform that function arguments are
      initializations, and so need this special treatment too. Finally, remove some
      hacks which were working around SubstInitializer's shortcomings.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170489 91177308-0d34-0410-b5e6-96231b3b80d8
      c83c2300
    • David Blaikie's avatar
      Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per... · 3bc93e31
      David Blaikie authored
      Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review discussion in r170365
      
      This does limit these typedefs to being sequences, but no current usage
      requires them to be contiguous (we could expand this to a more general
      iterator pair range concept at some point).
      
      Also, it'd be nice if SmallVector were constructible directly from an ArrayRef
      but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the
      inverse conversion. (& generalizing over all range-like things, while nice,
      would require some nontrivial SFINAE I haven't thought about yet)
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170482 91177308-0d34-0410-b5e6-96231b3b80d8
      3bc93e31
  16. Dec 01, 2012
  17. Nov 08, 2012
  18. Nov 07, 2012
  19. Oct 18, 2012
  20. Oct 11, 2012
  21. Sep 12, 2012
  22. Aug 24, 2012
  23. Aug 21, 2012
  24. Aug 13, 2012
  25. Aug 10, 2012
  26. Aug 04, 2012
  27. Jul 25, 2012
  28. Jul 09, 2012
  29. Jul 04, 2012
  30. Jun 20, 2012
  31. Jun 19, 2012
    • Jakob Stoklund Olesen's avatar
      Revert r158700 and dependent patches r158716, r158717, and r158731. · 3532936f
      Jakob Stoklund Olesen authored
      The original r158700 caused crashes in the gcc test suite,
      g++.abi/vtable3a.C among others. It also caused failures in the libc++
      test suite.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158749 91177308-0d34-0410-b5e6-96231b3b80d8
      3532936f
    • Sean Hunt's avatar
      Improve the specification of spellings in Attr.td. · bfcb037a
      Sean Hunt authored
      Note that this is mostly a structural patch that handles the change from the old
      spelling style to the new one. One consequence of this is that all AT_foo_bar
      enum values have changed to not be based off of the first spelling, but rather
      off of the class name, so they are now AT_FooBar and the like (a straw poll on
      IRC showed support for this). Apologies for code churn.
      
      Most attributes have GNU spellings as a temporary solution until everything else
      is sorted out (such as a Keyword spelling, which I intend to add if someone else
      doesn't beat me to it). This is definitely a WIP.
      
      I've also killed BaseCheckAttr since it was unused, and I had to go through
      every attribute anyway.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158700 91177308-0d34-0410-b5e6-96231b3b80d8
      bfcb037a
Loading