[clang] [llvm] Add source file name for template instantiations in -ftime-trace (PR #98320)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 16 09:03:44 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 24d5c54cf52d38e63d365275f913285908aa9c9a 7032c5c7bf8f65eb4792bf9e5fdc5ba9b762c846 --extensions h,cpp -- clang/lib/Sema/SemaTemplateInstantiate.cpp clang/lib/Sema/SemaTemplateInstantiateDecl.cpp llvm/include/llvm/Support/TimeProfiler.h llvm/lib/Support/TimeProfiler.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Support/TimeProfiler.h b/llvm/include/llvm/Support/TimeProfiler.h
index d669c0d2a5..f86a313969 100644
--- a/llvm/include/llvm/Support/TimeProfiler.h
+++ b/llvm/include/llvm/Support/TimeProfiler.h
@@ -86,7 +86,7 @@ class raw_pwrite_stream;
struct TimeTraceMetadata {
std::string Details;
// Source file information for the event.
- std::string Filename;
+ std::string Filename;
};
struct TimeTraceProfiler;
@@ -174,7 +174,8 @@ public:
if (getTimeTraceProfilerInstance() != nullptr)
Entry = timeTraceProfilerBegin(Name, Detail);
}
- TimeTraceScope(StringRef Name, llvm::function_ref<TimeTraceMetadata()> Metadata) {
+ TimeTraceScope(StringRef Name,
+ llvm::function_ref<TimeTraceMetadata()> Metadata) {
if (getTimeTraceProfilerInstance() != nullptr)
Entry = timeTraceProfilerBegin(Name, Metadata);
}
diff --git a/llvm/lib/Support/TimeProfiler.cpp b/llvm/lib/Support/TimeProfiler.cpp
index 4b0466b265..2b79e12709 100644
--- a/llvm/lib/Support/TimeProfiler.cpp
+++ b/llvm/lib/Support/TimeProfiler.cpp
@@ -121,9 +121,9 @@ struct llvm::TimeTraceProfiler {
return Stack.back().get();
}
- TimeTraceProfilerEntry *begin(std::string Name,
- llvm::function_ref<TimeTraceMetadata()>Metadata,
- bool AsyncEvent = false) {
+ TimeTraceProfilerEntry *
+ begin(std::string Name, llvm::function_ref<TimeTraceMetadata()> Metadata,
+ bool AsyncEvent = false) {
Stack.emplace_back(std::make_unique<TimeTraceProfilerEntry>(
ClockType::now(), TimePointType(), std::move(Name), Metadata(),
AsyncEvent));
``````````
</details>
https://github.com/llvm/llvm-project/pull/98320
More information about the cfe-commits
mailing list