SourceManager &SourceMgr = SM;
PresumedLoc UserLoc = SourceMgr.getPresumedLoc(Loc);
- unsigned NewLine = UserLoc.getLine()+1;
+ unsigned NewLine = UserLoc.getLine();
if (Reason == PPCallbacks::EnterFile) {
SourceLocation IncludeLoc = SourceMgr.getPresumedLoc(Loc).getIncludeLoc();
SourceMgr.AddLineNote(DigitTok.getLocation(), LineNo, FilenameID);
if (Callbacks)
- Callbacks->FileChanged(DigitTok.getLocation(), PPCallbacks::RenameFile,
+ Callbacks->FileChanged(CurPPLexer->getSourceLocation(),
+ PPCallbacks::RenameFile,
SrcMgr::C_User);
}
else if (IsSystemHeader)
FileKind = SrcMgr::C_System;
- Callbacks->FileChanged(DigitTok.getLocation(), Reason, FileKind);
+ Callbacks->FileChanged(CurPPLexer->getSourceLocation(), Reason, FileKind);
}
}
// RUN: %clang_cc1 -E %s 2>&1 | FileCheck %s -strict-whitespace
// PR6101
int a;
-// CHECK: # 2 "{{.*}}line-directive-output.c"
+// CHECK: # 1 "{{.*}}line-directive-output.c"
// CHECK: int a;
// CHECK-NEXT: # 50 "{{.*}}line-directive-output.c"