[Mlir-commits] [mlir] [MLIR][Parser] Fix precision loss when parsing f80 and f128 literals (PR #220267)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Sep 1 12:47:26 PDT 2026


================
@@ -339,10 +339,9 @@ ParseResult Parser::parseAttributeDict(NamedAttrList &attributes) {
 
 /// Parse a float attribute.
 Attribute Parser::parseFloatAttr(Type type, bool isNegative) {
-  SMLoc loc = getToken().getLoc();
-  auto val = getToken().getFloatingPointValue();
-  if (!val)
-    return (emitError("floating point value too large for attribute"), nullptr);
+  // Defer parsing the literal until the type, and with it the float semantics,
+  // is known.
+  Token literalTok = getToken();
----------------
zhangweize9-cyber wrote:

Wait, wait, wait, can you explain to me why the specific error coordinates are being removed here? If it's a large project, how can we pinpoint the exact line where the problem is without location coordinates? I'd like to hear your thoughts.

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


More information about the Mlir-commits mailing list