Replacing r210333 with an improved solution; we should never reach this code with any other loop hint options.

llvm-svn: 210338
This commit is contained in:
Aaron Ballman 2014-06-06 15:01:47 +00:00
parent 7c0114f6e3
commit 8bbb8446f3
1 changed files with 3 additions and 2 deletions

View File

@ -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());