Skip to content

Commit c26f40b

Browse files
authored
Fix some more misuses of LLVM's YAML parser. (#15119)
https://reviews.llvm.org/D44317 should prevent this from happening again.
1 parent 501c1fd commit c26f40b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/IDE/APIDigesterData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ serializeDiffItem(llvm::BumpPtrAllocator &Alloc,
309309
#define DIFF_ITEM_KEY_KIND_STRING(NAME) StringRef NAME;
310310
#define DIFF_ITEM_KEY_KIND_INT(NAME) Optional<int> NAME;
311311
#include "swift/IDE/DigesterEnums.def"
312-
for (auto Pair : *Node) {
312+
for (auto &Pair : *Node) {
313313
switch(parseKeyKind(getScalarString(Pair.getKey()))) {
314314
#define DIFF_ITEM_KEY_KIND_STRING(NAME) \
315315
case DiffItemKeyKind::KK_##NAME: \

lib/Serialization/Serialization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4347,7 +4347,7 @@ class YamlGroupInputParser {
43474347
if (!MapNode) {
43484348
return true;
43494349
}
4350-
for (auto Pair : *MapNode) {
4350+
for (auto &Pair : *MapNode) {
43514351
auto *Key = dyn_cast_or_null<llvm::yaml::ScalarNode>(Pair.getKey());
43524352
auto *Value = dyn_cast_or_null<llvm::yaml::SequenceNode>(Pair.getValue());
43534353

tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ SDKNode* SDKNode::constructSDKNode(SDKContext &Ctx,
939939
SDKNodeInitInfo Info(Ctx);
940940
NodeVector Children;
941941

942-
for (auto Pair : *Node) {
942+
for (auto &Pair : *Node) {
943943
switch(parseKeyKind(GetScalarString(Pair.getKey()))) {
944944
case KeyKind::KK_kind:
945945
Kind = parseSDKNodeKind(GetScalarString(Pair.getValue()));

0 commit comments

Comments
 (0)