diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-04-17 19:09:18 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-04-17 19:09:18 +0000 |
commit | 142b35e25b579e2a883d6ca37c3c1121f562f242 (patch) | |
tree | 1c63dfe94854deaac1a487b63654734f6d609bed /lib/Lex | |
parent | 987c03085558277a5fe8cef8e1b628cabcc626dc (diff) |
Fix off-by-one error in #pragma clang system_header.
The system_header pragma (from GCC) is implemented using line notes in the
source manager. However, a line note's line number specifies the number
not for the current line, but for the next line. This was making all
line numbers appear off by one after the pragma.
Reported by Andy Gibbs, uncovered during r179677.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r-- | lib/Lex/Pragma.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index bc77c5adcf..b5a76fd3cb 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -434,8 +434,9 @@ void Preprocessor::HandlePragmaSystemHeader(Token &SysHeaderTok) { // Emit a line marker. This will change any source locations from this point // forward to realize they are in a system header. // Create a line note with this information. - SourceMgr.AddLineNote(SysHeaderTok.getLocation(), PLoc.getLine(), FilenameID, - false, false, true, false); + SourceMgr.AddLineNote(SysHeaderTok.getLocation(), PLoc.getLine()+1, + FilenameID, /*IsEntry=*/false, /*IsExit=*/false, + /*IsSystem=*/true, /*IsExternC=*/false); } /// HandlePragmaDependency - Handle \#pragma GCC dependency "foo" blah. |