[llvm] [PassInstrumentation] Make getPassNameForClassName return optional (PR #150029)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 22 07:23:28 PDT 2025


================
@@ -165,7 +165,8 @@ class PassInstrumentationCallbacks {
   /// Add a class name to pass name mapping for use by pass instrumentation.
   LLVM_ABI void addClassToPassName(StringRef ClassName, StringRef PassName);
   /// Get the pass name for a given pass class name.
-  LLVM_ABI StringRef getPassNameForClassName(StringRef ClassName);
+  LLVM_ABI std::optional<StringRef>
----------------
nikic wrote:

Can we keep using empty StringRef as the sentinel here, and only avoid the hash table modification?

https://github.com/llvm/llvm-project/pull/150029


More information about the llvm-commits mailing list