Don't forward-declare magic intrinsics mapping to instructions

It's ugly in general, and apparently causes LTO issues on Windows.

This required a larger refactoring.
This commit is contained in:
Martin Kinkelin 2024-03-16 16:02:51 +01:00
parent be00cbb189
commit 078f0532ca
6 changed files with 39 additions and 92 deletions

View file

@ -1576,9 +1576,8 @@ DValue *DtoSymbolAddress(const Loc &loc, Type *type, Declaration *decl) {
fatal();
}
DtoResolveFunction(fdecl);
const auto llValue =
fdecl->llvmInternal != LLVMva_arg ? DtoCallee(fdecl) : nullptr;
return new DFuncValue(fdecl, llValue);
assert(!DtoIsMagicIntrinsic(fdecl));
return new DFuncValue(fdecl, DtoCallee(fdecl));
}
if (SymbolDeclaration *sdecl = decl->isSymbolDeclaration()) {