[Parser] Consistently use consumeIdentifier() for normal identifiers.

consumeIdentifier() provides the general way in which we consume an
identifier token and fill in an Identifier. Use it consistently in the
parser.
This commit is contained in:
Doug Gregor
2019-03-22 14:27:26 -07:00
parent 9c62420809
commit 32b0245187
4 changed files with 31 additions and 20 deletions

View File

@@ -297,8 +297,8 @@ ParserStatus Parser::parseGenericWhereClause(
getLayoutConstraint(Context.getIdentifier(Tok.getText()), Context)
->isKnownLayout()) {
// Parse a layout constraint.
auto LayoutName = Context.getIdentifier(Tok.getText());
auto LayoutLoc = consumeToken();
Identifier LayoutName;
auto LayoutLoc = consumeIdentifier(&LayoutName);
auto LayoutInfo = parseLayoutConstraint(LayoutName);
if (!LayoutInfo->isKnownLayout()) {
// There was a bug in the layout constraint.