[Lex] Fix crash on code completion in comment in included file.This fixes PR32732 by updating CurLexerKind to reflect available lexers.We were hitting null pointer in Preprocessor::Lex because Cur
[Lex] Fix crash on code completion in comment in included file.This fixes PR32732 by updating CurLexerKind to reflect available lexers.We were hitting null pointer in Preprocessor::Lex because CurLexerKindwas CLK_Lexer but CurLexer was null. And we set it to null inPreprocessor::HandleEndOfFile when exiting a file with code completionpoint.To reproduce the crash it is important for a comment to be inside aclass specifier. In this case in Parser::ParseClassSpecifier we improveerror recovery by pushing a semicolon token back into the preprocessorand later on try to lex a token because we haven't reached the end offile.Also clang crashes only on code completion in included file, i.e. whenIncludeMacroStack is not empty. Though we reset CurLexer even if includestack is empty. The difference is that during pushing back a semicolontoken, preprocessor calls EnterCachingLexMode which decides it isalready in caching mode because various lexers are null andIncludeMacroStack is not empty. As the result, CurLexerKind remainsCLK_Lexer instead of updating to CLK_CachingLexer.rdar://problem/34787685Reviewers: akyrtzi, doug.gregor, arphamanReviewed By: arphamanSubscribers: cfe-commits, kfunk, arphaman, nemanjai, kbartonDifferential Revision: https://reviews.llvm.org/D41688llvm-svn: 323008
show more ...
[CodeCompletion] Allow system headers providing private symbols with a single underscore.rdar://24677150llvm-svn: 274314
Fix CodeCompletion & TypoCorrection when combining a PCH with ModulesThis commit fixes the IdentifierIterator to actually include identifiersfrom a PCH or precompiled preamble when there is also a
Fix CodeCompletion & TypoCorrection when combining a PCH with ModulesThis commit fixes the IdentifierIterator to actually include identifiersfrom a PCH or precompiled preamble when there is also a global moduleindex. This was causing code-completion (outside of C++) andtypo-correction to be missing global identifiers defined in thePCH/preamble. Typo-correction has been broken since we first startedusing the module index, whereas code-completion only started relying onidentifier iterator in r232793.rdar://problem/25642879llvm-svn: 268471
Macro history (de-)serialization. Deserialization currently reads only the latest macro definition. Needs more work.Summary: Passes all tests (+ the new one with code completion), but needs a thoro
Macro history (de-)serialization. Deserialization currently reads only the latest macro definition. Needs more work.Summary: Passes all tests (+ the new one with code completion), but needs a thorough review in part related to modules.Reviewers: doug.gregorReviewed By: alexfhCC: cfe-commits, rsmithDifferential Revision: http://llvm-reviews.chandlerc.com/D41llvm-svn: 164610
Only filter out names reserved for the implementation (e.g., __blah or_Foo) from code-completion results when they come from a systemheader.llvm-svn: 108338
Teach Preprocessor::macro_begin/macro_end to lazily load all macrodefinitions from a precompiled header. This ensures thatcode-completion with macro names behaves the same with or withoutprecompil
Teach Preprocessor::macro_begin/macro_end to lazily load all macrodefinitions from a precompiled header. This ensures thatcode-completion with macro names behaves the same with or withoutprecompiled headers.llvm-svn: 92497