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 {
159
159
Out.object ([&] {
160
160
Out.attribute (" pid" , 0 );
161
161
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 );
164
164
});
165
165
}
166
166
Original file line number Diff line number Diff line change 8
8
# CHECK: "traceEvents": [
9
9
# CHECK: {
10
10
# CHECK: "ph": "X",
11
- # CHECK: "name": "BuildPreamble",
12
11
# CHECK: "args": {
13
12
# CHECK: "File": "{{.*(/|\\)}}foo.c"
14
13
# CHECK: },
14
+ # CHECK: "name": "BuildPreamble",
15
15
# CHECK: }
16
16
# CHECK: {
17
17
# CHECK: "ph": "X",
18
- # CHECK: "name": "BuildAST",
19
18
# CHECK: "args": {
20
19
# CHECK: "File": "{{.*(/|\\)}}foo.c"
21
20
# CHECK: },
21
+ # CHECK: "name": "BuildAST",
22
22
# CHECK: }
23
23
# CHECK: ]
24
24
# CHECK: }
Original file line number Diff line number Diff line change @@ -647,6 +647,8 @@ inline bool Object::erase(StringRef K) {
647
647
return M.erase (ObjectKey (K));
648
648
}
649
649
650
+ std::vector<const Object::value_type *> sortedElements (const Object &O);
651
+
650
652
// / A "cursor" marking a position within a Value.
651
653
// / The Value is a tree, and this is the path from the root to the current node.
652
654
// / 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 {
242
242
return createStringError (llvm::inconvertibleErrorCode (), OS.str ());
243
243
}
244
244
245
- static std::vector<const Object::value_type *> sortedElements (const Object &O) {
245
+ std::vector<const Object::value_type *> sortedElements (const Object &O) {
246
246
std::vector<const Object::value_type *> Elements;
247
247
for (const auto &E : O)
248
248
Elements.push_back (&E);
You can’t perform that action at this time.
0 commit comments