aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PlistDiagnostics.cpp
AgeCommit message (Collapse)Author
2010-06-15Break Frontend's dependency on Rewrite, Checker and CodeGen in shared ↵Daniel Dunbar
library configuration Currently, all AST consumers are located in the Frontend library, meaning that in a shared library configuration, Frontend has a dependency on Rewrite, Checker and CodeGen. This is suboptimal for clients which only wish to make use of the frontend. CodeGen in particular introduces a large number of unwanted dependencies. This patch breaks the dependency by moving all AST consumers with dependencies on Rewrite, Checker and/or CodeGen to their respective libraries. The patch therefore introduces dependencies in the other direction (i.e. from Rewrite, Checker and CodeGen to Frontend). After applying this patch, Clang builds correctly using CMake and shared libraries ("cmake -DBUILD_SHARED_LIBS=ON"). N.B. This patch includes file renames which are indicated in the patch body. Changes in this revision of the patch: - Fixed some copy-paste mistakes in the header files - Modified certain aspects of the coding to comply with the LLVM Coding Standards git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25Move BugReporter.h, PathDiagnostic.h, and BugType.h to ↵Ted Kremenek
'include/Checker/BugReporter' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek
(1) libAnalysis is a generic analysis library that can be used by Sema. It defines the CFG, basic dataflow analysis primitives, and inexpensive flow-sensitive analyses (e.g. LiveVariables). (2) libChecker contains the guts of the static analyzer, incuding the path-sensitive analysis engine and domain-specific checks. Now any clients that want to use the frontend to build their own tools don't need to link in the entire static analyzer. This change exposes various obvious cleanups that can be made to the layout of files and headers in libChecker. More changes pending. :) This change also exposed a layering violation between AnalysisContext and MemRegion. BlockInvocationContext shouldn't explicitly know about BlockDataRegions. For now I've removed the BlockDataRegion* from BlockInvocationContext (removing context-sensitivity; although this wasn't used yet). We need to have a better way to extend BlockInvocationContext (and any LocationContext) to add context-sensitivty. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20Use the llvm coding convention for indentation for switch.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03Try to make the output of PlistDiagnostics more deterministic by sorting ↵Ted Kremenek
PathDiagnostics before they are emitted. Fixes <rdar://problem/7439668>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28Remove VISIBILITY_HIDDEN from anonymous namespaces in libFrontend.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90033 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Only flush plist diagnostics once.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Fix recently introduced use-after-free error reported in ↵Ted Kremenek
<rdar://problem/7387478>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05Convert CreateAnalysisConsumer and friends to just take a const ↵Daniel Dunbar
Preprocessor&, and simplify. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05Acting on Daniel's nagging, remove PathDiagnosticClientFactory() andTed Kremenek
migrate work in the destructors of PathDiagnosticClients from their destructors to FlushReports(). The destructors now currently call FlushReports(); this will be fixed in a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86108 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04Kill PreprocessorFactory, which was both morally repugnant and totally unused.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25Update clang for raw_fd_ostream no longer requiring F_Force.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23adjust for raw_fd_ostream api change.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Add missing '"'Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27(1) Enable PlistDiagnostics to take an option "PathDiagnosticClientFactory"Ted Kremenek
object that it can use to forward PathDiagnostics for further processing. Along with this feature, the PlistDiagnostics object logs which files are created by the forwarding of the PathDiagnostics. (2) Create a new PathDiagnosticClientFactory object for HTMLDiagnostics, allowing other PathDiagnosticClients to forward PathDiagnostics through an opaque interface. (3) Create a "plist-html" diagnostics option in AnalysisConsumer to allow the logging of HTML files created in a hybrid Plist+HTML diagnostic client. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15Update for raw_fd_ostream API changes. raw_fd_ostream now has aDan Gohman
Force flag to control whether the case of opening an existing file is considered an error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29BugReporter/PathDiagnostics:Ted Kremenek
- Add an (optional) short description for BugReports for clients that want to distinguish between long and short descriptions for bugs - Make the bug report for VLA less obscene for Plist diagnostics by using the short description git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22Add PathDiagnosticRange to PathDiagnostics. These simply wrap SourceRange andTed Kremenek
indicate whether or not the range represents an absolute range or should be extended by lexing to the end of the token. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21Plist diagnostics: Remove deprecated single-point locations in control-flowTed Kremenek
pieces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69719 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14Change Lexer::MeasureTokenLength to take a LangOptions reference.Chris Lattner
This allows it to accurately measure tokens, so that we get: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~~^ instead of the woefully inferior: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~ ^ Most of this is just plumbing to push the reference around. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-05Fix output of ranges in analyzer plist files.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02Hack: Add 'PathDiagnostic::flattenLocations()'. Because PlistDiagnosticClientTed Kremenek
can use a PathLocation after any reference Stmts are reclaimed, flattenLocation() converts those references to statements to source ranges. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02For plist diagnostics, use the extensive PathDiagnostic generation algorithm.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01- Changed PathDiagnosticPiece::getLocation() to return a PathDiagnosticLocationTed Kremenek
instead of a FullSourceLoc. This resulted in a bunch of small edits in various clients. - Updated BugReporter to include an alternate PathDiagnostic generation algorithm for PathDiagnosticClients desiring more control-flow pieces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31Allow two codepaths for PathDiagnostic generation. This patch mainly consists ofTed Kremenek
refactoring to make this possible (no functionality change). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28Properly escape special characters in <string>'s in plist file.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-27analyzer plist: For PathDiagnosticControlFlowPieces, now output an array ofTed Kremenek
start-end points, where start and end are source ranges. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-27Emit aggregate "location" for PathDiagnostic to plist. This fixes ↵Ted Kremenek
<rdar://problem/6729558>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-27BugReporter:Ted Kremenek
- Added an internal helper class 'PathDiagnosticBuilder' which now bundles the 'ExecutionContinues' methods. - Added preliminary diagnostics for short-circuit '&&' and '||' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19Plist diagnostics: distinguish between regular and extended messages for ↵Ted Kremenek
"events". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12PathDiagnostics:Ted Kremenek
- PathDiagnosticControlFlowPiece now consists of a "start" and "end" location to indicating the branch location and where the branch goes. BugReporter: - Updated BugReporter to construct PathDiagnosticControlFlowPiece objects with "end" locations. PlistDiagnostics: - Plists now contain the bug "type" (not just bug "category") - Plists now encode control-flow pieces differently than events; now the "start" and "end" locations are recorded git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66818 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10Handle "Macro" PathDiagnosticPiece kind when getting string identifier.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66518 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02Plist diagnostics now include PathDiagnostPiece::Kind.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02For now, do not output the 'DisplayHint' in plist files.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02Rename lib/Driver (etc) to lib/Frontend in prep for the *actual*Daniel Dunbar
driver taking lib/Driver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65811 91177308-0d34-0410-b5e6-96231b3b80d8