[cfe-commits] r162928 - in /cfe/trunk: include/clang/Frontend/AnalyzerOptions.h include/clang/Frontend/CompilerInvocation.h include/clang/StaticAnalyzer/AnalyzerOptions.h include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h lib/Stati

Chandler Carruth chandlerc at google.com
Thu Aug 30 14:29:40 PDT 2012


On Thu, Aug 30, 2012 at 2:25 PM, Ted Kremenek <kremenek at apple.com> wrote:

> On Aug 30, 2012, at 2:18 PM, Ted Kremenek <kremenek at apple.com> wrote:
>
> > On Aug 30, 2012, at 1:48 PM, Matt Beaumont-Gay <matthewbg at google.com>
> wrote:
> >
> >> On Thu, Aug 30, 2012 at 12:26 PM, Ted Kremenek <kremenek at apple.com>
> wrote:
> >>> --- cfe/trunk/include/clang/Frontend/CompilerInvocation.h (original)
> >>> +++ cfe/trunk/include/clang/Frontend/CompilerInvocation.h Thu Aug 30
> 14:26:38 2012
> >>> @@ -13,7 +13,7 @@
> >>> #include "clang/Basic/LangOptions.h"
> >>> #include "clang/Basic/TargetOptions.h"
> >>> #include "clang/Basic/FileSystemOptions.h"
> >>> -#include "clang/Frontend/AnalyzerOptions.h"
> >>> +#include "clang/StaticAnalyzer/AnalyzerOptions.h"
> >>
> >> Hi Ted,
> >>
> >> This introduces a cyclic dependency between StaticAnalyzer and
> >> Frontend (lib/StaticAnalyzer/Frontend/FrontendActions.cpp includes
> >> "clang/Frontend/CompilerInstance.h"). Can we factor these headers to
> >> fix the cycle?
> >>
> >> -Matt
> >
> > Hi Matt,
> >
> > I don't see how this introduces that dependency.  Wasn't it there
> already?  AnalyzerOptions.h does not include anything from clang/Frontend.
>  I didn't change any of the other headers.  I'm not contesting that there
> is a cyclic dependency; I just don't see how I introduced one.
> >
> > Ted
>
> Oh, I see what you mean.  I'm not certain if this really is a cyclic
> dependency.  AnalyzerOptions.h is really a "leaf" header that doesn't
> include anything else.  It just defines a common object to pass data from
> the frontend to the analyzer engine.


Yea, the only problem is that the SA/Frontend library depends heavily on
the Frontend library. We build all of the SA into a single library, but we
probably shouldn't. Because we do that, when we check the library-level
include layering, we find a cycle.

Here is one question perhaps, which of the 3 SA sub-libraries should this
header belong to?

Or actually, why do we need both Frontend/AnalyzerOptions.h and
StaticAnalyzer/AnalyzerOptions? Could we merge the latter into the former?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120830/907fa229/attachment.html>


More information about the cfe-commits mailing list