Skip to content
Snippets Groups Projects
  1. 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
  2. Nov 27, 2013
  3. Apr 04, 2012
  4. Jan 04, 2012
  5. Sep 08, 2011
    • Douglas Gregor's avatar
      Optimize the preprocessor's handling of the __import_module__ · b8db7cd9
      Douglas Gregor authored
      keyword. We now handle this keyword in HandleIdentifier, making a note
      for ourselves when we've seen the __import_module__ keyword so that
      the next lexed token can trigger a module import (if needed). This
      greatly simplifies Preprocessor::Lex(), and completely erases the 5.5%
      -Eonly slowdown Argiris noted when I originally implemented
      __import_module__. Big thanks to Argiris for noting that horrible
      regression!
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139265 91177308-0d34-0410-b5e6-96231b3b80d8
      b8db7cd9
  6. Jul 12, 2010
  7. Feb 08, 2010
  8. Nov 12, 2009
  9. Sep 09, 2009
  10. Jul 26, 2009
  11. Jan 26, 2009
  12. Nov 19, 2008
  13. Nov 12, 2008
  14. Nov 08, 2008
  15. Sep 05, 2008
  16. Aug 24, 2008
  17. Aug 23, 2008
  18. Aug 22, 2008
  19. Aug 10, 2008
Loading