diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-03-19 01:51:19 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-03-19 01:51:19 +0000 |
commit | b9b05100c567d67b237484be950ddf73fbeea797 (patch) | |
tree | 99474b39ab2f28864d9192b13864d65acdac0620 /clang/lib/Lex/PreprocessorLexer.cpp | |
parent | 5a8ea4ca9470358800836a932c2fccb8f3b5710c (diff) | |
download | bcm5719-llvm-b9b05100c567d67b237484be950ddf73fbeea797.tar.gz bcm5719-llvm-b9b05100c567d67b237484be950ddf73fbeea797.zip |
Factor out repeated code parsing and concatenating header-names from
tokens.
We now actually form an angled_string_literal token for a header name by
concatenation rather than just working out what its contents would be.
This substantially simplifies downstream processing and is necessary for
C++20 header unit imports.
llvm-svn: 356433
Diffstat (limited to 'clang/lib/Lex/PreprocessorLexer.cpp')
-rw-r--r-- | clang/lib/Lex/PreprocessorLexer.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/Lex/PreprocessorLexer.cpp b/clang/lib/Lex/PreprocessorLexer.cpp index f721bdcd1e2..5f6f4a13419 100644 --- a/clang/lib/Lex/PreprocessorLexer.cpp +++ b/clang/lib/Lex/PreprocessorLexer.cpp @@ -30,9 +30,7 @@ PreprocessorLexer::PreprocessorLexer(Preprocessor *pp, FileID fid) /// After the preprocessor has parsed a \#include, lex and /// (potentially) macro expand the filename. void PreprocessorLexer::LexIncludeFilename(Token &FilenameTok) { - assert(ParsingPreprocessorDirective && - ParsingFilename == false && - "Must be in a preprocessing directive!"); + assert(ParsingFilename == false && "reentered LexIncludeFilename"); // We are now parsing a filename! ParsingFilename = true; @@ -45,10 +43,6 @@ void PreprocessorLexer::LexIncludeFilename(Token &FilenameTok) { // We should have obtained the filename now. ParsingFilename = false; - - // No filename? - if (FilenameTok.is(tok::eod)) - PP->Diag(FilenameTok.getLocation(), diag::err_pp_expects_filename); } /// getFileEntry - Return the FileEntry corresponding to this FileID. Like |