[clang] [llvm] Reapply "Add source file name for template instantiations in -ftime-trace" (PR #99545)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 19 02:39:18 PDT 2024


================
@@ -60,13 +75,29 @@ bool compileFromString(StringRef Code, StringRef Standard, StringRef FileName) {
   return Compiler.ExecuteAction(Action);
 }
 
+std::string GetMetadata(json::Object *Event) {
+  std::string Metadata;
+  llvm::raw_string_ostream OS(Metadata);
+  if (json::Object *Args = Event->getObject("args")) {
+    if (auto Detail = Args->getString("detail"))
+      OS << Detail;
+    if (auto File = Args->getString("file"))
+      OS << ", "
+         << llvm::sys::path::filename(File->str(),
----------------
usx95 wrote:

Done.

https://github.com/llvm/llvm-project/pull/99545


More information about the cfe-commits mailing list