From 74261fdf5d17903960c4a41cc03afe5a7c6122d0 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 6 Jun 2014 15:01:47 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaStmtAttr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()); -- 2.40.0