diff options
Diffstat (limited to 'clang/lib/CodeGen/MacroPPCallbacks.cpp')
-rw-r--r-- | clang/lib/CodeGen/MacroPPCallbacks.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/MacroPPCallbacks.cpp b/clang/lib/CodeGen/MacroPPCallbacks.cpp index 48dea7d54b1..05acc9bb273 100644 --- a/clang/lib/CodeGen/MacroPPCallbacks.cpp +++ b/clang/lib/CodeGen/MacroPPCallbacks.cpp @@ -88,16 +88,6 @@ SourceLocation MacroPPCallbacks::getCorrectLocation(SourceLocation Loc) { return SourceLocation(); } -static bool isBuiltinFile(SourceManager &SM, SourceLocation Loc) { - StringRef Filename(SM.getPresumedLoc(Loc).getFilename()); - return Filename.equals("<built-in>"); -} - -static bool isCommandLineFile(SourceManager &SM, SourceLocation Loc) { - StringRef Filename(SM.getPresumedLoc(Loc).getFilename()); - return Filename.equals("<command line>"); -} - void MacroPPCallbacks::updateStatusToNextScope() { switch (Status) { case NoScope: @@ -127,7 +117,7 @@ void MacroPPCallbacks::FileEntered(SourceLocation Loc) { updateStatusToNextScope(); return; case BuiltinScope: - if (isCommandLineFile(PP.getSourceManager(), Loc)) + if (PP.getSourceManager().isWrittenInCommandLineFile(Loc)) return; updateStatusToNextScope(); LLVM_FALLTHROUGH; @@ -147,7 +137,7 @@ void MacroPPCallbacks::FileExited(SourceLocation Loc) { default: llvm_unreachable("Do not expect to exit a file from current scope"); case BuiltinScope: - if (!isBuiltinFile(PP.getSourceManager(), Loc)) + if (!PP.getSourceManager().isWrittenInBuiltinFile(Loc)) // Skip next scope and change status to MainFileScope. Status = MainFileScope; return; |