Skip to content

Commit 596564c

Browse files
committed
Remove even more code we don't need to keep around
1 parent a000704 commit 596564c

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

clang/include/clang/Parse/Parser.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,18 +2823,6 @@ class Parser : public CodeCompletionHandler {
28232823
void ParseBorlandTypeAttributes(ParsedAttributes &attrs);
28242824
void ParseOpenCLKernelAttributes(ParsedAttributes &attrs);
28252825
void ParseOpenCLQualifiers(ParsedAttributes &Attrs);
2826-
/// Parses opencl_unroll_hint attribute if language is OpenCL v2.0
2827-
/// or higher.
2828-
/// \return false if error happens.
2829-
bool MaybeParseOpenCLUnrollHintAttribute(ParsedAttributes &Attrs) {
2830-
if (getLangOpts().OpenCL)
2831-
return ParseOpenCLUnrollHintAttribute(Attrs);
2832-
return true;
2833-
}
2834-
/// Parses opencl_unroll_hint attribute.
2835-
/// \return false if error happens.
2836-
bool ParseOpenCLUnrollHintAttribute(ParsedAttributes &Attrs);
2837-
28382826
void ParseNullabilityTypeSpecifiers(ParsedAttributes &attrs);
28392827
VersionTuple ParseVersionTuple(SourceRange &Range);
28402828
void ParseAvailabilityAttribute(IdentifierInfo &Availability,

clang/lib/Sema/SemaStmtAttr.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -689,28 +689,13 @@ static Attr *handleLoopUnrollHint(Sema &S, Stmt *St, const ParsedAttr &A,
689689
// determines unrolling factor) or 1 argument (the unroll factor provided
690690
// by the user).
691691

692-
if (!isa<ForStmt, CXXForRangeStmt, DoStmt, WhileStmt>(St)) {
693-
S.Diag(A.getLoc(), diag::err_attribute_wrong_decl_type_str)
694-
<< A << "'for', 'while', and 'do' statements";
695-
return nullptr;
696-
}
697-
698692
Expr *E = A.getNumArgs() ? A.getArgAsExpr(0) : nullptr;
699693
if (A.getParsedKind() == ParsedAttr::AT_OpenCLUnrollHint)
700694
return S.BuildOpenCLLoopUnrollHintAttr(A, E);
701-
else if (A.getParsedKind() == ParsedAttr::AT_LoopUnrollHint) {
702-
// FIXME: this should be hoisted up to the top level, but can't be placed
703-
// there until the opencl attribute has its parsing error converted into a
704-
// semantic error. See: Parser::ParseOpenCLUnrollHintAttribute().
705-
if (!isa<ForStmt, CXXForRangeStmt, DoStmt, WhileStmt>(St)) {
706-
S.Diag(A.getLoc(), diag::err_attribute_wrong_decl_type_str)
707-
<< A << "'for', 'while', and 'do' statements";
708-
return nullptr;
709-
}
695+
if (A.getParsedKind() == ParsedAttr::AT_LoopUnrollHint)
710696
return S.BuildLoopUnrollHintAttr(A, E);
711-
}
712697

713-
return nullptr;
698+
llvm_unreachable("Unknown loop unroll hint");
714699
}
715700

716701
static Attr *ProcessStmtAttribute(Sema &S, Stmt *St, const ParsedAttr &A,

0 commit comments

Comments
 (0)