From da47081e8be44c9ca3cb2edd755c5b5c8658cdb8 Mon Sep 17 00:00:00 2001 From: binaryfz Date: Wed, 27 Jan 2021 09:47:40 +0800 Subject: [PATCH] [me]ops RCWeak in me_rc_lowering --- src/mapleall/maple_me/src/me_rc_lowering.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mapleall/maple_me/src/me_rc_lowering.cpp b/src/mapleall/maple_me/src/me_rc_lowering.cpp index 46abe6f56d..866c4a2496 100644 --- a/src/mapleall/maple_me/src/me_rc_lowering.cpp +++ b/src/mapleall/maple_me/src/me_rc_lowering.cpp @@ -171,7 +171,11 @@ IntrinsiccallMeStmt *RCLowering::GetIvarRHSHandleStmt(const MeStmt &stmt) { } // load global into temp and update rhs to temp std::vector opnds; - MIRIntrinsicID rcCallId = ivar->IsVolatile() ? PrepareVolatileCall(stmt, INTRN_MCCLoadRefVol) : INTRN_MCCLoadRef; + bool isRCWeak = ivar->IsRCWeak(); + // @Weak annotation handling + MIRIntrinsicID rcCallId = + ivar->IsVolatile() ? PrepareVolatileCall(stmt, isRCWeak ? INTRN_MCCLoadWeakVol : INTRN_MCCLoadRefVol) + : (isRCWeak ? INTRN_MCCLoadWeak : INTRN_MCCLoadRef); opnds.push_back(&ivar->GetBase()->GetAddrExprBase()); opnds.push_back(irMap.CreateAddrofMeExpr(*ivar)); // rhs is not special, skip -- Gitee