[clang] [llvm] [NVPTX] Fix for device function pointer having the same name as generated callprototype (PR #205639)

Alex MacLean via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 08:48:44 PDT 2026


================
@@ -52,11 +52,15 @@ class NVPTXMachineFunctionInfo : public MachineFunctionInfo {
     return ImageHandleSymbols.contains(Symbol);
   }
 
-  void addCallPrototype(unsigned Id, const CallBase *CB) {
-    CallPrototypes.try_emplace(Id, CB);
+  MCSymbol *addCallPrototype(const CallBase *CB, MachineFunction &MF) {
+    MCSymbol *Symbol =
+        MF.getContext().createTempSymbol("prototype_",
+                                         /*AlwaysAddSuffix=*/true);
+    CallPrototypes.push_back({CB, Symbol});
+    return Symbol;
   }
 
-  const std::map<unsigned, const CallBase *> &getCallPrototypes() const {
+  const std::vector<CallProtoTy> &getCallPrototypes() const {
     return CallPrototypes;
   }
----------------
AlexMaclean wrote:

Nit: return an ArrayRef

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


More information about the cfe-commits mailing list