diff options
author | Alp Toker <alp@nuanti.com> | 2013-12-05 17:28:42 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2013-12-05 17:28:42 +0000 |
commit | 52937abc8bc1accdc1b3e0fffa268c39c8e1ed8d (patch) | |
tree | d9c5047a2970f13e41252b28e6da4e0dcbc270c8 /clang/lib/Rewrite | |
parent | f6a24ce40fd5e807a5e71b17d0c04866e195fb87 (diff) | |
download | bcm5719-llvm-52937abc8bc1accdc1b3e0fffa268c39c8e1ed8d.tar.gz bcm5719-llvm-52937abc8bc1accdc1b3e0fffa268c39c8e1ed8d.zip |
Check the initial line number without going through PresumedLoc
No practical difference in this case and would return 1 either way, but this is
more self-explanatory.
llvm-svn: 196511
Diffstat (limited to 'clang/lib/Rewrite')
-rw-r--r-- | clang/lib/Rewrite/Frontend/InclusionRewriter.cpp | 5 |
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; |