'-fsave-optimization-record' and VS2015 built compiler

Not 100% if this is an LLVM question or a CLang question, though I expect LLVM.

On Linux, if I pass ‘-fsave-optimization-record’ to ‘clang’, then it produces a ‘*.opt.yaml’ file. However, the same thing run on Windows using ‘clang’ built with VS2015 silently ignores this option.

Is this a bug or is it intentional? And if it is intentional, how can I configure and build on Windows to enable this feature?

Thanks,

MartinO

Sounds like a bug (I’ve never tested on Windows). I suggest filing a bug report. Also, in general, you’ll have better luck with frontend questions on cfe-dev. -Hal

That’s pretty odd. Can you rule out for sure that the files aren’t being written somewhere unexpected or that the other clang was built against different sources?

Thanks Hal,

Though the option is handled in the driver, I was not sure if this was an LLVM implemented feature or a CLang implemented feature, and I know the list does not like cross-posting a message :wink:

And thanks too Brian:

That’s pretty odd. Can you rule out for sure that the files aren’t being written somewhere unexpected or that the other clang was built against different sources?

Yes you’re right, it appears to be in ‘c:\tmp\foo-XXXXXX.opt.yaml’, though on Linux it is located in ‘./foo.opt.yaml’. The sources for my Linux and VS2015 builds are identical.

So it would appear that the temporary files is being created but not finalised – probably a CLang driver issue. I’ll dig deeper and see where this is going wrong and I’ll re-post this to CFE-Dev.

Thanks again to both of you,

MartinO

The optimization-record production is in the backend, but the code that processes the options, opens the output file, etc. lives in the frontend. Indeed :wink: -Hal