mirror of
https://github.com/intel/llvm.git
synced 2026-02-02 18:18:09 +08:00
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
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user