diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-02-21 03:12:32 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-02-21 03:12:32 +0000 |
commit | 599f85ab85e7ec380b0bb866bfc23a87726423c8 (patch) | |
tree | fbfad32ccbd54a22bd849682160058b0327cef40 /clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | |
parent | e6a8cedd2c7265cc60724f5dac21f904a8530e66 (diff) | |
download | bcm5719-llvm-599f85ab85e7ec380b0bb866bfc23a87726423c8.tar.gz bcm5719-llvm-599f85ab85e7ec380b0bb866bfc23a87726423c8.zip |
[analyzer] Record whether a base object region represents a virtual base.
This allows MemRegion and MemRegionManager to avoid asking over and over
again whether an class is a virtual base or a non-virtual base.
Minor optimization/cleanup; no functionality change.
llvm-svn: 175716
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp index cb3339d9cc5..d7cb5d18786 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp @@ -161,8 +161,10 @@ void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *CE, Target = ThisVal.getAsRegion(); } else { // Cast to the base type. - QualType BaseTy = CE->getType(); - SVal BaseVal = getStoreManager().evalDerivedToBase(ThisVal, BaseTy); + bool IsVirtual = + (CE->getConstructionKind() == CXXConstructExpr::CK_VirtualBase); + SVal BaseVal = getStoreManager().evalDerivedToBase(ThisVal, CE->getType(), + IsVirtual); Target = BaseVal.getAsRegion(); } break; |