[PATCH][Clang Driver] Driver::IsUsingLTO no longer return true when seeing -emit-llvm

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Aug 22 12:14:30 PDT 2013


> Right. My comment on this change is, in essence, that people have
> depended upon the fact that -flto does what you want -emit-llvm to do
> for that compile line for a while. I don't think it's necessarily
> right, but that you're going to be breaking current use.

So, the possible changes that people using clang will have to adapt to is

1) Using -flto instead of -emit-llvm when doing an lto build.
2) Using -emit-llvm instead of -flto when fetching IL to be passed to
bugpoint or similar.

I don't think 2 is a big concern, since it is a dev option and we
change those as needed. Issue 1 is a bit more serious, but the change
is really simple. The -flto option is also what gcc uses.

Another way to do this would be to keep -emit-llvm == -flto and change
both to the behavior we want during a LTO build. This would require
adding a new -dump-ir-before-codegen or similar and people using
-emit-llvm for debugging would have to switch to that. Overall this
seems like a worse state than having -flto != -emit-llvm to me.

Cheers,
Rafael



More information about the llvm-commits mailing list