 |
|
 |
|
| Files: |
1 |
|
Branches Taken: |
50.0% |
3 / 6 |
| Generated: |
2010-02-10 01:31 |
|
Branches Executed: |
100.0% |
6 / 6 |
| |
|
Line Coverage: |
90.0% |
9 / 10 |
| |
 |
|
 |
1 : //===--- PreprocessorLexer.cpp - C Language Family Lexer ------------------===//
2 : //
3 : // The LLVM Compiler Infrastructure
4 : //
5 : // This file is distributed under the University of Illinois Open Source
6 : // License. See LICENSE.TXT for details.
7 : //
8 : //===----------------------------------------------------------------------===//
9 : //
10 : // This file implements the PreprocessorLexer and Token interfaces.
11 : //
12 : //===----------------------------------------------------------------------===//
13 :
14 : #include "clang/Lex/PreprocessorLexer.h"
15 : #include "clang/Lex/Preprocessor.h"
16 : #include "clang/Lex/LexDiagnostic.h"
17 : #include "clang/Basic/SourceManager.h"
18 : using namespace clang;
19 :
20 : /// LexIncludeFilename - After the preprocessor has parsed a #include, lex and
21 : /// (potentially) macro expand the filename.
22 731: void PreprocessorLexer::LexIncludeFilename(Token &FilenameTok) {
23 : assert(ParsingPreprocessorDirective &&
24 : ParsingFilename == false &&
731: branch 0 taken
0: branch 1 not taken
0: branch 2 not taken
731: branch 3 taken
25 731: "Must be in a preprocessing directive!");
26 :
27 : // We are now parsing a filename!
28 731: ParsingFilename = true;
29 :
30 : // Lex the filename.
31 731: IndirectLex(FilenameTok);
32 :
33 : // We should have obtained the filename now.
34 731: ParsingFilename = false;
35 :
36 : // No filename?
0: branch 1 not taken
731: branch 2 taken
37 731: if (FilenameTok.is(tok::eom))
38 0: PP->Diag(FilenameTok.getLocation(), diag::err_pp_expects_filename);
39 731: }
40 :
41 : /// getFileEntry - Return the FileEntry corresponding to this FileID. Like
42 : /// getFileID(), this only works for lexers with attached preprocessors.
43 1: const FileEntry *PreprocessorLexer::getFileEntry() const {
44 1: return PP->getSourceManager().getFileEntryForID(getFileID());
45 : }
Generated: 2010-02-10 01:31 by zcov