Mercurial > hg > CbC > CbC_llvm
changeset 204:e348f3e5c8b2
ReadFromString worked.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 05 Jun 2021 15:35:13 +0900 |
parents | 0d4b2609c30f |
children | b7591485f4cd |
files | clang/lib/Lex/Preprocessor.cpp |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/clang/lib/Lex/Preprocessor.cpp Sat Jun 05 11:18:24 2021 +0900 +++ b/clang/lib/Lex/Preprocessor.cpp Sat Jun 05 15:35:13 2021 +0900 @@ -1442,18 +1442,18 @@ bool Invalid = false; std::unique_ptr<Lexer> lx(new Lexer(CurLexer->getFileID(),getSourceManager().getBuffer(CurLexer->getFileID(), Loc, &Invalid),*this)); lx->InitLexer(src,src,src + strlen(src)); - // lx.ParsingPreprocessorDirective = true ; // to prevent from EOF sucide of CurLexer in PP lx->Lex(Tok); FirstTok = Tok; CurLexer.swap(lx); while (Tok.getKind() != tok::TokenKind::eof) { + Tok.setLocation(Loc); MI->AddTokenToBody(Tok); Lex(Tok); } CurLexer = std::move(lx); CurPPLexer = CurLexer.get(); EnterMacro(Result, Loc, MI , 0 ); - // EnterTokenStream(&MI->ReplacementTokens,MI->getNumTokens(),true,true,false); + CurTokenLexer->MacroExpansionStart = Loc; return Result; }