Skip to content

Commit 796ccf8

Browse files
committed
!fixup Move up getAs<>() as suggested
1 parent fe01d7e commit 796ccf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/CodeGen/CodeGenTBAA.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
246246
// Be conservative if the type isn't a RecordType. We are specifically
247247
// required to do this for member pointers until we implement the
248248
// similar-types rule.
249-
if (!Ty->isRecordType())
249+
const auto *RT = Ty->getAs<RecordType>();
250+
if (!RT)
250251
return AnyPtr;
251252

252253
// For unnamed structs or unions C's compatible types rule applies. Two
@@ -260,8 +261,7 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
260261
// This also covers anonymous structs and unions, which have a different
261262
// compatibility rule, but it doesn't matter because you can never have a
262263
// pointer to an anonymous struct or union.
263-
const auto *RT = Ty->getAs<RecordType>();
264-
if (RT && !RT->getDecl()->getDeclName())
264+
if (!RT->getDecl()->getDeclName())
265265
return AnyPtr;
266266

267267
// For non-builtin types use the mangled name of the canonical type.

0 commit comments

Comments
 (0)