mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Don't hardcode the function representation of builtin "once". Make emitLazyGlobalInitializer retrieve the convention from getBuiltinValueDecl.
This commit is contained in:
@@ -321,8 +321,8 @@ static SILFunction *getCalleeOfOnceCall(BuiltinInst *BI) {
|
||||
|
||||
auto Callee = BI->getOperand(1);
|
||||
assert(Callee->getType().castTo<SILFunctionType>()->getRepresentation()
|
||||
== SILFunctionTypeRepresentation::Thin &&
|
||||
"Expected thin function representation!");
|
||||
== SILFunctionTypeRepresentation::CFunctionPointer &&
|
||||
"Expected C function representation!");
|
||||
|
||||
if (auto *FR = dyn_cast<FunctionRefInst>(Callee))
|
||||
return FR->getReferencedFunction();
|
||||
|
||||
Reference in New Issue
Block a user