From: Aaron Ballman Date: Fri, 6 Jun 2014 15:01:47 +0000 (+0000) Subject: Replacing r210333 with an improved solution; we should never reach this code with... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74261fdf5d17903960c4a41cc03afe5a7c6122d0;p=clang Replacing r210333 with an improved solution; we should never reach this code with any other loop hint options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210338 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaStmtAttr.cpp b/lib/Sema/SemaStmtAttr.cpp index 5f73bc1da1..5b1766a0b2 100644 --- a/lib/Sema/SemaStmtAttr.cpp +++ b/lib/Sema/SemaStmtAttr.cpp @@ -69,7 +69,7 @@ static Attr *handleLoopHintAttr(Sema &S, Stmt *St, const AttributeList &A, .Case("interleave_count", LoopHintAttr::InterleaveCount) .Default(LoopHintAttr::Vectorize); - int ValueInt = 0; + int ValueInt; if (Option == LoopHintAttr::Vectorize || Option == LoopHintAttr::Interleave) { if (!ValueInfo) { S.Diag(ValueLoc->Loc, diag::err_pragma_loop_invalid_keyword) @@ -102,7 +102,8 @@ static Attr *handleLoopHintAttr(Sema &S, Stmt *St, const AttributeList &A, << /*MissingValue=*/false << ValueInt; return nullptr; } - } + } else + llvm_unreachable("Unknown loop hint option"); return LoopHintAttr::CreateImplicit(S.Context, Option, ValueInt, A.getRange());