aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2013-04-30 17:38:09 +0000
committerManman Ren <mren@apple.com>2013-04-30 17:38:09 +0000
commitc7d77b25a37acad689ae5c318fdf80fde92983f0 (patch)
tree0a22bcc914c89b2c3bff721c393da8b7ea51dacf /lib/CodeGen
parentdc7a4f5d7a7e3b60d4dc4a80338d7a2728540998 (diff)
Struct-path aware TBAA: enable struct-path aware TBAA for classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CodeGenTBAA.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenTBAA.cpp b/lib/CodeGen/CodeGenTBAA.cpp
index 54e0de6c12..5ff1560a48 100644
--- a/lib/CodeGen/CodeGenTBAA.cpp
+++ b/lib/CodeGen/CodeGenTBAA.cpp
@@ -255,9 +255,11 @@ CodeGenTBAA::getTBAAStructInfo(QualType QTy) {
static bool isTBAAPathStruct(QualType QTy) {
if (const RecordType *TTy = QTy->getAs<RecordType>()) {
const RecordDecl *RD = TTy->getDecl()->getDefinition();
+ if (RD->hasFlexibleArrayMember())
+ return false;
// RD can be struct, union, class, interface or enum.
- // For now, we only handle struct.
- if (RD->isStruct() && !RD->hasFlexibleArrayMember())
+ // For now, we only handle struct and class.
+ if (RD->isStruct() || RD->isClass())
return true;
}
return false;