Skip to content

Commit 43d9e69

Browse files
committed
Simplify predicate check and correct comment.
1 parent ddc8010 commit 43d9e69

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,6 @@ namespace {
10641064
/// The expectation is that we'll eventually hit one of three expression types:
10651065
///
10661066
/// 1. DeclRefExpr - This is the expression for the base of the structure.
1067-
/// It's exactly what we want to build an access to the \p counted_by
1068-
/// field.
10691067
/// 2. MemberExpr - This is the field in the structure.
10701068
/// 3. CompoundLiteralExpr - This is for people who create something
10711069
/// heretical like (struct foo has a flexible array member):
@@ -1130,7 +1128,7 @@ static std::pair<uint64_t, uint64_t> getFieldInfo(CodeGenFunction &CGF,
11301128
continue;
11311129
}
11321130

1133-
if (const auto *FD = dyn_cast<FieldDecl>(D); FD && FD == VD) {
1131+
if (const auto *FD = dyn_cast<FieldDecl>(D); FD == VD) {
11341132
Offset += Layout.getFieldOffset(FieldNo);
11351133
return std::make_pair(Ctx.getTypeSizeInChars(FD->getType()).getQuantity(),
11361134
Ctx.toCharUnitsFromBits(Offset).getQuantity());

0 commit comments

Comments
 (0)