Skip to content

IRGen: Ensure collocation of relative pointers in resilient witness tables #15793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

aschwaighofer
Copy link
Contributor

Ensure collocation by recording the dependence between witness table and
witness before functions are processed. Debug info of inlined function
scopes can reference the witness and will cause the wrong IRGenModule to
be associated before lazy witness tables are processed.

No, I am not sure that this is the only instance of this but the same
solution can apply to other instances if we find them.

rdar://39116991

…ables

Ensure collocation by recording the dependence between witness table and
witness before functions are processed. Debug info of inlined function
scopes can reference the witness and will cause the wrong IRGenModule to
be associated before lazy witness tables are processed.

No, I am not sure that this is the only instance of this but the same
solution can apply to other instances if we find them.

rdar://39116991
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@@ -1832,10 +1832,6 @@ static llvm::Constant *emitResilientWitnessTable(IRGenModule &IGM,
SILFunction *Func = entry.getMethodWitness().Witness;
llvm::Constant *witness;
if (Func) {
// Force the thunk to be emitted in the current translation unit
// when in multi-threaded mode.
IGM.IRGen.forceLocalEmitOfLazyFunction(Func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was the only usage of forceLocalEmitOfLazyFunction so you can remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now use it in ensureRelativeSymbolCollocation.

@@ -1832,10 +1832,6 @@ static llvm::Constant *emitResilientWitnessTable(IRGenModule &IGM,
SILFunction *Func = entry.getMethodWitness().Witness;
llvm::Constant *witness;
if (Func) {
// Force the thunk to be emitted in the current translation unit
// when in multi-threaded mode.
IGM.IRGen.forceLocalEmitOfLazyFunction(Func);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now use it in ensureRelativeSymbolCollocation.

continue;
auto *witness = entry.getMethodWitness().Witness;
if (witness)
IRGen.forceLocalEmitOfLazyFunction(witness);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using IRGen.forceLocalEmitOfLazyFunction here.

@aschwaighofer aschwaighofer merged commit 1e8aae2 into swiftlang:master Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants