Skip to content

Commit 8068c5b

Browse files
committed
CodeGenTBAA: getTypeInfoHelper: also use pointer depth in conservative cases
1 parent aa4ccd6 commit 8068c5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CodeGen/CodeGenTBAA.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
277277
// similar-types rule.
278278
const auto *RT = Ty->getAs<RecordType>();
279279
if (!RT)
280-
return getAnyPtr();
280+
return getAnyPtr(PtrDepth);
281281

282282
// For unnamed structs or unions C's compatible types rule applies. Two
283283
// compatible types in different compilation units can have different
@@ -291,7 +291,7 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
291291
// compatibility rule, but it doesn't matter because you can never have a
292292
// pointer to an anonymous struct or union.
293293
if (!RT->getDecl()->getDeclName())
294-
return getAnyPtr();
294+
return getAnyPtr(PtrDepth);
295295

296296
// For non-builtin types use the mangled name of the canonical type.
297297
llvm::raw_svector_ostream TyOut(TyName);

0 commit comments

Comments
 (0)