summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index a815265e7c9..e09ce1312de 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -199,7 +199,7 @@ std::string Preprocessor::getSpelling(const Token &Tok) const {
if (PTH) {
SourceLocation sloc = SourceMgr.getPhysicalLoc(Tok.getLocation());
- unsigned fid = sloc.getFileID();
+ unsigned fid = SourceMgr.getCanonicalFileID(sloc);
unsigned fpos = SourceMgr.getFullFilePos(sloc);
if (unsigned len = PTH->getSpelling(fid, fpos, TokStart)) {
assert(!Tok.needsCleaning());
@@ -265,7 +265,7 @@ unsigned Preprocessor::getSpelling(const Token &Tok,
}
else {
SourceLocation sloc = SourceMgr.getPhysicalLoc(Tok.getLocation());
- unsigned fid = sloc.getFileID();
+ unsigned fid = SourceMgr.getCanonicalFileID(sloc);
unsigned fpos = SourceMgr.getFullFilePos(sloc);
len = PTH->getSpelling(fid, fpos, Buffer);
}
OpenPOWER on IntegriCloud