File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
llvm/utils/TableGen/Basic Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -109,12 +109,13 @@ void VTEmitter::run(raw_ostream &OS) {
109109 auto UpdateVTRange = [&VTRanges](const char *Key, StringRef Name,
110110 bool Valid) {
111111 if (Valid) {
112- if (!VTRanges.count (Key))
113- VTRanges[Key].First = Name;
114- assert (!VTRanges[Key].Closed && " Gap detected!" );
115- VTRanges[Key].Last = Name;
116- } else if (VTRanges.count (Key)) {
117- VTRanges[Key].Closed = true ;
112+ auto [It, Inserted] = VTRanges.try_emplace (Key);
113+ if (Inserted)
114+ It->second .First = Name;
115+ assert (!It->second .Closed && " Gap detected!" );
116+ It->second .Last = Name;
117+ } else if (auto It = VTRanges.find (Key); It != VTRanges.end ()) {
118+ It->second .Closed = true ;
118119 }
119120 };
120121
You can’t perform that action at this time.
0 commit comments