Skip to content

Propagate Clang types through SIL #29239

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

Merged
merged 5 commits into from
Jan 21, 2020
Merged

Propagate Clang types through SIL #29239

merged 5 commits into from
Jan 21, 2020

Conversation

varungandhi-apple
Copy link
Contributor

@varungandhi-apple varungandhi-apple commented Jan 15, 2020

First commit is from #29210.

This PR allows us to use the Clang type in IRGen going forward.

@varungandhi-apple
Copy link
Contributor Author

The commits are showing in the wrong order again 🤦‍♂

@varungandhi-apple

This comment has been minimized.

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

@varungandhi-apple
Copy link
Contributor Author

@swift-ci please test

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

@varungandhi-apple
Copy link
Contributor Author

varungandhi-apple commented Jan 16, 2020

There is a compilation failure as I forgot to update some command line tools like sil-opt. I've fixed that locally pretty easily but there seem to be some crashes compiling the overlays. Looking into those right now.

@varungandhi-apple
Copy link
Contributor Author

There were several bugs:

  1. We were storing the Clang types and this lead to issues around canonical SIL types. The solution for now is to not store it unless we pass the flag explicitly (off-by-default).
  2. The Invocation in SILFunctionExtractor and SILOpt did not have the right SILOptions because we didn't record the arguments manually.

@swift-ci please smoke test

If this works, we can run the big tests etc.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple
Copy link
Contributor Author

@swift-ci please clean test

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

@varungandhi-apple
Copy link
Contributor Author

Ah the problem is LLDB fails to compile. Let me fix that. 😢

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

1 similar comment
@varungandhi-apple
Copy link
Contributor Author

swiftlang/llvm-project#609

@swift-ci please test

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

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

Minor comment but otherwise LGTM

@@ -3917,6 +3917,24 @@ namespace Lowering {
class TypeConverter;
};

class SILUncommonInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a very generic name for such a specific type. Can it be made a nested type of SILFunctionType?

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 tried that earlier, but the template argument in SILFunctionType's TrailingObjects needs the type to be complete. I suspect SILParameterInfo and SILResultInfo have been defined separately instead of as nested inside for a similar reason.

Maybe I should rename it to SILCallingConvUncommonInfo or something else which is more precise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me merge this for now, since I don't want to rerun coordinated testing with LLDB again, and this makes doing follow-up work easier. I will change the name in a new PR which can be Swift-only.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. SILFunctionTypeUncommonInfo seems reasonable.

@varungandhi-apple varungandhi-apple merged commit f6e0db5 into swiftlang:master Jan 21, 2020
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Jan 22, 2020
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.

3 participants