[clang] [Clang] fix for heterogeneous chip's host side's MaybeODRUseExprs clear (PR #121085)

via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 24 22:08:24 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: None (fuaq)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/121085.diff


1 Files Affected:

- (modified) clang/lib/Sema/SemaStmtAsm.cpp (+6) 


``````````diff
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp
index a0b203fbdfec21..5ff11fac9ca5f7 100644
--- a/clang/lib/Sema/SemaStmtAsm.cpp
+++ b/clang/lib/Sema/SemaStmtAsm.cpp
@@ -240,6 +240,12 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
                                  Expr *asmString, MultiExprArg clobbers,
                                  unsigned NumLabels,
                                  SourceLocation RParenLoc) {
+  struct _Cleaner {
+    Sema &S;
+    ~_Cleaner() {
+      S.DiscardCleanupsInEvaluationContext();
+    }
+  } _C{*this};
   unsigned NumClobbers = clobbers.size();
   StringLiteral **Constraints =
     reinterpret_cast<StringLiteral**>(constraints.data());

``````````

</details>


https://github.com/llvm/llvm-project/pull/121085


More information about the cfe-commits mailing list