Skip to content

Commit fe01d7e

Browse files
committed
!fixup add clarifying note as suggested, thanks!
1 parent df94602 commit fe01d7e

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
@@ -254,6 +254,12 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
254254
// mangled names, meaning the metadata emitted below would incorrectly
255255
// mark them as no-alias. Use AnyPtr for such types in both C and C++, as
256256
// C and C++ types may be visible when doing LTO.
257+
//
258+
// Note that using AnyPtr is overly conservative. We could summarize the
259+
// members of the type, as per the C compatibility rule in the future.
260+
// This also covers anonymous structs and unions, which have a different
261+
// compatibility rule, but it doesn't matter because you can never have a
262+
// pointer to an anonymous struct or union.
257263
const auto *RT = Ty->getAs<RecordType>();
258264
if (RT && !RT->getDecl()->getDeclName())
259265
return AnyPtr;

0 commit comments

Comments
 (0)