diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-11-19 22:55:25 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-11-19 22:55:25 +0000 |
| commit | 2861cf42fe10490ffba2201ce66fa271d1bd3750 (patch) | |
| tree | 8e6e5b966b2f8a270ddc61af1e07a209ccd3982d /clang/lib/Lex | |
| parent | a2c3c8d71cea0595f860e144f92970a1a37e5f0e (diff) | |
| download | bcm5719-llvm-2861cf42fe10490ffba2201ce66fa271d1bd3750.tar.gz bcm5719-llvm-2861cf42fe10490ffba2201ce66fa271d1bd3750.zip | |
Use PreprocessorLexer::getFileID() instead of Lexer::getFileLoc(). This is an intermediate step to having getCurrentLexer() return a PreprocessorLexer* instead of a Lexer*.
llvm-svn: 59672
Diffstat (limited to 'clang/lib/Lex')
| -rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Lex/Pragma.cpp | 10 |
3 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 68f49574997..42e44a59363 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -692,7 +692,7 @@ void Preprocessor::HandleIncludeDirective(Token &IncludeTok, // header. SrcMgr::CharacteristicKind FileCharacter = std::max(HeaderInfo.getFileDirFlavor(File), - SourceMgr.getFileCharacteristic(getCurrentFileLexer()->getFileLoc())); + SourceMgr.getFileCharacteristic(getCurrentFileLexer()->getFileID())); // Look up the file, create a File ID for it. unsigned FileID = SourceMgr.createFileID(File, FilenameTok.getLocation(), diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 53e1f8dc710..24a9b41a38a 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -513,7 +513,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Lexer *TheLexer = getCurrentFileLexer(); if (TheLexer) - CurFile = SourceMgr.getFileEntryForLoc(TheLexer->getFileLoc()); + CurFile = SourceMgr.getFileEntryForID(TheLexer->getFileID()); // If this file is older than the file it depends on, emit a diagnostic. const char *Result; diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index 0e0841da9a9..5e6de0ffc3c 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -186,10 +186,10 @@ void Preprocessor::HandlePragmaOnce(Token &OnceTok) { } // Get the current file lexer we're looking at. Ignore _Pragma 'files' etc. - SourceLocation FileLoc = getCurrentFileLexer()->getFileLoc(); + unsigned FileID = getCurrentFileLexer()->getFileID(); // Mark the file as a once-only file now. - HeaderInfo.MarkFileIncludeOnce(SourceMgr.getFileEntryForLoc(FileLoc)); + HeaderInfo.MarkFileIncludeOnce(SourceMgr.getFileEntryForID(FileID)); } void Preprocessor::HandlePragmaMark() { @@ -251,7 +251,7 @@ void Preprocessor::HandlePragmaSystemHeader(Token &SysHeaderTok) { Lexer *TheLexer = getCurrentFileLexer(); // Mark the file as a system header. - const FileEntry *File = SourceMgr.getFileEntryForLoc(TheLexer->getFileLoc()); + const FileEntry *File = SourceMgr.getFileEntryForID(TheLexer->getFileID()); HeaderInfo.MarkFileSystemHeader(File); // Notify the client, if desired, that we are in a new source file. @@ -294,8 +294,8 @@ void Preprocessor::HandlePragmaDependency(Token &DependencyTok) { return; } - SourceLocation FileLoc = getCurrentFileLexer()->getFileLoc(); - const FileEntry *CurFile = SourceMgr.getFileEntryForLoc(FileLoc); + unsigned FileID = getCurrentFileLexer()->getFileID(); + const FileEntry *CurFile = SourceMgr.getFileEntryForID(FileID); // If this file is older than the file it depends on, emit a diagnostic. if (CurFile && CurFile->getModificationTime() < File->getModificationTime()) { |

