@@ -6804,7 +6804,7 @@ class MappableExprsHandler {
6804
6804
/// they were computed by collectAttachPtrExprInfo(), if they are semantically
6805
6805
/// different.
6806
6806
struct AttachPtrExprComparator {
6807
- const MappableExprsHandler *Handler;
6807
+ const MappableExprsHandler *Handler = nullptr ;
6808
6808
// Cache of previous equality comparison results.
6809
6809
mutable llvm::DenseMap<std::pair<const Expr *, const Expr *>, bool>
6810
6810
CachedEqualityComparisons;
@@ -6817,8 +6817,8 @@ class MappableExprsHandler {
6817
6817
return false;
6818
6818
6819
6819
// First, compare by complexity (depth)
6820
- auto ItLHS = Handler->AttachPtrComponentDepthMap.find(LHS);
6821
- auto ItRHS = Handler->AttachPtrComponentDepthMap.find(RHS);
6820
+ const auto ItLHS = Handler->AttachPtrComponentDepthMap.find(LHS);
6821
+ const auto ItRHS = Handler->AttachPtrComponentDepthMap.find(RHS);
6822
6822
6823
6823
std::optional<size_t> DepthLHS =
6824
6824
(ItLHS != Handler->AttachPtrComponentDepthMap.end()) ? ItLHS->second
@@ -6856,7 +6856,7 @@ class MappableExprsHandler {
6856
6856
/// results, if available, otherwise does a recursive semantic comparison.
6857
6857
bool areEqual(const Expr *LHS, const Expr *RHS) const {
6858
6858
// Check cache first for faster lookup
6859
- auto CachedResultIt = CachedEqualityComparisons.find({LHS, RHS});
6859
+ const auto CachedResultIt = CachedEqualityComparisons.find({LHS, RHS});
6860
6860
if (CachedResultIt != CachedEqualityComparisons.end())
6861
6861
return CachedResultIt->second;
6862
6862
@@ -7142,7 +7142,7 @@ class MappableExprsHandler {
7142
7142
const Expr *getAttachPtrExpr(
7143
7143
OMPClauseMappableExprCommon::MappableExprComponentListRef Components)
7144
7144
const {
7145
- auto It = AttachPtrExprMap.find(Components);
7145
+ const auto It = AttachPtrExprMap.find(Components);
7146
7146
if (It != AttachPtrExprMap.end())
7147
7147
return It->second;
7148
7148
@@ -8478,8 +8478,9 @@ class MappableExprsHandler {
8478
8478
} else if (auto *ME = dyn_cast<MemberExpr>(PointerExpr)) {
8479
8479
AttachPtrAddr = CGF.EmitMemberExpr(ME).getAddress();
8480
8480
} else if (auto *UO = dyn_cast<UnaryOperator>(PointerExpr)) {
8481
- if (UO->getOpcode() == UO_Deref)
8482
- AttachPtrAddr = CGF.EmitLValue(UO).getAddress();
8481
+ assert(UO->getOpcode() == UO_Deref &&
8482
+ "Unexpected unary-operator on attach-ptr-expr");
8483
+ AttachPtrAddr = CGF.EmitLValue(UO).getAddress();
8483
8484
}
8484
8485
assert(AttachPtrAddr.isValid() &&
8485
8486
"Failed to get address for attach pointer expression");
@@ -8524,12 +8525,10 @@ class MappableExprsHandler {
8524
8525
8525
8526
// Pointer attachment is needed at map-entering time or for declare
8526
8527
// mappers.
8527
- if (!isa<const OMPDeclareMapperDecl *>(CurDir) &&
8528
- !isOpenMPTargetMapEnteringDirective(
8529
- cast<const OMPExecutableDirective *>(CurDir)->getDirectiveKind()))
8530
- return false;
8531
-
8532
- return true;
8528
+ return isa<const OMPDeclareMapperDecl *>(CurDir) ||
8529
+ isOpenMPTargetMapEnteringDirective(
8530
+ cast<const OMPExecutableDirective *>(CurDir)
8531
+ ->getDirectiveKind());
8533
8532
}
8534
8533
8535
8534
/// Computes the attach-ptr expr for \p Components, and updates various maps
0 commit comments