PassManager: Ensure GetPass() only queries the underlying pass mappings

Previously this would create an entry in the map if it didn't exist.
This commit is contained in:
LC committed 2026-07-21 12:10:26 -04:00
1 parent 19f95d89ec
commit 53befc68c9
1 file changed
+5 -1
+5 -1
View File
@@ -63,7 +63,11 @@ public:
return dynamic_cast<T*>(GetPass(Name));
}
Pass* GetPass(const fextl::string& Name) {
return NameToPassMaping[Name];
const auto Iter = NameToPassMaping.find(Name);
if (Iter == NameToPassMaping.end()) {
return nullptr;
}
return Iter->second;
}
// Finalizes the pass manager state and assumes no other passes will be added after called.