[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:07:40 PST 2024


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

None

>From 0009c75d7ac422444f426fdb7db463865c3b78fe Mon Sep 17 00:00:00 2001
From: fuanqi <fuanqi at baidu.com>
Date: Tue, 24 Dec 2024 19:47:31 -0800
Subject: [PATCH] [Clang] fix for heterogeneous chip's host side's
 MaybeODRUseExprs clear

---
 clang/lib/Sema/SemaStmtAsm.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

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());



More information about the cfe-commits mailing list