================
@@ -585,6 +585,31 @@ mlir::LogicalResult CIRGenFunction::emitDeclStmt(const
DeclStmt &s) {
return mlir::success();
}
+static cir::StoreOp findDominatingStoreToReturnValue(CIRGenFunction &cgf) {
+ mlir::Block *currentBlock = cgf.getBuilder().getInsertionBlock();
+ if (!currentBlock || currentBlock->empty())
+ return nullptr;
+
+ if (!cgf.fnRetAlloca)
+ return nullptr;
+
+ mlir::Value retAlloca = *cgf.fnRetAlloca;
+
+ for (auto &op : llvm::reverse(*currentBlock)) {
+ if (auto storeOp = dyn_cast<cir::StoreOp>(op)) {
+ if (storeOp.getAddr() == retAlloca) {
----------------
andykaylor wrote:
Braces aren't needed here.
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
https://github.com/llvm/llvm-project/pull/186320
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits