std::string getMangledVTableSymbolName(AggregateDeclaration *aggrdecl) { std::string ret = "_D"; std::string mangledName = mangle(aggrdecl); if (shouldHashAggrName(mangledName)) { ret += hashSymbolName(mangledName, aggrdecl); } else { ret += mangledName; } ret += "6__vtblZ"; return gABI->mangleVariableForLLVM(std::move(ret), LINKd); }
std::string getIRMangledName(FuncDeclaration *fdecl, LINK link) { std::string mangledName = mangleExact(fdecl); // Hash the name if necessary if (((link == LINKd) || (link == LINKdefault)) && (global.params.hashThreshold != 0) && (mangledName.length() > global.params.hashThreshold)) { auto hashedName = hashSymbolName(mangledName, fdecl); mangledName = "_D" + hashedName + "Z"; } // TODO: Cache the result? return getIRMangledFuncName(std::move(mangledName), link); }
std::string getMangledClassInfoSymbolName(AggregateDeclaration *aggrdecl) { std::string ret = "_D"; std::string mangledName = mangle(aggrdecl); if (shouldHashAggrName(mangledName)) { ret += hashSymbolName(mangledName, aggrdecl); } else { ret += mangledName; } if (aggrdecl->isInterfaceDeclaration()) { ret += "11__InterfaceZ"; } else { ret += "7__ClassZ"; } return gABI->mangleVariableForLLVM(std::move(ret), LINKd); }