diff options
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/DiagnosticOptions.def | 1 | ||||
-rw-r--r-- | include/clang/Basic/SourceManager.h | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/clang/Basic/DiagnosticOptions.def b/include/clang/Basic/DiagnosticOptions.def index 476ac1e373..41bbff2ede 100644 --- a/include/clang/Basic/DiagnosticOptions.def +++ b/include/clang/Basic/DiagnosticOptions.def @@ -54,6 +54,7 @@ DIAGOPT(ShowCarets, 1, 1) /// Show carets in diagnostics. DIAGOPT(ShowFixits, 1, 1) /// Show fixit information. DIAGOPT(ShowSourceRanges, 1, 0) /// Show source ranges in numeric form. DIAGOPT(ShowParseableFixits, 1, 0) /// Show machine parseable fix-its. +DIAGOPT(ShowPresumedLoc, 1, 0) /// Show presumed location for diagnostics. DIAGOPT(ShowOptionNames, 1, 0) /// Show the option name for mappable /// diagnostics. DIAGOPT(ShowNoteIncludeStack, 1, 0) /// Show include stacks for notes. diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index db6bfd2ad3..5717816ff9 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -1187,7 +1187,8 @@ public: /// presumed location cannot be calculate (e.g., because \p Loc is invalid /// or the file containing \p Loc has changed on disk), returns an invalid /// presumed location. - PresumedLoc getPresumedLoc(SourceLocation Loc) const; + PresumedLoc getPresumedLoc(SourceLocation Loc, + bool UseLineDirectives = true) const; /// \brief Returns true if both SourceLocations correspond to the same file. bool isFromSameFile(SourceLocation Loc1, SourceLocation Loc2) const { @@ -1423,7 +1424,8 @@ public: /// Get a presumed location suitable for displaying in a diagnostic message, /// taking into account macro arguments and expansions. - PresumedLoc getPresumedLocForDisplay(SourceLocation Loc) const { + PresumedLoc getPresumedLocForDisplay(SourceLocation Loc, + bool UseLineDirectives = true) const{ // This is a condensed form of the algorithm used by emitCaretDiagnostic to // walk to the top of the macro call stack. while (Loc.isMacroID()) { @@ -1431,7 +1433,7 @@ public: Loc = getImmediateMacroCallerLoc(Loc); } - return getPresumedLoc(Loc); + return getPresumedLoc(Loc, UseLineDirectives); } /// Look through spelling locations for a macro argument expansion, and if |