mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove the redundant DeclCtx field in SILFunction.
In all cases the DeclCtx field was supposed to be initialized from the SILLocation of the function, so we can save one pointer per SILFunction. There is one test case change where a different (more precise) diagnostic is being generated after this change.
This commit is contained in:
@@ -487,18 +487,17 @@ void FunctionSignatureTransform::createFunctionSignatureOptimizedFunction() {
|
||||
|
||||
DEBUG(llvm::dbgs() << " -> create specialized function " << Name << "\n");
|
||||
|
||||
NewF = M.createFunction(
|
||||
linkage, Name, createOptimizedSILFunctionType(), nullptr,
|
||||
F->getLocation(), F->isBare(), F->isTransparent(), F->isFragile(),
|
||||
F->isThunk(), F->getClassVisibility(), F->getInlineStrategy(),
|
||||
F->getEffectsKind(), nullptr, F->getDebugScope(), F->getDeclContext());
|
||||
NewF = M.createFunction(linkage, Name, createOptimizedSILFunctionType(),
|
||||
nullptr, F->getLocation(), F->isBare(),
|
||||
F->isTransparent(), F->isFragile(), F->isThunk(),
|
||||
F->getClassVisibility(), F->getInlineStrategy(),
|
||||
F->getEffectsKind(), nullptr, F->getDebugScope());
|
||||
if (F->hasUnqualifiedOwnership()) {
|
||||
NewF->setUnqualifiedOwnership();
|
||||
}
|
||||
|
||||
// Then we transfer the body of F to NewF.
|
||||
NewF->spliceBody(F);
|
||||
NewF->setDeclCtx(F->getDeclContext());
|
||||
|
||||
// Array semantic clients rely on the signature being as in the original
|
||||
// version.
|
||||
|
||||
Reference in New Issue
Block a user