File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,8 @@ class JSONTracer : public EventTracer {
159159 Out.object ([&] {
160160 Out.attribute (" pid" , 0 );
161161 Out.attribute (" ph" , Phase);
162- for (const auto & KV : Event)
163- Out.attribute (KV. first , KV. second );
162+ for (const auto * KV : llvm::json::sortedElements ( Event) )
163+ Out.attribute (KV-> first , KV-> second );
164164 });
165165 }
166166
Original file line number Diff line number Diff line change 88# CHECK: "traceEvents": [
99# CHECK: {
1010# CHECK: "ph": "X",
11- # CHECK: "name": "BuildPreamble",
1211# CHECK: "args": {
1312# CHECK: "File": "{{.*(/|\\)}}foo.c"
1413# CHECK: },
14+ # CHECK: "name": "BuildPreamble",
1515# CHECK: }
1616# CHECK: {
1717# CHECK: "ph": "X",
18- # CHECK: "name": "BuildAST",
1918# CHECK: "args": {
2019# CHECK: "File": "{{.*(/|\\)}}foo.c"
2120# CHECK: },
21+ # CHECK: "name": "BuildAST",
2222# CHECK: }
2323# CHECK: ]
2424# CHECK: }
Original file line number Diff line number Diff line change @@ -647,6 +647,8 @@ inline bool Object::erase(StringRef K) {
647647 return M.erase (ObjectKey (K));
648648}
649649
650+ std::vector<const Object::value_type *> sortedElements (const Object &O);
651+
650652// / A "cursor" marking a position within a Value.
651653// / The Value is a tree, and this is the path from the root to the current node.
652654// / This is used to associate errors with particular subobjects.
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ Error Path::Root::getError() const {
242242 return createStringError (llvm::inconvertibleErrorCode (), OS.str ());
243243}
244244
245- static std::vector<const Object::value_type *> sortedElements (const Object &O) {
245+ std::vector<const Object::value_type *> sortedElements (const Object &O) {
246246 std::vector<const Object::value_type *> Elements;
247247 for (const auto &E : O)
248248 Elements.push_back (&E);
You can’t perform that action at this time.
0 commit comments