[Mlir-commits] [mlir] [MLIR] Add support for frame pointers in MLIR (PR #72145)

Markus Böck llvmlistbot at llvm.org
Mon Nov 13 13:53:40 PST 2023


================
@@ -2319,6 +2319,23 @@ ParseResult LLVMFuncOp::parse(OpAsmParser &parser, OperationState &result) {
     result.addAttribute(getComdatAttrName(result.name), comdat);
   }
 
+  // Parse the optional frame_pointer
+  if (succeeded(parser.parseOptionalKeyword("frame_pointer"))) {
+    std::string string;
+    
+    if (parser.parseEqual() || parser.parseString(&string))
+      return failure();
+    if (!LLVM::symbolizeFramePointerKind(string))
+    { 
+      llvm::outs() << "failure: frame-pointer option not recognized: " << string << "\n";
+      return failure();
----------------
zero9178 wrote:

Emitting errors in parsing code should be done via the `emitError` method of `parser` as this utilizes MLIRs diagnostics infrastructure. Writing to `llvm::outs` or any other global stream in particularly is heavly discouraged. 

https://github.com/llvm/llvm-project/pull/72145


More information about the Mlir-commits mailing list