It seems -flto must be either "thin" or "full". I think the use of
containValue is just a typo.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Make sure you add cfe-commits to the mailing list for clang changes (and llvm-commits for llvm changes, I accidentally added that one first and then fixed it), since all patches should go to the full mailing list.
This fix looks correct to me. Please add a test case though. Perhaps there should be an error if the value is something other than "thin" or "lto"? E.g. see the error that will get emitted if the value is not one of those in clang/lib/Driver/Driver.cpp.
I think we don't need additional testcase, because this is non-functional change. Driver.cpp will emit error if value was not "thin" nor "full". This testcase is at clang/test/CodeGen/thinlto-backend-option.ll.
That test case is checking that -flto=thin is accepted by the driver. I don't see it checking for an unknown -flto= value. But in any case, you can go through the code you are fixing here without hitting the driver check by invoking clang -cc1 (%clang_cc1 in the test case). I just confirmed that -flto=thinfoo is flagged as an error by clang (when it goes through the driver), but is silently accepted if I pass directly to clang -cc1. So this is definitely a bug fix and it would be good to check for invalid -flto values and given an error, then have a test that uses %clang_cc1 and confirms that an unknown -flto= value gets that error.