summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFG.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-03-03 01:01:03 +0000
committerTed Kremenek <kremenek@apple.com>2011-03-03 01:01:03 +0000
commit1676a042e30b62c09f5493929e8130170e6a3fcd (patch)
tree3503a53dc7941223125399b93a35a5b4a7361e9f /clang/lib/Analysis/CFG.cpp
parent86b900bacac008decf63468beb9251c545cebb89 (diff)
downloadbcm5719-llvm-1676a042e30b62c09f5493929e8130170e6a3fcd.tar.gz
bcm5719-llvm-1676a042e30b62c09f5493929e8130170e6a3fcd.zip
Teach CFGImplicitDtor::getDestructorDecl() about reference types.
llvm-svn: 126909
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r--clang/lib/Analysis/CFG.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index c433639ec1a..fc50071a32c 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -2782,9 +2782,10 @@ const CXXDestructorDecl *CFGImplicitDtor::getDestructorDecl() const {
case CFGElement::AutomaticObjectDtor: {
const VarDecl *var = cast<CFGAutomaticObjDtor>(this)->getVarDecl();
QualType ty = var->getType();
+ ty = ty.getNonReferenceType();
const RecordType *recordType = ty->getAs<RecordType>();
const CXXRecordDecl *classDecl =
- cast<CXXRecordDecl>(recordType->getDecl());
+ cast<CXXRecordDecl>(recordType->getDecl());
return classDecl->getDestructor();
}
case CFGElement::TemporaryDtor: {
@@ -2799,7 +2800,7 @@ const CXXDestructorDecl *CFGImplicitDtor::getDestructorDecl() const {
// Not yet supported.
return 0;
}
- assert(0 && "getKind() returned bogus value");
+ llvm_unreachable("getKind() returned bogus value");
return 0;
}
OpenPOWER on IntegriCloud