================
@@ -147,6 +149,21 @@ void *EHScopeStack::pushCleanup(CleanupKind kind, size_t
size) {
assert(!cir::MissingFeatures::innermostEHScope());
+ CIRGenBuilderTy &builder = cgf->getBuilder();
+ mlir::Location loc = builder.getUnknownLoc();
+ auto cleanupScope = cir::CleanupScopeOp::create(
+ builder, loc, cir::CleanupKind::All,
----------------
andykaylor wrote:
The CleanupKind flag should be set something like this:
```
if (isEHCleanup && cgf->getLangOpts()->Exceptions) {
if (isNormalCleanup)
cleanupKind = cir::CleanupKind::All;
else
cleanupKind = cir::CleanupKind::EH;
} else {
if (isNormalCleanup)
cleanupKind = cir::CleanupKind::Normal;
else
skipCleanup = true;
}
```
I intend `skipCleanup` here as a placeholder for the fact that if this is an
EH-only and exceptions are disabled, or if it's a lifetime marker cleanup we
shouldn't create a cleanup scope operation. The above should be reworked as
needed. It's just a rough outline to represent the logic.
https://github.com/llvm/llvm-project/pull/180276
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits