Skip to content
Snippets Groups Projects
  1. Jul 27, 2016
  2. Apr 27, 2016
  3. Apr 04, 2016
  4. Feb 24, 2016
  5. Feb 09, 2016
    • David Blaikie's avatar
      Simplify EnterTokenStream API to make it more robust for memory management · a3104319
      David Blaikie authored
      While this won't help fix things like the bug that r260219 addressed, it
      seems like good tidy up to have anyway.
      
      (it might be nice if "makeArrayRef" always produced a MutableArrayRef &
      let it decay to an ArrayRef when needed - then I'd use that for the
      MutableArrayRefs in this patch)
      
      If we had std::dynarray I'd use that instead of unique_ptr+size_t,
      ideally (but then it'd have to be threaded down through the Preprocessor
      all the way - no idea how painful that would be)
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260246 91177308-0d34-0410-b5e6-96231b3b80d8
      a3104319
  6. Jan 31, 2016
    • Bruno Cardoso Lopes's avatar
      [Parser] Update CachedTokens while parsing ObjectiveC template argument list · a0d5dbf5
      Bruno Cardoso Lopes authored
      Consider the following ObjC++ snippet:
      
      --
      @protocol PA;
      @protocol PB;
      
      @class NSArray<ObjectType>;
      typedef int some_t;
      
      id<PA> FA(NSArray<id<PB>> *h, some_t group);
      --
      
      This would hit an assertion in the parser after generating an annotation token
      while trying to update the token cache:
      
      Assertion failed: (CachedTokens[CachedLexPos-1].getLastLoc() == Tok.getAnnotationEndLoc() && "The annotation should be until the most recent cached token")
      ...
      7 clang::Preprocessor::AnnotatePreviousCachedTokens(clang::Token const&) + 494
      8 clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(bool, bool, clang::CXXScopeSpec&, bool) + 1163
      9 clang::Parser::TryAnnotateTypeOrScopeToken(bool, bool) + 361
      10 clang::Parser::isCXXDeclarationSpecifier(clang::Parser::TPResult, bool*) + 598
      ...
      
      The cached preprocessor token in this case is:
      
      greatergreater '>>' Loc=<testcase.mm:7:24>
      
      while the annotation ("NSArray<id<PB>>") ends at "testcase.mm:7:25", hence the
      assertion.
      
      Properly update the CachedTokens during template parsing to contain
      two greater tokens instead of a greatergreater.
      
      Differential Revision: http://reviews.llvm.org/D15173
      
      rdar://problem/23494277
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259311 91177308-0d34-0410-b5e6-96231b3b80d8
      a0d5dbf5
  7. Nov 02, 2015
  8. Sep 22, 2015
  9. Jul 11, 2015
  10. Jun 30, 2015
  11. Jun 25, 2015
  12. Jun 19, 2015
    • Douglas Gregor's avatar
      Introduced pragmas for audited nullability regions. · 109dad2d
      Douglas Gregor authored
      Introduce the clang pragmas "assume_nonnull begin" and "assume_nonnull
      end" in which we make default assumptions about the nullability of many
      unannotated pointers:
      
        - Single-level pointers are inferred to __nonnull
        - NSError** in a (function or method) parameter list is inferred to
          NSError * __nullable * __nullable.
        - CFErrorRef * in a (function or method) parameter list is inferred
          to CFErrorRef __nullable * __nullable.
        - Other multi-level pointers are never inferred to anything.
      
      Implements rdar://problem/19191042.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240156 91177308-0d34-0410-b5e6-96231b3b80d8
      109dad2d
  13. Jun 12, 2015
  14. Jun 01, 2015
  15. May 29, 2015
    • Benjamin Kramer's avatar
      Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types · b7b56528
      Benjamin Kramer authored
      If the type isn't trivially moveable emplace can skip a potentially
      expensive move. It also saves a couple of characters.
      
      
      Call sites were found with the ASTMatcher + some semi-automated cleanup.
      
      memberCallExpr(
          argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
          on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
          hasArgument(0, bindTemporaryExpr(
                             hasType(recordDecl(hasNonTrivialDestructor())),
                             has(constructExpr()))),
          unless(isInTemplateInstantiation()))
      
      No functional change intended.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238601 91177308-0d34-0410-b5e6-96231b3b80d8
      b7b56528
  16. May 21, 2015
  17. May 15, 2015
  18. May 04, 2015
  19. May 02, 2015
  20. May 01, 2015
  21. Apr 30, 2015
  22. Apr 28, 2015
  23. Apr 24, 2015
  24. Apr 23, 2015
  25. Apr 22, 2015
Loading