summaryrefslogtreecommitdiffstats
path: root/clang/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
commite36d3416abbd1eeb3567834a4c2b05d727a979da (patch)
treebf5c53417574d05c24b54428b5c09e07dd679914 /clang/lib/CodeGen
parent8beccf9e6df1208362f1a2e3339e64b156627853 (diff)
downloadbcm5719-llvm-e36d3416abbd1eeb3567834a4c2b05d727a979da.tar.gz
bcm5719-llvm-e36d3416abbd1eeb3567834a4c2b05d727a979da.zip
Struct-path aware TBAA: enable struct-path aware TBAA for classes.
llvm-svn: 180795
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CodeGenTBAA.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenTBAA.cpp b/clang/lib/CodeGen/CodeGenTBAA.cpp
index 54e0de6c129..5ff1560a488 100644
--- a/clang/lib/CodeGen/CodeGenTBAA.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud