Skip to content

Commit ddd22cf

Browse files
committed
!fixup add clarifying note as suggested, thanks!
1 parent 1026043 commit ddd22cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/lib/CodeGen/CodeGenTBAA.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
235235
// mangled names, meaning the metadata emitted below would incorrectly
236236
// mark them as no-alias. Use AnyPtr for such types in both C and C++, as
237237
// C and C++ types may be visible when doing LTO.
238+
//
239+
// Note that using AnyPtr is overly conservative. We could summarize the
240+
// members of the type, as per the C compatibility rule in the future.
241+
// This also covers anonymous structs and unions, which have a different
242+
// compatibility rule, but it doesn't matter because you can never have a
243+
// pointer to an anonymous struct or union.
238244
const auto *RT = Ty->getAs<RecordType>();
239245
if (RT && !RT->getDecl()->getDeclName())
240246
return AnyPtr;

0 commit comments

Comments
 (0)