summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileProfilingData.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileProfilingData.cxx')
-rw-r--r--Source/cmMakefileProfilingData.cxx29
1 files changed, 9 insertions, 20 deletions
diff --git a/Source/cmMakefileProfilingData.cxx b/Source/cmMakefileProfilingData.cxx
index e4844f3..e903ae1 100644
--- a/Source/cmMakefileProfilingData.cxx
+++ b/Source/cmMakefileProfilingData.cxx
@@ -6,9 +6,6 @@
#include <stdexcept>
#include <type_traits>
#include <utility>
-#include <vector>
-
-#include <cm/utility>
#include <cm3p/json/value.h>
#include <cm3p/json/writer.h>
@@ -16,7 +13,6 @@
#include "cmsys/FStream.hxx"
#include "cmsys/SystemInformation.hxx"
-#include "cmListFileCache.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -47,22 +43,6 @@ cmMakefileProfilingData::~cmMakefileProfilingData() noexcept
}
}
-void cmMakefileProfilingData::StartEntry(const cmListFileFunction& lff,
- cmListFileContext const& lfc)
-{
- cm::optional<Json::Value> argsValue(cm::in_place, Json::objectValue);
- if (!lff.Arguments().empty()) {
- std::string args;
- for (auto const& a : lff.Arguments()) {
- args = cmStrCat(args, args.empty() ? "" : " ", a.Value);
- }
- (*argsValue)["functionArgs"] = args;
- }
- (*argsValue)["location"] =
- cmStrCat(lfc.FilePath, ':', std::to_string(lfc.Line));
- this->StartEntry("script", lff.LowerCaseName(), std::move(argsValue));
-}
-
void cmMakefileProfilingData::StartEntry(const std::string& category,
const std::string& name,
cm::optional<Json::Value> args)
@@ -127,6 +107,15 @@ void cmMakefileProfilingData::StopEntry()
}
}
+cmMakefileProfilingData::RAII::RAII(cmMakefileProfilingData& data,
+ const std::string& category,
+ const std::string& name,
+ cm::optional<Json::Value> args)
+ : Data(&data)
+{
+ this->Data->StartEntry(category, name, std::move(args));
+}
+
cmMakefileProfilingData::RAII::RAII(RAII&& other) noexcept
: Data(other.Data)
{