Depends on: http://reviews.llvm.org/D4984
Details
Diff Detail
Event Timeline
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
440 | You need to validate the string here (just asserting later is not acceptable). There are plenty of calls to Diags.Report in this file, you'll need to add another. Then you'll need a regression test for this. |
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
422–429 | You may want to consider using LLVM's StringSwitch here. | |
427 | This assertion doesn't look too useful. |
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
431 | Shouldn't this have a .Default()? If so, which value? |
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
431 | And is "posix" really the best term for the C++11 model? Windows has just as much history of threading, and it was all rather a bodge before the C++11 description came around. |
lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
431 | I based the name on the thing printed out by clang++ -v - < /dev/null and g++ -v - < /dev/null: $ clang++ -v - < /dev/null See: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_concurrency.html | |
431 | From earlier in the thread: "I considered it, but Stringswitch wouldn't let me assert that every case was handled." "StringSwitch does that automatically for you when getting the result |
ping
@t.p.northover do you have a better suggestion on the thread model's name? We could try to match gcc here, as I've half-heartedly done (I didn't add the bits that make it print out "win32" on windows), or we could do something else.
Hi,
The explanation for using posix sounds reasonable to me. Windows users can add win32 as an option later if they need it.
lib/Driver/Driver.cpp | ||
---|---|---|
688–689 | Sorry to resurrect a multi-pinged and multi-commented review with another comment, but this would seem to allow "clang -v -mthread-model=silly", wouldn't it? That might be confusing for someone trying to work out what's allowed. |
@TNorthover, no worries. It's better to get the patch right the first time.
Add an error for when the toolchain doesn't support a thread model. This should make the clang -v -mthread-model silly case a bit nicer:
$ ./clang -v -mthread-model silly
clang: error: invalid thread model 'silly' in '-mthread-model silly' for this target
clang version 3.6.0 (trunk 218876)
Target: x86_64-apple-darwin13.4.0
lib/Driver/ToolChain.cpp | ||
---|---|---|
218 | The else here is superfluous. |
This looks fine now, as far as I'm concerned. I'd say you should just commit with Saleem's suggestion.
Cheers.
Tim.
This assertion doesn't look too useful.