summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Rewrite/Frontend/InclusionRewriter.cpp')
-rw-r--r--clang/lib/Rewrite/Frontend/InclusionRewriter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp
index 16c6d86f739..a2e0db69619 100644
--- a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp
+++ b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp
@@ -363,11 +363,10 @@ bool InclusionRewriter::Process(FileID FileId,
if (SM.getFileIDSize(FileId) == 0)
return false;
- SourceLocation StartLoc = RawLex.getSourceLocation();
// The next byte to be copied from the source file, which may be non-zero if
// the lexer handled a BOM.
- unsigned NextToWrite = SM.getFileOffset(StartLoc);
- assert(SM.getPresumedLoc(StartLoc).getLine() == 1);
+ unsigned NextToWrite = SM.getFileOffset(RawLex.getSourceLocation());
+ assert(SM.getLineNumber(FileId, NextToWrite) == 1);
int Line = 1; // The current input file line number.
Token RawToken;
OpenPOWER on IntegriCloud