[trace] avoid using <regex>

Easy fix based on the feedback by maskray on
https://reviews.llvm.org/D85705.
This commit is contained in:
Walter Erquinigo 2020-09-22 14:49:16 -07:00
parent a60852e9d6
commit ed621e76a9
2 changed files with 9 additions and 15 deletions

View File

@ -14,14 +14,14 @@ using namespace llvm;
StringRef TraceIntelPTSettingsParser::GetPluginSchema() {
return R"({
"type": "intel-pt",
"pt_cpu": {
"vendor": "intel" | "unknown",
"family": integer,
"model": integer,
"stepping": integer
}
})";
"type": "intel-pt",
"pt_cpu": {
"vendor": "intel" | "unknown",
"family": integer,
"model": integer,
"stepping": integer
}
})";
}
llvm::Error TraceIntelPTSettingsParser::ParsePTCPU(const json::Object &trace) {

View File

@ -8,7 +8,6 @@
#include "lldb/Target/TraceSettingsParser.h"
#include <regex>
#include <sstream>
#include "Plugins/Process/Utility/HistoryThread.h"
@ -123,12 +122,7 @@ StringRef TraceSettingsParser::GetSchema() {
if (schema.empty()) {
std::ostringstream schema_builder;
schema_builder << "{\n \"trace\": ";
// We need to add spaces to indent correctly the plugin schema
std::string plugin_schema(GetPluginSchema());
plugin_schema = std::regex_replace(plugin_schema, std::regex("\n"), "\n ");
schema_builder << plugin_schema << ",\n";
schema_builder << GetPluginSchema().str() << ",\n";
schema_builder << R"( "processes": [
{
"pid": integer,