Let TargetABI fix up LLVM mangles for more special symbols

For ModuleInfos, ModuleRefs, InterfaceInfos, interface vtables & thunks.
This commit is contained in:
Martin 2017-09-29 22:38:11 +02:00
parent 0b28925e9a
commit c9a3be1295
12 changed files with 134 additions and 79 deletions

View file

@ -522,16 +522,16 @@ void DtoDeclareFunction(FuncDeclaration *fdecl) {
const auto link = forceC ? LINKc : f->linkage;
// mangled name
std::string mangledName = getMangledName(fdecl, link);
const auto llMangle = DtoMangledName(fdecl, link);
// construct function
LLFunctionType *functype = DtoFunctionType(fdecl);
LLFunction *func = vafunc ? vafunc : gIR->module.getFunction(mangledName);
LLFunction *func = vafunc ? vafunc : gIR->module.getFunction(llMangle);
if (!func) {
// All function declarations are "external" - any other linkage type
// is set when actually defining the function.
func = LLFunction::Create(functype, llvm::GlobalValue::ExternalLinkage,
mangledName, &gIR->module);
llMangle, &gIR->module);
} else if (func->getFunctionType() != functype) {
error(fdecl->loc,
"Function type does not match previously declared "