================
@@ -1649,7 +1651,26 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
 
 // TODO(CIR): The properties of functions that require verification haven't
 // been implemented yet.
-mlir::LogicalResult cir::FuncOp::verify() { return success(); }
+mlir::LogicalResult cir::FuncOp::verify() {
+
+  llvm::SmallSet<llvm::StringRef, 16> labels;
+  llvm::SmallSet<llvm::StringRef, 16> gotos;
+
+  getOperation()->walk([&](mlir::Operation *op) {
+    if (auto lab = dyn_cast<cir::LabelOp>(op)) {
+      labels.insert(lab.getLabel());
+    } else if (auto goTo = dyn_cast<cir::GotoOp>(op)) {
+      gotos.insert(goTo.getLabel());
+    }
+  });
+
+  llvm::SmallSet<llvm::StringRef, 16> mismatched =
----------------
bcardosolopes wrote:

Please surround all the logic from here til prior to return success only if 
either set is not empty. 

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

Reply via email to