From 6df83699418c6a6d6105728cdec59c78212aa841 Mon Sep 17 00:00:00 2001 From: River Riddle Date: Wed, 13 Nov 2019 09:31:45 -0800 Subject: Rename the current parseSymbolName to parseOptionalSymbolName The current implementation silently fails if the '@' identifier isn't present, making it similar to the 'optional' parse methods. This change renames the current implementation to 'Optional' and adds a new 'parseSymbolName' that emits an error. PiperOrigin-RevId: 280214610 --- mlir/lib/IR/Module.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mlir/lib/IR/Module.cpp') diff --git a/mlir/lib/IR/Module.cpp b/mlir/lib/IR/Module.cpp index f5cc98e39cf..79e04521e9c 100644 --- a/mlir/lib/IR/Module.cpp +++ b/mlir/lib/IR/Module.cpp @@ -44,8 +44,8 @@ ModuleOp ModuleOp::create(Location loc, Optional name) { ParseResult ModuleOp::parse(OpAsmParser &parser, OperationState &result) { // If the name is present, parse it. StringAttr nameAttr; - (void)parser.parseSymbolName(nameAttr, mlir::SymbolTable::getSymbolAttrName(), - result.attributes); + (void)parser.parseOptionalSymbolName( + nameAttr, mlir::SymbolTable::getSymbolAttrName(), result.attributes); // If module attributes are present, parse them. if (parser.parseOptionalAttrDictWithKeyword(result.attributes)) -- cgit v1.2.3