Hi,
I believe that the documentation for the Module class here: LLVM Programmer’s Manual — LLVM 18.0.0git documentation contains an obsolete piece of information:
bool addTypeName(const std::string &Name, const Type *Ty)
Insert an entry in the SymbolTable mapping Name to Ty. If there is already an entry for this name, true is returned and the SymbolTable is not modified.
AFAICT, that method disappeared a while back (around 3.0?). If that’s the case, it should be removed from the documentation.
As an aside, what is a valid replacement for it? The closest I have at the moment is something like:
if (type->isStructTy())
{
llvm::StructType *stype = (llvm::StructType *) type;
if (!stype->isLiteral())
stype->setName(name);
}
Thanks
Christophe