mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Redesign the BuiltinFunctionRefInst to contain an Identifier instead of
a FuncDecl. This makes it much more straight-forward for SIL passes to introduce a new one - without doing name lookup in the builtin module! Swift SVN r10694
This commit is contained in:
@@ -265,7 +265,7 @@ SILValue SILGenFunction::emitGlobalFunctionRef(SILLocation loc,
|
||||
"emitting ref to local constant without context?!");
|
||||
if (constant.hasDecl() &&
|
||||
isa<BuiltinModule>(constant.getDecl()->getDeclContext())) {
|
||||
return B.createBuiltinFunctionRef(loc, cast<FuncDecl>(constant.getDecl()),
|
||||
return B.createBuiltinFunctionRef(loc, constant.getDecl()->getName(),
|
||||
constantInfo.getSILType());
|
||||
}
|
||||
|
||||
@@ -2537,7 +2537,8 @@ void SILGenFunction::emitGlobalAccessor(VarDecl *global,
|
||||
// Emit a reference to Builtin.once.
|
||||
SILDeclRef builtinOnceConstant(builtinOnceDecl, SILDeclRef::Kind::Func);
|
||||
auto builtinOnceSILTy = SGM.Types.getConstantType(builtinOnceConstant);
|
||||
auto builtinOnce = B.createBuiltinFunctionRef(global, builtinOnceDecl,
|
||||
auto builtinOnce = B.createBuiltinFunctionRef(global,
|
||||
builtinOnceDecl->getName(),
|
||||
builtinOnceSILTy);
|
||||
|
||||
SILType rawPointerSILTy
|
||||
|
||||
Reference in New Issue
Block a user