[PATCH] [analyzer] Small improvement for the empty class issue
David Blaikie
dblaikie at gmail.com
Tue Sep 3 10:25:14 PDT 2013
Test case(s)?
On Sep 2, 2013 2:49 AM, "Pavel Labath" <labath at google.com> wrote:
> Hi jordan_rose,
>
> rsmith suggested using CXXRecordDecl::isEmpty() instead, as it "also
> checks for
> virtual functions/virtual bases, and handles the case where the only
> fields are
> zero-length bitfields"
>
> http://llvm-reviews.chandlerc.com/D1573
>
> Files:
> lib/StaticAnalyzer/Core/RegionStore.cpp
>
> Index: lib/StaticAnalyzer/Core/RegionStore.cpp
> ===================================================================
> --- lib/StaticAnalyzer/Core/RegionStore.cpp
> +++ lib/StaticAnalyzer/Core/RegionStore.cpp
> @@ -1836,7 +1836,7 @@
> if (!RD->field_empty())
> return false;
> if (const CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(RD))
> - return CRD->getNumBases() == 0;
> + return CRD->isEmpty();
> return true;
> }
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130903/b47cd8ed/attachment.html>
More information about the cfe-commits
mailing list