================
@@ -424,6 +424,10 @@ LogicalResult cir::FuncOp::verifyType() {
   if (!isa<cir::FuncType>(type))
     return emitOpError("requires '" + getFunctionTypeAttrName().str() +
                        "' attribute of function type");
+  if (auto rt = type.getReturnTypes();
----------------
erichkeane wrote:

Yeah, just super weird/scary for me that FuncType has `getReturnTypes` here.  
BUT I consider the verifier for the purposes of sanity-checking anyway... I 
guess it would fail parsing, but one of the justifications for making the 
verifier so aggressive in LLVM at checking EVERYTHING is that it can sometimes 
come from other, side-channel sources like a handwritten text file, or one of 
the CAPIs.

ALSO-ALSO:  If I'm mentally parsing this right: That check on line 424 is an 
absolute impossibility by the type system, right?  

`getFunctionType` already gives us a `cir::FuncType`, so an `isa` will always 
be true, correct? Or am I missing something?

https://github.com/llvm/llvm-project/pull/128787
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to