question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[swiftc] Swift compiler hook does not work

See original GitHub issue

The FrontendObserver has changed. I thought that we could simply call CompilerInstance.takeSILModule() when configuredCompiler(...) is called, but I then realized that the CompilerInstance does not yet contain the SILModule at that point.

I don’t think there is a way for us to get the SILModule without having to change the Frontend ourselves, which would require forking the Swift repo, and that is not ideal.

I have submitted a post on the Swift forums.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
tiganovcommented, May 20, 2019

They have agreed to reverse the changes. Forum post. Pull request.

Would you be willing to commit some small implementations that can go in unittest/Frontend so that we know not to remove them again in the future?

I guess they want a unit test to be written for it.

0reactions
tiganovcommented, May 20, 2019

there must be some reasons that the upstream write its own passes instead of using FrontendTool.

Isn’t the FrontendTool used instead of the swift/tools? Do those tools not simply exist for certain situations where you do not need to run the whole compiler?

Not only SILLLVMGen, but also other tools […]

Yes, and they combined make up quite a bit of code that needs to be maintained. Not to mention it would take time to combine all of these tools. Or to copy the driver + frontend, which basically has the same function as these tools combined. My time on the this project is limited to this summer and I would like to start writing the analysis ASAP. It might take me over a week to write a custom driver (since it would involve learning the compiler much more in depth) and that’s a lot of time for me.

https://github.com/apple/swift/commits/28bad2b4a4edb95df90bfd0e7cac0c0c7b53e869/tools/sil-llvm-gen/SILLLVMGen.cpp

You have a fair point in that these tools do not change often, and we could just copy their changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swift compiler plugins
I've recently been looking into implementing a lint checker for Swift code in my project. I've used SwiftLint[1] so far, but I'd love...
Read more >
Why isn't Swift compiler flag being set? - xcode - Stack Overflow
It looks like the Swift compiler ignores -D flags that assign a specific value. If you use -DDEBUG and -DRELEASE, it seems to...
Read more >
Bazel rules to build Swift on Apple and Linux platforms - GitHub
Swift Rules for Bazel · Build status. This repository contains rules for Bazel that can be used to build Swift libraries, tests, and...
Read more >
Running Xcode Playgrounds on Travis CI - Flight School
Without an Xcode project or Swift package manifest, we can't directly hook into familiar solutions for testing apps or libraries.
Read more >
Swift Compilation Hangs on Release Builds - Apple Developer
I'm getting an issue where compiling both my macOS and iOS frameworks in ... If you can include a project that reproduces the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found