[llvm-dev] Update documentation about Module::addTypeName
Christophe de Dinechin via llvm-dev
llvm-dev at lists.llvm.org
Tue Dec 19 00:59:43 PST 2017
Hi,
I believe that the documentation for the Module class here: http://llvm.org/docs/ProgrammersManual.html#important-public-members-of-the-module-class 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
More information about the llvm-dev
mailing list