[Lldb-commits] [lldb] ed621e7 - [trace] avoid using <regex>
Walter Erquinigo via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 22 16:09:05 PDT 2020
Author: Walter Erquinigo
Date: 2020-09-22T16:08:58-07:00
New Revision: ed621e76a9889e25a9cbed47e0b96a7a6fdbdb80
URL: https://github.com/llvm/llvm-project/commit/ed621e76a9889e25a9cbed47e0b96a7a6fdbdb80
DIFF: https://github.com/llvm/llvm-project/commit/ed621e76a9889e25a9cbed47e0b96a7a6fdbdb80.diff
LOG: [trace] avoid using <regex>
Easy fix based on the feedback by maskray on
https://reviews.llvm.org/D85705.
Added:
Modified:
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp
lldb/source/Target/TraceSettingsParser.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp
index c8f90c9a978d..2430f779d956 100644
--- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp
+++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp
@@ -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) {
diff --git a/lldb/source/Target/TraceSettingsParser.cpp b/lldb/source/Target/TraceSettingsParser.cpp
index 2c0f337ee9a1..9021d93e17e0 100644
--- a/lldb/source/Target/TraceSettingsParser.cpp
+++ b/lldb/source/Target/TraceSettingsParser.cpp
@@ -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,
More information about the lldb-commits
mailing list