From 61a594cbcd44eed7df834d0f9d3dc86bcaf62486 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Fri, 23 Aug 2024 17:05:11 -0400 Subject: [PATCH] fixup! [FIRRTL] Remove priority in BlackBoxReader, NFC --- lib/Dialect/FIRRTL/Transforms/BlackBoxReader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Dialect/FIRRTL/Transforms/BlackBoxReader.cpp b/lib/Dialect/FIRRTL/Transforms/BlackBoxReader.cpp index 2c0655743974..f32d87bf511d 100644 --- a/lib/Dialect/FIRRTL/Transforms/BlackBoxReader.cpp +++ b/lib/Dialect/FIRRTL/Transforms/BlackBoxReader.cpp @@ -243,8 +243,9 @@ void BlackBoxReaderPass::runOnOperation() { // two blackbox paths. This is the same logic used in `AssignOutputDirs`. // However, this needs to incorporate filenames that are only available // _after_ output directories are assigned. - auto *ptr = emittedFileMap.find(annotationInfo.name); - if (ptr == emittedFileMap.end()) { + auto [ptr, inserted] = + emittedFileMap.try_emplace(annotationInfo.name, annotationInfo); + if (inserted) { emittedFileMap[annotationInfo.name] = annotationInfo; } else { auto &fileAttr = ptr->second.outputFileAttr;