================
@@ -1649,7 +1649,27 @@ 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() {
+
+  std::set<llvm::StringRef> labels;
----------------
andykaylor wrote:

I think `llvm::SmallSet` would be a better choice here. For a discussion of 
tradeoffs, see 
https://llvm.org/docs/ProgrammersManual.html#set-like-containers-std-set-smallset-setvector-etc

In this case, it basically comes down to a trade off of linear lookup (in the 
case of SmallSet) versus malloc-intensive storage (in the case of std::set). If 
we assume that the number of labels and gotos in the function is going to be 
relatively small, which I hope is true in most cases, SmallSet is better.

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