mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 15:10:59 +03:00
Let TargetABI fix up LLVM mangles for more special symbols
For ModuleInfos, ModuleRefs, InterfaceInfos, interface vtables & thunks.
This commit is contained in:
parent
0b28925e9a
commit
c9a3be1295
12 changed files with 134 additions and 79 deletions
|
@ -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 "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue