summaryrefslogtreecommitdiffstats
path: root/mlir/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/IR')
-rw-r--r--mlir/lib/IR/FunctionSupport.cpp8
-rw-r--r--mlir/lib/IR/Module.cpp4
2 files changed, 5 insertions, 7 deletions
diff --git a/mlir/lib/IR/FunctionSupport.cpp b/mlir/lib/IR/FunctionSupport.cpp
index 29cae177cec..6b27eb833bf 100644
--- a/mlir/lib/IR/FunctionSupport.cpp
+++ b/mlir/lib/IR/FunctionSupport.cpp
@@ -159,12 +159,10 @@ mlir::impl::parseFunctionLikeOp(OpAsmParser &parser, OperationState &result,
auto &builder = parser.getBuilder();
// Parse the name as a symbol reference attribute.
- FlatSymbolRefAttr nameAttr;
- if (parser.parseAttribute(nameAttr, ::mlir::SymbolTable::getSymbolAttrName(),
- result.attributes))
+ StringAttr nameAttr;
+ if (parser.parseSymbolName(nameAttr, ::mlir::SymbolTable::getSymbolAttrName(),
+ result.attributes))
return failure();
- // Convert the parsed function attr into a string attr.
- result.attributes.back().second = builder.getStringAttr(nameAttr.getValue());
// Parse the function signature.
auto signatureLocation = parser.getCurrentLocation();
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<StringRef> 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))
OpenPOWER on IntegriCloud