forked from OSchip/llvm-project
avoid emitting a bogus line marker for the top level #include
location. We now -E a file containing "foo" into: # 1 "t.c" # 1 "t.c" 1 # 1 "<predefines>" 1 # 1 "t.c" 2 foo instead of: # 1 "t.c" # 1 "t.c" 1 # 0 "t.c" # 1 "<predefines>" 1 # 1 "t.c" 2 foo llvm-svn: 63405
This commit is contained in:
parent
890c6b5520
commit
d8cc884a36
|
@ -150,7 +150,9 @@ void PrintPPOutputPPCallbacks::FileChanged(SourceLocation Loc,
|
|||
// #include directive was at.
|
||||
SourceManager &SourceMgr = PP.getSourceManager();
|
||||
if (Reason == PPCallbacks::EnterFile) {
|
||||
MoveToLine(SourceMgr.getPresumedLoc(Loc).getIncludeLoc());
|
||||
SourceLocation IncludeLoc = SourceMgr.getPresumedLoc(Loc).getIncludeLoc();
|
||||
if (IncludeLoc.isValid())
|
||||
MoveToLine(IncludeLoc);
|
||||
} else if (Reason == PPCallbacks::SystemHeaderPragma) {
|
||||
MoveToLine(Loc);
|
||||
|
||||
|
|
Loading…
Reference in New Issue