[PATCH] D151833: Respect "-fdiagnostics-absolute-paths" on emit include location

Charalampos Mitrodimas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 31 12:58:14 PDT 2023


charmitro created this revision.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
charmitro requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Signed-off-by: Charalampos Mitrodimas <charmitro at gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151833

Files:
  clang/lib/Frontend/TextDiagnostic.cpp


Index: clang/lib/Frontend/TextDiagnostic.cpp
===================================================================
--- clang/lib/Frontend/TextDiagnostic.cpp
+++ clang/lib/Frontend/TextDiagnostic.cpp
@@ -896,10 +896,11 @@
 }
 
 void TextDiagnostic::emitIncludeLocation(FullSourceLoc Loc, PresumedLoc PLoc) {
-  if (DiagOpts->ShowLocation && PLoc.isValid())
-    OS << "In file included from " << PLoc.getFilename() << ':'
-       << PLoc.getLine() << ":\n";
-  else
+  if (DiagOpts->ShowLocation && PLoc.isValid()) {
+    OS << "In file included from ";
+    emitFilename(PLoc.getFilename(), Loc.getManager());
+    OS << ':' << PLoc.getLine() << ":\n";
+  } else
     OS << "In included file:\n";
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151833.527174.patch
Type: text/x-patch
Size: 700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230531/bd2affc8/attachment.bin>


More information about the cfe-commits mailing list