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.

~Aaron
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to