summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Parse/Parser.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index d89a7b184f..a814475f16 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -1239,14 +1239,11 @@ Parser::StmtResult Parser::ParsePROGRAMStmt() {
// Parse the program name.
Lex();
- if (Tok.isNot(tok::identifier) || Tok.isAtStartOfStatement()) {
- Diag.Report(ProgramLoc, diag::err_expected_ident);
- return StmtError();
- }
-
SourceLocation NameLoc = Tok.getLocation();
IDInfo = Tok.getIdentifierInfo();
- Lex(); // Eat program name.
+ if(!ExpectAndConsume(tok::identifier))
+ return StmtError();
+
return Actions.ActOnPROGRAM(Context, IDInfo, ProgramLoc, NameLoc,
StmtLabel);
}