Skip to content
Snippets Groups Projects
  1. 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
  2. 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
  3. Nov 02, 2015
  4. Sep 22, 2015
  5. Jul 11, 2015
  6. Jun 30, 2015
  7. Jun 25, 2015
  8. 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
  9. Jun 12, 2015
  10. Jun 01, 2015
  11. 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
  12. May 21, 2015
  13. May 15, 2015
  14. May 04, 2015
  15. May 02, 2015
  16. May 01, 2015
  17. Apr 30, 2015
  18. Apr 28, 2015
  19. Apr 24, 2015
  20. Apr 23, 2015
  21. Apr 22, 2015
  22. Dec 18, 2014
    • Serge Pavlov's avatar
      Fixed warnings on redefine keywords and reserved ids. · d7d40b7a
      Serge Pavlov authored
      Repared support for warnings -Wkeyword-macro and -Wreserved-id-macro.
      The warning -Wkeyword-macro now is not issued in patterns that are used
      in configuration scripts:
      
          #define inline
      
      also for 'const', 'extern' and 'static'. If macro repalcement is identical
      to macro name, the warning also is not issued:
      
          #define volatile volatile
      
      And finally if macro replacement is also a keyword identical to the replaced
      one but decorated with leading/trailing underscores:
      
          #define inline __inline
          #define inline __inline__
          #define inline _inline // in MSVC compatibility mode
      
      Warning -Wreserved-id-macro is off by default, it could help catching
      things like:
      
          #undef __cplusplus
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224512 91177308-0d34-0410-b5e6-96231b3b80d8
      d7d40b7a
  23. Dec 05, 2014
  24. Dec 02, 2014
  25. Nov 14, 2014
  26. Oct 24, 2014
  27. Oct 20, 2014
    • Richard Smith's avatar
      [modules] Add support for #include_next. · ccaf6244
      Richard Smith authored
      #include_next interacts poorly with modules: it depends on where in the list of
      include paths the current file was found. Files covered by module maps are not
      found in include search paths when building the module (and are not found in
      include search paths when @importing the module either), so this isn't really
      meaningful. Instead, we fake up the result that #include_next *should* have
      given: find the first path that would have resulted in the given file being
      picked, and search from there onwards.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220177 91177308-0d34-0410-b5e6-96231b3b80d8
      ccaf6244
Loading