================ @@ -281,3 +281,33 @@ bool CIRGenTypes::isZeroInitializable(clang::QualType t) { return true; } + +const CIRGenFunctionInfo &CIRGenTypes::arrangeCIRFunctionInfo() { + // Lookup or create unique function info. + llvm::FoldingSetNodeID id; + CIRGenFunctionInfo::Profile(id); + + void *insertPos = nullptr; + CIRGenFunctionInfo *fi = functionInfos.FindNodeOrInsertPos(id, insertPos); + if (fi) + return *fi; ---------------- Lancern wrote:
A folding set is basically a separate chaining hash table, and the addresses of its elements are stable once the element is inserted. Besides, in the classic codegen, we never erase elements from `functionInfos`. Thus the returned reference is valid throughout CIRGen. https://github.com/llvm/llvm-project/pull/134673 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits