================
@@ -113,14 +127,13 @@ static std::optional<unsigned>
findOneNVVMAnnotation(const GlobalValue *GV,
cacheAnnotationFromMD(M, GV);
auto &KVP = AC.Cache[M][GV];
- auto It = KVP.find(Prop);
+ auto It = KVP.find(Prop.str());
if (It == KVP.end())
return std::nullopt;
return It->second[0];
}
-static bool findAllNVVMAnnotation(const GlobalValue *GV,
- const std::string &Prop,
+static bool findAllNVVMAnnotation(const GlobalValue *GV, StringRef Prop,
----------------
rajatbajpai wrote:
nit: not related to this change.
The cache-lookup preamble in `findOneNVVMAnnotation` and
`findAllNVVMAnnotation` is identical. We should consider extracting it into a
shared helper that returns a pointer to the annotation vector (or nullptr),
reducing both functions to thin wrappers.
https://github.com/llvm/llvm-project/pull/187752
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits