Skip to content

Commit 2372e81

Browse files
committed
!fixup address latest comments, thanks!
1 parent 65755fe commit 2372e81

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

clang/lib/CodeGen/CodeGenTBAA.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
225225
do {
226226
PtrDepth++;
227227
Ty = Ty->getPointeeType()->getBaseElementTypeUnsafe();
228-
} while (Ty->isPointerType() || Ty->isArrayType());
228+
} while (Ty->isPointerType());
229229
assert(!isa<VariableArrayType>(Ty));
230230
// When the underlying type is a builtin type, we compute the pointee type
231231
// string recursively, which is implicitly more forgiving than the standards
@@ -243,7 +243,7 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
243243
->getString();
244244
TyName = Name;
245245
} else {
246-
// Be conservative if the type isn't a RecordType. We are specifically
246+
// 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.
249249
if (!Ty->isRecordType())

clang/test/CXX/drs/cwg158.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck --check-prefixes=CHECK %s
33
// RUN: %clang_cc1 -triple x86_64-linux -std=c++14 %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck --check-prefixes=CHECK %s
44
// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck --check-prefixes=CHECK %s
5-
// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -O3 -pointer-tbaa -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck --check-prefixes=CHECK %s
5+
// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -O3 -pointer-tbaa -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck --check-prefixes=CHECK,POINTER-TBAA %s
66

77
// cwg158: yes
88

@@ -39,4 +39,5 @@ const int * h(const int * (*p)[10], int *(*q)[9]) {
3939
}
4040

4141
// POINTER-TBAA: [[PTRARRAY_TBAA]] = !{[[PTRARRAY_TY:!.+]], [[PTRARRAY_TY]], i64 0}
42-
// POINTER-TBAA: [[PTRARRAY_TY]] = !{!"p3 int", !4, i64 0}
42+
// POINTER-TBAA: [[PTRARRAY_TY]] = !{!"p2 int", [[ANYPTR:!.+]], i64 0}
43+
// POINTER-TBAA: [[ANYPTR]] = !{!"any pointer"

0 commit comments

Comments
 (0)