On 8/29/14, 12:16 PM, Aaron Ballman wrote:
On Fri, Aug 29, 2014 at 1:26 PM, Jon Roelofs <[email protected]> wrote:
================
Comment at: lib/CodeGen/BackendUtil.cpp:422-429
@@ -421,1 +421,10 @@
+ if (CodeGenOpts.ThreadModel == "posix")
+ Options.ThreadModel = llvm::ThreadModel::POSIX;
+ else if (CodeGenOpts.ThreadModel == "single")
+ Options.ThreadModel = llvm::ThreadModel::Single;
+ else {
+ assert(false && "Invalid Thread model!");
+ Options.ThreadModel = llvm::ThreadModel::POSIX;
+ }
+
----------------
majnemer wrote:
You may want to consider using LLVM's [[
http://llvm.org/docs/doxygen/html/classllvm_1_1StringSwitch.html#details |
StringSwitch ]] here.
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
if you leave off the .Default call.
Oh. That's awesome!
I'll swap this out for StringSwitch then.
Jon
~Aaron
--
Jon Roelofs
[email protected]
CodeSourcery / Mentor Embedded
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits