Skip to content

Commit 6b42c91

Browse files
[WebAssembly] Clean up CustomMappingTraits<BBNumberMap> (NFC) (#167155)
This patch does two things for readability: - Use structured bindings. - Remove extraneous .c_str(). Note that YamlIO.mapRequired takes StringRef as the key type. As such, we can implicitly construct StringRef from std::string.
1 parent 1e18747 commit 6b42c91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ template <> struct CustomMappingTraits<BBNumberMap> {
211211
}
212212

213213
static void output(IO &YamlIO, BBNumberMap &SrcToUnwindDest) {
214-
for (auto KV : SrcToUnwindDest)
215-
YamlIO.mapRequired(std::to_string(KV.first).c_str(), KV.second);
214+
for (auto [Src, Dest] : SrcToUnwindDest)
215+
YamlIO.mapRequired(std::to_string(Src), Dest);
216216
}
217217
};
218218

0 commit comments

Comments
 (0)