Skip to content
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

[SR-4153] '-save-temps' doesn't save intermediate compilation results #46736

Open
swift-ci opened this issue Mar 3, 2017 · 5 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Mar 3, 2017

Previous ID SR-4153
Radar rdar://problem/31067512
Original Reporter AlexDenisov (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Driver
Assignee None
Priority Medium

md5: eedbe40225b7fb094f0f010dbf8dd50f

Issue Description:

I compile a simple swift program:

// main.swift
print("hello world")

using the following command

swiftc -save-temps main.swift

I expect to see some artefacts (.bc, .ll. .o, whatever else is being produced) around, but I see only executable:

> ls -a
.               ..              main            main.swift
@belkadan
Copy link
Contributor

belkadan commented Mar 3, 2017

-save-temps just keeps the temporary files from being deleted. They're still put in TMPDIR rather than in the current directory. Maybe that's not the right choice?

@swift-ci
Copy link
Collaborator Author

swift-ci commented Mar 3, 2017

Comment by Alex Denisov (JIRA)

@belkadan is it different from clang? I tried to set TMPDIR to a current dir and found there only an object file (main-somehash.o).

> Maybe that's not the right choice?

Not for a long run, for sure. I just needed to get all the bitcode from a test suite to check my hypothesis.

Anyways, I think the ticket can be closed, even though the behavior is a bit confusing.

@belkadan
Copy link
Contributor

belkadan commented Mar 4, 2017

Hm, I guess it is different. Swift's -save-temps doesn't bother to dump every phase of compilation, only those between process boundaries. It's mostly for debugging purposes. I would expect it to save the .bc file, though, since we do use that.

@belkadan
Copy link
Contributor

Also filed within Apple, so it appears someone else would have preferred the Clang behavior. In that case the sensible Swift "temporaries" are probably a .sil or .sib file and a .ll or .bc file, in addition to the usual temporaries.

@swift-ci
Copy link
Collaborator Author

Comment by Alex Denisov (JIRA)

@belkadan thanks!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
Projects
None yet
Development

No branches or pull requests

2 participants