[cfe-commits] r140131 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h lib/StaticAnalyzer/Core/PathDiagnostic.cpp
Ted Kremenek
kremenek at apple.com
Mon Sep 19 21:29:56 PDT 2011
On Sep 19, 2011, at 6:51 PM, Anna Zaks wrote:
> class PathDiagnosticLocation {
> @@ -93,24 +96,36 @@
> const Decl *D;
> const SourceManager *SM;
> const LocationContext *LC;
Hi Anna,
Is LC still needed?
> +PathDiagnosticLocation::PathDiagnosticLocation(const Stmt *s,
> + const SourceManager &sm,
> + const LocationContext *lc)
> + : K(StmtK), S(s), D(0), SM(&sm), LC(lc)
> +{
> + const ParentMap* PM = 0;
> + if (lc)
> + PM = &lc->getParentMap();
> +
> + Loc = genLocation(PM);
> + Range = genRange(PM);
> +}
> +
We should only generate the ParentMap if it is needed by genLocation() and genRange().
Cheers,
Ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110919/0dc00081/attachment.html>
More information about the cfe-commits
mailing list