• Home
  • History
  • Annotate
  • only in /external/clang/lib/StaticAnalyzer/Frontend/
History log of /external/clang/lib/StaticAnalyzer/Frontend/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
1fab7c3e3bd97a909a80b1bfea1909c6e7347fc0 12-Feb-2014 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/release_34' into merge-20140211


Change-Id: I17ca7161f32007272ee82036d237d051847dd02e
24146975f1af8c1b4b14e8545f218129d0e7dfeb 22-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Split isFromMainFile into two functions.

Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't. Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188968 91177308-0d34-0410-b5e6-96231b3b80d8
5fba5a789a238c29ef811a39a39be722443ec1b1 16-Aug-2013 Jordan Rose <jordan_rose@apple.com> [analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer.

This once again restores notes to following their associated warnings
in -analyzer-output=text mode. (This is still only intended for use as a
debugging aid.)

One twist is that the warning locations in "regular" analysis output modes
(plist, multi-file-plist, html, and plist-html) are reported at a different
location on the command line than in the output file, since the command
line has no path context. This commit makes -analyzer-output=text behave
like a normal output format, which means that the *command line output
will be different* in -analyzer-text mode. Again, since -analyzer-text is
a debugging aid and lo-fi stand-in for a regular output mode, this change
makes sense.

Along the way, remove a few pieces of stale code related to the path
diagnostic consumers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188514 91177308-0d34-0410-b5e6-96231b3b80d8
4ac73c7514f9e836b4d9781738f333c5cb91cb63 08-Aug-2013 Stephen Hines <srhines@google.com> Merge commit '51e75aecf4fb303b91c9e54fd88e3509e5acc7a6' into merge-20130807


Change-Id: If457223ecbee9e43c73d15333bf10d36590d05c4
1ec4a86a867fc04f35d13bc9e33b04cf2171fe41 05-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::createTemporaryFile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185717 91177308-0d34-0410-b5e6-96231b3b80d8
d2a5bee210218220a57d9f61a66e7f766a21d313 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> We only create one file, no need to delete a directory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184949 91177308-0d34-0410-b5e6-96231b3b80d8
de4c111f9d27fbc717f7416339772b2e58d48fc1 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove unused include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184922 91177308-0d34-0410-b5e6-96231b3b80d8
b8e60d9a8ff06110efab37fc123b3c56937367a9 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove more uses of llvm::sys::Path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184921 91177308-0d34-0410-b5e6-96231b3b80d8
57a3bbfa9a97f174b0c80b0309e32f4329c4ae1b 13-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use the sys::ExecuteAndWait that takes StringRefs.

Also don't depend on Program.h including PathV1.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183935 91177308-0d34-0410-b5e6-96231b3b80d8
2289933d3dfad854c006c02738abb1c57d1d587e 13-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Update for llvm change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183930 91177308-0d34-0410-b5e6-96231b3b80d8
a603569515eea06e54e6e041b1c690d33086f375 12-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use the global functions instead of the Program methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183861 91177308-0d34-0410-b5e6-96231b3b80d8
83eba02c2ea333015335e2f74c4d11c5315b655d 03-May-2013 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/master' into merge-20130502
8dae128d16bf98759b7a678ce3eebb613bd17109 16-Apr-2013 Ted Kremenek <kremenek@apple.com> Factor CheckerManager to be able to pass AnalyzerOptions to checkers
during checker registration. There are no immediate clients of this,
but this provides a way for checkers to query the options table
at startup instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179626 91177308-0d34-0410-b5e6-96231b3b80d8
8a660eb1084294a903f6dcc00bf2fa4e3bc92cfc 26-Mar-2013 Anna Zaks <ganna@apple.com> [analyzer] Change inlining policy to inline small functions when reanalyzing ObjC methods as top level.

This allows us to better reason about(inline) small wrapper functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178063 91177308-0d34-0410-b5e6-96231b3b80d8
bd3aca04d304b9f31240b94af0aad818f6f932ab 06-Mar-2013 Stephen Hines <srhines@google.com> Update build rules for Clang merge to version 176138.

Change-Id: Ib028329a591e6175998d969f11b5404bf3f19e81
450b86c0c9ff8307f5145ced621914600196c500 06-Mar-2013 Stephen Hines <srhines@google.com> Merge commit 'b58f810669d9c17bcc025b7560de01d162856f34' into merge_20130226


Change-Id: Ia10b4d3b2c949a72d328cb58b113f90237d4a5d5
1c32b81765ed63ae9e3e00e5acef7a4379bba228 08-Feb-2013 Anna Zaks <ganna@apple.com> [analyzer] Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174679 91177308-0d34-0410-b5e6-96231b3b80d8
a5245a51593aa45c2a5ef38a10861697d29c7789 02-Feb-2013 Anna Zaks <ganna@apple.com> [analyzer] Print Inline mode with -analyzer-display-progress.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174244 91177308-0d34-0410-b5e6-96231b3b80d8
ac3a3e7a402cd349dd2b7d70cd92c5fe702ae831 30-Jan-2013 Anna Zaks <ganna@apple.com> [analyzer] Make shallow mode more shallow.

Redefine the shallow mode to inline all functions for which we have a
definite definition (ipa=inlining). However, only inline functions that
are up to 4 basic blocks large and cut the max exploded nodes generated
per top level function in half.

This makes shallow faster and allows us to keep inlining small
functions. For example, we would keep inlining wrapper functions and

With the new shallow, it takes 104s to analyze sqlite3, whereas
the deep mode is 658s and previous shallow is 209s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173958 91177308-0d34-0410-b5e6-96231b3b80d8
15bb58edc9d053aa49c28167deb41ff0409ddabc 21-Jan-2013 Stephen Hines <srhines@google.com> Merge commit 'd130fd2e141f1fef412c2d58e7385370801bd718' into merge-llvm


Change-Id: I90a669a33ffe4de8b32c8459016fd0b2a55da0ad
b99083e60325a28063fb588f458a871151971fdc 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Re-sort #include lines using the llvm/utils/sort_includes.py script.

Removes a duplicate #include as well as cleaning up some sort order
regressions since I last ran the script over Clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171364 91177308-0d34-0410-b5e6-96231b3b80d8
bd80231672a7418aa1a99d3dbbe1774205c88f74 21-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Re-apply r170826 and make the dumping of the GallGraph

Commit message for r170826:

[analyzer] Traverse the Call Graph in topological order.

Modify the call graph by removing the parentless nodes. Instead all
nodes are children of root to ensure they are all reachable. Remove the
tracking of nodes that are "top level" or global. This information is
not used and can be obtained from the Decls stored inside

Instead of existing ordering hacks, analyze the functions in topological
order over the Call Graph.

Together with the addition of devirtualizable ObjC message sends and
blocks to the call graph, this gives around 6% performance improvement
on several large ObjC benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170906 91177308-0d34-0410-b5e6-96231b3b80d8
6d42f4d8b8a176336a8c49ec3cf5f7fb6545ccfd 21-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Revert r170826. The output of

./bin/clang -cc1 -internal-isystem /home/espindola/llvm/build/lib/clang/3.3/include/ -analyze -analyzer-checker=debug.DumpCallGraph /home/espindola/llvm/clang/test/Analysis/debug-CallGraph.c -fblocks

changes in each run.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170829 91177308-0d34-0410-b5e6-96231b3b80d8
e34e1939ad67576293b2b205b2169488cc6b3b14 21-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Traverse the Call Graph in topological order.

Modify the call graph by removing the parentless nodes. Instead all
nodes are children of root to ensure they are all reachable. Remove the
tracking of nodes that are "top level" or global. This information is
not used and can be obtained from the Decls stored inside

Instead of existing ordering hacks, analyze the functions in topological
order over the Call Graph.

Together with the addition of devirtualizable ObjC message sends and
blocks to the call graph, this gives around 6% performance improvement
on several large ObjC benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170826 91177308-0d34-0410-b5e6-96231b3b80d8
4f858dfd42c89b67200dac0afc228a0baa323691 21-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Add blocks and ObjC messages to the call graph.

This paves the road for constructing a better function dependency graph.
If we analyze a function before the functions it calls and inlines,
there is more opportunity for optimization.

Note, we add call edges to the called methods that correspond to
function definitions (declarations with bodies).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170825 91177308-0d34-0410-b5e6-96231b3b80d8
9fcc2ab2ec5e00802880e205568ff3afbd70a773 19-Dec-2012 Ted Kremenek <kremenek@apple.com> Pass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options accessible there.

This is plumbing needed for later functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170488 91177308-0d34-0410-b5e6-96231b3b80d8
39cf781d62daaec09e443c6e66a01cd7543ffb41 17-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170362 91177308-0d34-0410-b5e6-96231b3b80d8
b467051a9f212c57335f88f16e839e1dc8afc1c1 14-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Refactor: Store visited Decls instead of CallGraphNodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170231 91177308-0d34-0410-b5e6-96231b3b80d8
75f31c4862643ab09479c979fabf754e7ffe1460 07-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Optimization heuristic: do not reanalyze every ObjC method as
top level.

This heuristic is already turned on for non-ObjC methods
(inlining-mode=noredundancy). If a method has been previously analyzed,
while being inlined inside of another method, do not reanalyze it as top

This commit applies it to ObjCMethods as well. The main caveat here is
that to catch the retain release errors, we are still going to reanalyze
all the ObjC methods but without inlining turned on.

Gives 21% performance increase on one heavy ObjC benchmark, which
suffered large performance regressions due to ObjC inlining.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169639 91177308-0d34-0410-b5e6-96231b3b80d8
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
4eff6b5d6a5cbb6bd669854a84365aa61d70819e 10-Oct-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Don't run non-path-sensitive checks on system headers...

...but do run them on user headers.

Previously, we were inconsistent here: non-path-sensitive checks on code
/bodies/ were only run in the main source file, but checks on
/declarations/ were run in /all/ headers. Neither of those is the
behavior we want.

Thanks to Sujit for pointing this out!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165635 91177308-0d34-0410-b5e6-96231b3b80d8
469ba550f54577f28e23ea42c293308fbcad6609 10-Oct-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Fix typo: s/HandleDeclsGallGraph/HandleDeclsCallGraph/g

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165634 91177308-0d34-0410-b5e6-96231b3b80d8
0272622ce2061509b672f2afc11e91d83f802820 29-Sep-2012 Anna Zaks <ganna@apple.com> [analyzer] Do not visit ObjCMethodDecl twice in the AST checkers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164869 91177308-0d34-0410-b5e6-96231b3b80d8
9f0b1324a5352713337c75ef4a5acffd96609c6c 11-Sep-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-2012_09_10
305c613af6cfc40e519c75d9d2c84c6fa9a841c0 01-Sep-2012 Ted Kremenek <kremenek@apple.com> Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.
This is similar to how we divide up the StaticAnalyzer libraries to separate
core functionality to what is clearly associated with Frontend actions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163050 91177308-0d34-0410-b5e6-96231b3b80d8
45796b10d11869e86c6b85e24df165410536b313 31-Aug-2012 Ted Kremenek <kremenek@apple.com> Make AnalyzerOptions a shared object between CompilerInvocation and
AnalysisManager, allowing the StringMap of configuration values to
be propagated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162978 91177308-0d34-0410-b5e6-96231b3b80d8
987695a5ddd78beca784d4e503ffbc2dc879181a 31-Aug-2012 Ted Kremenek <kremenek@apple.com> Move AnalyzerOptions.h into 'Core' StaticAnalyzer sub-library.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162977 91177308-0d34-0410-b5e6-96231b3b80d8
3a46f5fd1709f6df03bbb8b0abf84052dc0f39ff 31-Aug-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Ensure that PathDiagnostics profile the same regardless of path.

PathDiagnostics are actually profiled and uniqued independently of the
path on which the bug occurred. This is used to merge diagnostics that
refer to the same issue along different paths, as well as by the plist
diagnostics to reference files created by the HTML diagnostics.

However, there are two problems with the current implementation:

1) The bug description is included in the profile, but some
PathDiagnosticConsumers prefer abbreviated descriptions and some
prefer verbose descriptions. Fixed by including both descriptions in
the PathDiagnostic objects and always using the verbose one in the profile.

2) The "minimal" path generation scheme provides extra information about
which events came from macros that the "extensive" scheme does not.
This resulted not only in different locations for the plist and HTML
diagnostics, but also in diagnostics being uniqued in the plist output
but not in the HTML output. Fixed by storing the "end path" location
explicitly in the PathDiagnostic object, rather than trying to find the
last piece of the path when the diagnostic is requested.

This should hopefully finish unsticking our internal buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162965 91177308-0d34-0410-b5e6-96231b3b80d8
fbcb3f11fc90e9f00e6074e9b118b8dc11ca604c 31-Aug-2012 Anna Zaks <ganna@apple.com> [analyzer] Refactor the logic that determines if a functions should be

The policy on what to reanalyze should be in AnalysisConsumer with the
rest of visitation order logic.

There is no reason why ExprEngine needs to pass the Visited set to
CoreEngine, it can populate it itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162957 91177308-0d34-0410-b5e6-96231b3b80d8
3b8a04004afa46057a9af4afbd086be71d619793 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Rename 'VisualizeEGUbi' and 'VisualizeEGDot' to 'visualizeExplodedGraphWithUbigGraph'
and 'visualizeExplodedGraphWithGraphViz' respectively.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162931 91177308-0d34-0410-b5e6-96231b3b80d8
255d4d4226b24036ceb11228fbb74286e58620f7 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Store const& to AnalyzerOptions in AnalysisManager instead of copying
individual flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162929 91177308-0d34-0410-b5e6-96231b3b80d8
5705a40c7ec62f1a903bf26e1e6a7f91b5b98ba3 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Move AnalyzerOptions.h to include/clang/StaticAnalyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162928 91177308-0d34-0410-b5e6-96231b3b80d8
82f5aceed89b85e79373086b7e0e7986e2c59179 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Move Analyses.def to include/clang/StaticAnalyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162927 91177308-0d34-0410-b5e6-96231b3b80d8
7b73e0832b20af1f43601a3d19e76d02d9f4dce5 29-Aug-2012 Ted Kremenek <kremenek@apple.com> Add new -cc1 driver option -analyzer-config, which allows one to specify
a comma separated collection of key:value pairs (which are strings). This
allows a general way to provide analyzer configuration data from the command line.

No clients yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162827 91177308-0d34-0410-b5e6-96231b3b80d8
80ea4bc944eb01c220eeaa004b21ad709ba928e1 24-Aug-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge_2


Change-Id: If47d0d39459760017258502b4d9e859ac36a273b
c4bac8e376b98d633bb00ee5f510d5e58449753c 16-Aug-2012 Ted Kremenek <kremenek@apple.com> Allow multiple PathDiagnosticConsumers to be used with a BugReporter at the same time.

This fixes several issues:

- removes egregious hack where PlistDiagnosticConsumer would forward to HTMLDiagnosticConsumer,
but diagnostics wouldn't be generated consistently in the same way if PlistDiagnosticConsumer
was used by itself.

- emitting diagnostics to the terminal (using clang's diagnostic machinery) is no longer a special
case, just another PathDiagnosticConsumer. This also magically resolved some duplicate warnings,
as we now use PathDiagnosticConsumer's diagnostic pruning, which has scope for the entire translation
unit, not just the scope of a BugReporter (which is limited to a particular ExprEngine).

As an interesting side-effect, diagnostics emitted to the terminal also have their trailing "." stripped,
just like with diagnostics emitted to plists and HTML. This required some tests to be updated, but now
the tests have higher fidelity with what users will see.

There are some inefficiencies in this patch. We currently generate the report graph (from the ExplodedGraph)
once per PathDiagnosticConsumer, which is a bit wasteful, but that could be pulled up higher in the
logic stack. There is some intended duplication, however, as we now generate different PathDiagnostics (for the same issue)
for different PathDiagnosticConsumers. This is necessary to produce the diagnostics that a particular
consumer expects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162028 91177308-0d34-0410-b5e6-96231b3b80d8
ee959355b93c0648fea88dc986d196e3705407dc 03-Aug-2012 Shih-wei Liao <sliao@google.com> Apply changes to migrate to CLANG-160673-20120724.

Change-Id: I00d23ac9b893c62dca281ec771eeb5f911854bae
08fc8eb5a1cc9c01af67e016ab21c9b905711eb1 03-Aug-2012 Shih-wei Liao <sliao@google.com> Merge with Clang upstream r160673 (Jul 24th 2012)


Change-Id: I37f02f20642a037b9da8d35fefa01986cd250b14
e1ce783708b65eaa832ffad03d239264046dd0eb 31-Jul-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Turn -cfg-add-initializers on by default, and remove the flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161060 91177308-0d34-0410-b5e6-96231b3b80d8
11abf2ad01f64ede7c0555167f41a1c5852f80c6 27-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib: [CMake] Update tblgen'd dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160851 91177308-0d34-0410-b5e6-96231b3b80d8
c0a43777ef48f6f07123b52d4e54b637d5e2d01c 25-Jul-2012 Ted Kremenek <kremenek@apple.com> Promote warn_unknown_analyzer_checker to an error. Addresses <rdar://problem/10987863>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160706 91177308-0d34-0410-b5e6-96231b3b80d8
8d3ba23f2d9e6c87794d059412a0808c9cbacb25 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Implement AST classes for comments, a real parser for Doxygen comments and a
very simple semantic analysis that just builds the AST; minor changes for lexer
to pick up source locations I didn't think about before.

Comments AST is modelled along the ideas of HTML AST: block and inline content.

* Block content is a paragraph or a command that has a paragraph as an argument
or verbatim command.
* Inline content is placed within some block. Inline content includes plain
text, inline commands and HTML as tag soup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159790 91177308-0d34-0410-b5e6-96231b3b80d8
84c1f4b1edddf74f8080cfc470796c2c498b5d43 05-Jul-2012 Anna Zaks <ganna@apple.com> [analyzer] Add a statistic for maximum CFG size and a script to summarize analyzer stats from scan-build output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159776 91177308-0d34-0410-b5e6-96231b3b80d8
d4aeb8050a1d0fe47c53a73361c8b0b8ac310f46 02-Jul-2012 Ted Kremenek <kremenek@apple.com> Bail out the LiveVariables analysis when the CFG is very large, as
we are encountering some scalability issues with memory usage. The
appropriate long term fix is to make the analysis more scalable, but
this will at least prevent the analyzer swapping when
analyzing very large functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159578 91177308-0d34-0410-b5e6-96231b3b80d8
371b477836f289f2e9caaab58530f187b51bc86d 02-Jul-2012 Ted Kremenek <kremenek@apple.com> Fix subtle bug in AnalysisConsumer where we would not analyze functions whose parent
in the call graph had been inlined but for whatever reason we did not inline some
of its callees.

Also, fix a related traversal bug where we meant to do a BFS of the callgraph but
instead were doing a DFS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159577 91177308-0d34-0410-b5e6-96231b3b80d8
b0d8671f95fe08a220118bca29063ba4d11a9dac 21-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Remove a goofy CMake hack and use the standard CMake facilities to
express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158888 91177308-0d34-0410-b5e6-96231b3b80d8
694a942b0a14e02757a695142c45437eec6e3684 31-May-2012 Anna Zaks <ganna@apple.com> [analyzer] Cleanup for r157721.
We should lock the number of elements after the initial parsing is
complete. Recursive AST visitors in AnalyzesConsumer and CallGarph can
trigger lazy pch deserialization resulting in more calls to
HandleTopLevelDecl and appending to the LocalTUDecls list. We should
ignore those.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157762 91177308-0d34-0410-b5e6-96231b3b80d8
eaa069075f060f58840af03e0bd5bd75bb27e809 31-May-2012 Anna Zaks <ganna@apple.com> [analyzer]Fix another occurrence of iterator invalidation (LocalTUDecls)

Follow up in r155693, r155680.

Prevents a hard to reproduce crash with the following stack trace:
3 libsystem_c.dylib 0x00007ff55a835050 _sigtramp + 18446744029881443184
4 clang 0x0000000106218e97 (anonymous
+ 519
5 clang 0x0000000105cf3002 clang::ParseAST(clang::Sema&,
bool, bool) + 690
6 clang 0x00000001059a41d8
clang::ASTFrontendAction::ExecuteAction() + 312
7 clang 0x00000001059a3df7 clang::FrontendAction::Execute()
+ 231
8 clang 0x00000001059b0ecc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 860
9 clang 0x000000010595e451
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 961
10 clang 0x0000000105947f29 cc1_main(char const**, char
const**, char const*, void*) + 969
11 clang 0x0000000105958259 main + 473
12 clang 0x0000000105947b34 start + 52

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157721 91177308-0d34-0410-b5e6-96231b3b80d8
c8848f34bbde083b8d89f445eb605eaabf30d6a8 12-May-2012 Anna Zaks <ganna@apple.com> [analyzer] Do not walk the types for call graph construction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156661 91177308-0d34-0410-b5e6-96231b3b80d8
d200187bd27f9ad68699693a6e57f9ee3ff260fa 28-Apr-2012 Jordy Rose <jediknil@belkadan.com> [analyzer] Remove references to idx::TranslationUnit. Index is dead, cross-TU inlining never panned out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155751 91177308-0d34-0410-b5e6-96231b3b80d8
577f14a34457032523e59dbbbacb88ca2cd4db57 27-Apr-2012 Ted Kremenek <kremenek@apple.com> Use a deque instead of an ImmutableList in AnalysisConsumer to preserve the file order that functions are visited. Should fix the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155693 91177308-0d34-0410-b5e6-96231b3b80d8
cb0a5039c243f5b0c178e70f424adac334e5789b 27-Apr-2012 Ted Kremenek <kremenek@apple.com> Change FunctionSummary.h's definition of SetOfDecls to be an ImmutableList instead
of a mutable SmallPtrSet. While iterating over LocalTUDecls, there were cases
where we could modify LocalTUDecls, which could result in invalidating an iterator
and an analyzer crash. Along the way, switch some uses of std::queue to std::dequeue,
which should be slightly more efficient.

Unfortunately, this is a difficult case to create a test case for.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155680 91177308-0d34-0410-b5e6-96231b3b80d8
fa784da5b9039ead42323bfe9ae6d33ab3c5c6b3 24-Apr-2012 Shih-wei Liao <sliao@google.com> Merge with CLANG upstream r155088.


Change-Id: Id80f069ae25e623967b705e9fa11cfd94dd2461c
87e154c09bbb060a0620bc988d7723bee64fb79c 13-Apr-2012 Douglas Gregor <dgregor@apple.com> Remove the unused, unmaintained, incomplete 'Index' library.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154672 91177308-0d34-0410-b5e6-96231b3b80d8
6a86082f3a06a2dcceaaf63f78a0e52d64bcbaa3 13-Apr-2012 Anna Zaks <ganna@apple.com> [analyzer] PCH deserialization optimization.

We should not deserialize unused declarations from the PCH file. Achieve
this by storing the top level declarations during parsing
(HandleTopLevelDecl ASTConsumer callback) and analyzing/building a call
graph only for those.

Tested the patch on a sample ObjC file that uses PCH. With the patch,
the analyzes is 17.5% faster and clang consumes 40% less memory.
Got about 10% overall build/analyzes time decrease on a large Objective
C project.

A bit of CallGraph refactoring/cleanup as well..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154625 91177308-0d34-0410-b5e6-96231b3b80d8
6b77ce8824cf62c2cfb61cf2d801eb3fcfbecffe 05-Apr-2012 Anna Zaks <ganna@apple.com> [analyzer] Move stats calculation out of AnalysisConsumer destructor.
The ASTConsumer does not get deleted with clang --analyze (for
performance reasons), we still want the diagnostics to work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154078 91177308-0d34-0410-b5e6-96231b3b80d8
e62f048960645b79363408fdead53fec2a063c52 03-Apr-2012 Anna Zaks <ganna@apple.com> [analyzer] Record the basic blocks covered by the analyzes run.

Store this info inside the function summary generated for all analyzed
functions. This is useful for coverage stats and can be helpful for
analyzer state space search strategies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153923 91177308-0d34-0410-b5e6-96231b3b80d8
3bbd8cd831788c506f2980293eb3c7e1b3ca2501 30-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Do not inline functions which previously reached max block

This is an optimization for "retry without inlining" option. Here, if we
failed to inline a function due to reaching the basic block max count,
we are going to store this information and not try to inline it
again in the translation unit. This can be viewed as a function summary.

On sqlite, with this optimization, we are 30% faster then before and
cover 10% more basic blocks (partially because the number of times we
reach timeout is decreased by 20%).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153730 91177308-0d34-0410-b5e6-96231b3b80d8
b47dbcbc12430fdf3e5a5b9f59cdec5480e89e75 28-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Enable retry exhausted without inlining by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153591 91177308-0d34-0410-b5e6-96231b3b80d8
5903a373db3d27794c90b25687e0dd6adb0e497d 27-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Add an option to re-analyze a dead-end path without inlining.

The analyzer gives up path exploration under certain conditions. For
example, when the same basic block has been visited more than 4 times.
With inlining turned on, this could lead to decrease in code coverage.
Specifically, if we give up inside the inlined function, the rest of
parent's basic blocks will not get analyzed.

This commit introduces an option to enable re-run along the failed path,
in which we do not inline the last inlined call site. This is done by
enqueueing the node before the processing of the inlined call site
with a special policy encoded in the state. The policy tells us not to
inline the call site along the path.

This lead to ~10% increase in the number of paths analyzed. Even though
we expected a much greater coverage improvement.

The option is turned off by default for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153534 91177308-0d34-0410-b5e6-96231b3b80d8
1f5171edc9fb9b0698a75fa981c29a750b0a6082 27-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Stats: Only count the number of times we run path sensitive

(This method can be called twice on the same function.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153531 91177308-0d34-0410-b5e6-96231b3b80d8
d316862f4fb281ec08a2e45cd3e5580574adb889 24-Mar-2012 Shih-wei Liao <sliao@google.com> Merge branch 'upstream' into sliao_d
b990d039c7e01ad0055dcbd1e13a691813397b96 13-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Change the order in which we analyze the functions under
inlining to be the reverse of their declaration.

This optimizes running time under inlining up to 20% since we do not
re-analyze the utility functions which are usually defined first in the
translation unit if they have already been analyzed while inlined into
the root functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152653 91177308-0d34-0410-b5e6-96231b3b80d8
7fe8dcef71ae56e43fd7df345db2895f84f2d0ca 13-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Use BFS over call graph when analysing functions.

BFS should give slightly better performance. Ex: Suppose, we have two
roots R1 and R2. A callee function C is reachable through both. However,
C is not inlined when analyzing R1 due to inline stack depth limit. With
DFS, C will be analyzed as top level even though it would be analyzed as
inlined through R2. On the other hand, BFS could avoid analyzing C as
top level.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152652 91177308-0d34-0410-b5e6-96231b3b80d8
a2e589e60d147f4f04cee5682b8389b55c410244 13-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Refactor CallGraph to use Recursive AST visitor when
collecting function Decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152651 91177308-0d34-0410-b5e6-96231b3b80d8
aa5609891df937291bf962dd2fc7deb2ceae292f 13-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Use recursive AST visitor to drive simple visitation order in

As a result:
- We now analyze the C++ methods which are defined within the
class body. These were completely skipped before.

- Ensure that AST checkers are called on functions in the
order they are defined in the Translation unit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152650 91177308-0d34-0410-b5e6-96231b3b80d8
98520835eb1aa091429afa06e9f4f7ebe3864d34 13-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Minor: factor out logic for determining if we should skip a

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152649 91177308-0d34-0410-b5e6-96231b3b80d8
b6ee44dd2923fb7dac699c4bbfeded34a8604d3a 13-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Move the check for parser errors out of the loop over Decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152648 91177308-0d34-0410-b5e6-96231b3b80d8
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
3fd5f370a28552976c52e76c3035d79012d78dda 09-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Add support for NoRedundancy inlining mode.

We do not reanalyze a function, which has already been analyzed as an
inlined callee. As per PRELIMINARY testing, this gives over
50% run time reduction on some benchmarks without decreasing of the
number of bugs found.

Turning the mode on by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152440 91177308-0d34-0410-b5e6-96231b3b80d8
d95e0b830ed031f2ea0e15e3679cd51b9bf23a9c 09-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Use call graph to determine order in which functions are

The CallGraph is used when inlining is on, which is the current default.

This alone does not bring any performance improvement. It's a
stepping stone for the upcoming optimization in which we do not
re-analyze a function that has already been analyzed while inlined in
other functions. Using the call graph makes it easier to play with
the order of functions to minimize redundant analyzes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152352 91177308-0d34-0410-b5e6-96231b3b80d8
66253352131e3e7a22b3bfd0e180607aa2bfb988 09-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Rework inlining related command line options.
- Remove -analyzer-inline-call.
- Add -analyzer-ipa=[none|inlining]
- Add -analyzer-inlining-mode to allow experimentation for
different performance tuning methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152351 91177308-0d34-0410-b5e6-96231b3b80d8
91932089c31e1233f0c478b03412e90a65e07ad2 05-Mar-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-20120305


Change-Id: Ib76c138030a701355ce39a6eda1a89a79f401667
d38f79543136ba68cd14b1dab0856474df1fbfd5 05-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Time the execution (per each TU) with -analyzer-stats.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152059 91177308-0d34-0410-b5e6-96231b3b80d8
8235f9c9c8b3d1737d1c6bd57f7ba3f616b92392 02-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Bound the size of the functions being inlined + provide
command line options for inlining tuning.

This adds the option for stack depth bound as well as function size

+ minor doxygenification

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151930 91177308-0d34-0410-b5e6-96231b3b80d8
81fb169f42769e02c7425b23885a261c025fd5e6 27-Feb-2012 Anna Zaks <ganna@apple.com> [analyzer] Add -analyzer-stats, which hooks up LLVM stats tracking.

As in http://llvm.org/docs/ProgrammersManual.html#Statistic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151570 91177308-0d34-0410-b5e6-96231b3b80d8
d7a3e2c5f61cd4893f95b69a424fe4def3aa0f69 07-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line.

This seems to negatively affect compile time onsome ObjC tests
(which use a lot of partial diagnostics I assume). I have to come
up with a way to keep them inline without including Diagnostic.h
everywhere. Now adding a new diagnostic requires a full rebuild
of e.g. the static analyzer which doesn't even use those diagnostics.

This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99.
This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789.
This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7.
This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f.
This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150006 91177308-0d34-0410-b5e6-96231b3b80d8
6f42b62b6194f53bcbc349f5d17388e1936535d7 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import OwningPtr<> into clang namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
fdd15602a42bbe26185978ef1e17019f6d969aa7 04-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove Diagnostic.h include from Preprocessor.h.

- Move the offending methods out of line and fix transitive includers.
- This required changing an enum in the PPCallback API into an unsigned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149782 91177308-0d34-0410-b5e6-96231b3b80d8
561d3abc881033776ece385a01a510e1cbc1fa92 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unnecessary default cases in switches over enums.

This allows -Wswitch-enum to find switches that need updating when these enums are modified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148281 91177308-0d34-0410-b5e6-96231b3b80d8
c5bdc556f6a65c677e0ed73f918c3000ecad33af 07-Jan-2012 Anna Zaks <ganna@apple.com> [analyzer] Fix use-after-free in HandleTranslationUnit.

A patch by Dmitri Gribenko!

The attached patch fixes a use-after-free in AnalysisConsumer::HandleTranslationUnit. The problem is that
BugReporter's destructor runs after AnalysisManager has been already
deleted. The fix introduces a scope to force correct destruction

A crash happens only when reports have been added in AnalysisConsumer::HandleTranslationUnit's BugReporter. We don't have such checkers in clang so no test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147732 91177308-0d34-0410-b5e6-96231b3b80d8
63d32bdf895e1ad8cfeef8e634a84fe136215202 29-Dec-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix cmake build with -DBUILD_SHARED_LIBS=ON.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147338 91177308-0d34-0410-b5e6-96231b3b80d8
579ee4f9f5c7b8f939621c8008337a3c1c679957 24-Oct-2011 Ted Kremenek <kremenek@apple.com> Rename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate, but it frees up the name AnalysisContext for other uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142782 91177308-0d34-0410-b5e6-96231b3b80d8
3bd5a8169e57debade42d5b748ca564ca9a832ba 23-Oct-2011 Ted Kremenek <kremenek@apple.com> [analyzer] Remove LocationContext creation methods from AnalysisManager, and change clients to use AnalysisContext instead.

WIP to remove/reduce ExprEngine's usage of AnalysisManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142739 91177308-0d34-0410-b5e6-96231b3b80d8
1d26f48dc2eea1c07431ca1519d7034a21b9bcff 24-Oct-2011 Ted Kremenek <kremenek@apple.com> Rename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate, but it frees up the name AnalysisContext for other uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142782 91177308-0d34-0410-b5e6-96231b3b80d8
b1b5daf30d2597e066936772bd206500232d7d65 23-Oct-2011 Ted Kremenek <kremenek@apple.com> [analyzer] Remove LocationContext creation methods from AnalysisManager, and change clients to use AnalysisContext instead.

WIP to remove/reduce ExprEngine's usage of AnalysisManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142739 91177308-0d34-0410-b5e6-96231b3b80d8
fe6bd6dc51777802a0118521b9039981a0e6a806 21-Oct-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to upstream Oct 20th 2011 (r142531)

Change-Id: I32cdb5da2c07c84e01f42b4e87161196f468806a
00a92abaf907802bfa4d6f38bdd242c6bfc34c09 21-Oct-2011 Logan Chien <loganchien@google.com> Merge with clang upstream Oct 20th 2011 (r142531)

Change-Id: I42181113f38ce445f2a48694d6f654438562b71e
b8989f27f116ff2400e92a52c067a69846119eb5 14-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.

Passing a pointer was a bad idea as it collides with the overload for void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141971 91177308-0d34-0410-b5e6-96231b3b80d8
a5937bbfd19e61d651a58b0f0ffeef68457902a5 08-Oct-2011 Ted Kremenek <kremenek@apple.com> Remove AnalysisContext::getLiveVariables(), and introduce a templatized mechanism to lazily create analyses that are attached to AnalysisContext objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141425 91177308-0d34-0410-b5e6-96231b3b80d8
d30952838421ddfb9f7e346b2ba8213889a5f789 30-Sep-2011 Anna Zaks <ganna@apple.com> [analyzer] Add -analyzer-purge option which can take on multiple values, remove -analyzer-purge=none. (Small refactor as well: move the work of constructing AnalysisManager from the callers to the class itself.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140838 91177308-0d34-0410-b5e6-96231b3b80d8
f39d962cf84f46d2c0512157259ae1d41a1a5173 27-Sep-2011 David Blaikie <dblaikie@gmail.com> Renaming PathDiagnosticClients.h to PathDiagnosticConsumers.h (issue 5397)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140596 91177308-0d34-0410-b5e6-96231b3b80d8
ef3643fbbbf66247c5e205497fae0f46e240c143 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename PathDiagnosticClient to PathDiagnosticConsumer as per issue 5397

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140492 91177308-0d34-0410-b5e6-96231b3b80d8
d6471f7c1921c7802804ce3ff6fe9768310f72b9 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename Diagnostic to DiagnosticsEngine as per issue 5397

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
e289d81369914678db386f6aa86faf8f178e245d 13-Sep-2011 Douglas Gregor <dgregor@apple.com> Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.

AST serialization changes are next up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139605 91177308-0d34-0410-b5e6-96231b3b80d8
d1fe529b1a17a2422f28f1b938ee70453dc7199d 10-Sep-2011 Anna Zaks <ganna@apple.com> [analyzer] -analyze-function for ObjectiveC should check if any of the methods match the name (not only the first one).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139439 91177308-0d34-0410-b5e6-96231b3b80d8
d1e5a89226da79f7e6f43d40facc46abda9e5245 02-Sep-2011 Jordy Rose <jediknil@belkadan.com> [analyzer] Remove TransferFuncs.h, then deal with the fallout.

And with that, TransferFuncs is gone!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139003 91177308-0d34-0410-b5e6-96231b3b80d8
17a38e2636a8b1ce473fc6504c4b16cb09db29f4 02-Sep-2011 Jordy Rose <jediknil@belkadan.com> [analyzer] Move the knowledge of whether or not GC is enabled for the current analysis from CFRefCount to ExprEngine.

Remove TransferFuncs from ExprEngine and AnalysisConsumer.

Demote RetainReleaseChecker to a regular checker, and give it the name osx.cocoa.RetainCount (class name change coming shortly). Update tests accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138998 91177308-0d34-0410-b5e6-96231b3b80d8
fee618af5dd7dee2caaa7347b372eb3dc5fdeffc 27-Aug-2011 Ted Kremenek <kremenek@apple.com> [analyzer] Pull body of loop in AnalysisConsumer::HandleDeclContext() into its own method. No real functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138712 91177308-0d34-0410-b5e6-96231b3b80d8
b7b0608c3aeee3eb9f14520eb7eff159b855a34b 17-Aug-2011 Jordy Rose <jediknil@belkadan.com> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137814 91177308-0d34-0410-b5e6-96231b3b80d8
a8fd0bc069275d8e7bc9fa72c2d93a76302e5e48 17-Aug-2011 Jordy Rose <jediknil@belkadan.com> [analyzer] Add a warning for an incompatible plugin version.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137813 91177308-0d34-0410-b5e6-96231b3b80d8
6875325b6576ad6fa4fc457f251aaeccb8b3c724 17-Aug-2011 Benjamin Kramer <benny.kra@googlemail.com> Silence compiler warnings by casting object pointers to function pointers via intptr_t.

This is ugly but ISO C++ doesn't allow direct casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137812 91177308-0d34-0410-b5e6-96231b3b80d8
77a33a71701b59affb5337d9e2b57d69bc095c7d 17-Aug-2011 Jordy Rose <jediknil@belkadan.com> [analyzer] Add basic support for pluggable checkers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137802 91177308-0d34-0410-b5e6-96231b3b80d8
08b86531ade68727c56918f162816075b87c864a 16-Aug-2011 Jordy Rose <jediknil@belkadan.com> [analyzer] Overhaul of checker registration in preparation for basic plugin support. Removes support for checker groups (we can add them back in later if we decide they are still useful), and -analyzer-checker-help output is a little worse for the time being (no packages).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137758 91177308-0d34-0410-b5e6-96231b3b80d8
9c378f705405d37f49795d5e915989de774fe11f 13-Aug-2011 Ted Kremenek <kremenek@apple.com> Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137537 91177308-0d34-0410-b5e6-96231b3b80d8
402785357ab053dd53f4fdd858b9630a5e0f8bad 25-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Mechanically rename SourceManager::getInstantiationLoc and
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part
of the API and documentation update from 'instantiation' as the term for
macros to 'expansion'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135914 91177308-0d34-0410-b5e6-96231b3b80d8
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
7dfd96fd5f4e63071f5d4f684e9f0e1928d226c7 20-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131722 at Fri. 20th May 2011.
6e744db7c294f357e7e0af628275331f3a6c1b6b 19-May-2011 Ted Kremenek <kremenek@apple.com> Teach static analyzer to analyze Objective-C methods in category implementations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131614 91177308-0d34-0410-b5e6-96231b3b80d8
d01d2b2de449d68e6c44d99a12c0c1fc53222113 14-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131335 at Sat. 14th May 2011.
9be6e7ce5788e50c62d40c59b0bbc2ea423683f7 05-May-2011 Ted Kremenek <kremenek@apple.com> Add Checker callback for running a checker at the end of processing an entire TranslationUnit. Patch by Lei Zhang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130913 91177308-0d34-0410-b5e6-96231b3b80d8
fc8f0e14ad142ed811e90fbd9a30e419e301c717 15-Apr-2011 Chris Lattner <sabre@nondot.org> fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
f445debe3a6825e6528655db0906ce4fa41240ea 01-Apr-2011 csmon <csmon@csmon-desktop.(none)> Merge branch 'upstream' into logan-fastforward-20110320
9bc1afc3580133c1c930ddba497e6ef541c917be 30-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] For -analyzer-checker-help show all the info about groups, packages, and which packages/checkers are hidden.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128511 91177308-0d34-0410-b5e6-96231b3b80d8
c805eb9bc32fb0e2e767e2c4dcce1541feb4b69d 07-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Add build rules for StaticAnalyzer.
c367a876d0abcf32cb443712ce2709a0491be00b 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove unused checker stuff from AnalysisConsumer and some unused headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126690 91177308-0d34-0410-b5e6-96231b3b80d8
c4d2c9074be6eb2091086eddd6c8f052f3b245c8 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best misnomer award.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126676 91177308-0d34-0410-b5e6-96231b3b80d8
d655ab28fdf7c940d3f79f8f287954d7f76e0977 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Run the ExprEngine depending on the CheckerManager having path-sensitive checkers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126674 91177308-0d34-0410-b5e6-96231b3b80d8
344500e3b78b95e2d911f45a64c5364d346ba799 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] The current UninitializedValuesChecker will go away, remove '-warn-uninit-values'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126673 91177308-0d34-0410-b5e6-96231b3b80d8
b3d74da3e1620c9a7a378afb5f244e4987e6713e 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Migrate NSErrorChecker and DereferenceChecker to CheckerV2.

They cooperate in that NSErrorChecker listens for ImplicitNullDerefEvent events that
DereferenceChecker can dispatch.
ImplicitNullDerefEvent is when we dereferenced a location that may be null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126659 91177308-0d34-0410-b5e6-96231b3b80d8
deb6447d0029bdb122397fafb5fa2a4e76f2e555 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Introduce "event" mechanism in CheckerManager.

A checker can register as receiver/listener of "events" (basically it registers a callback
with a function getting called with an argument of the event type) and other checkers can
register as "dispatchers" and can pass an event object to all the listeners.
This allows cooperation amongst checkers but with very loose coupling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126658 91177308-0d34-0410-b5e6-96231b3b80d8
b742dfde440c8bb0f7e655715e9413fa69f0fefd 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Run AST checkers for ObjCMethodDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126657 91177308-0d34-0410-b5e6-96231b3b80d8
05357018b2e5e66559ad0ce2147dc1db9af42b9d 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Migrate ArrayBoundCheckerV2 to CheckerV2.

Turns -analyzer-check-buffer-overflows into -analyzer-checker=core.experimental.Overflow

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126609 91177308-0d34-0410-b5e6-96231b3b80d8
58f2e7c3c3860e410fa3d8252862ef10be7cdc70 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Turn -analyzer-stats into -analyzer-checker=debug.Stats

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126608 91177308-0d34-0410-b5e6-96231b3b80d8
6dd4dffe1090e820e9b5b25eee8ad3907a1aa679 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove '-analyzer-experimental-checks' flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126607 91177308-0d34-0410-b5e6-96231b3b80d8
116f3640daee424dfcdbe55e80be5a67476be4b0 25-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Intoduce '-analyzer-checker-help' flag which outputs a list of all available static analyzer checkers.

This is pretty basic for now, eventually checkers should be grouped according to package, hidden checkers should be indicated etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126454 91177308-0d34-0410-b5e6-96231b3b80d8
65d39251ff57b8e33cf6d3a7fcc6aa1c6f8cdc68 24-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove '-analyzer-experimental-internal-checks' flag, it doesn't have any checkers associated with it anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126440 91177308-0d34-0410-b5e6-96231b3b80d8
2e471a3e476396be1ddca4ab8b9df721bcfc9437 23-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Add LangOptions in CheckerManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126306 91177308-0d34-0410-b5e6-96231b3b80d8
80f38f0ada19a658ca2b3a6949b8621005aa7b08 20-Feb-2011 Oscar Fuentes <ofv@wanadoo.es> Correct name of dependent target.

CMake complained about this while generating VS project files but was
okay with it while generating makefiles on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126090 91177308-0d34-0410-b5e6-96231b3b80d8
b20f5c6f79968ce57ebb6222f0d2e7f51908d1be 19-Feb-2011 Oscar Fuentes <ofv@wanadoo.es> Fix some add_dependencies.

The syntax is (add_dependencies target-name depend-target1 ...).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126049 91177308-0d34-0410-b5e6-96231b3b80d8
2d67b90a21c9c1093e6598809c2cbc832919cfe6 17-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Use the new registration mechanism for the debugging info "checks".

The relative checker package is 'debug':

'-dump-live-variables' is replaced by '-analyzer-checker=debug.DumpLiveVars'
'-cfg-view' is replaced by '-analyzer-checker=debug.ViewCFG'
'-cfg-dump' is replaced by '-analyzer-checker=debug.DumpCFG'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125780 91177308-0d34-0410-b5e6-96231b3b80d8
7dd445ec20e704846cfbdb132e56539280d71311 17-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Use the new registration mechanism on the non-path-sensitive-checkers:


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125779 91177308-0d34-0410-b5e6-96231b3b80d8
9fb9474c5b267400d4abfbff63c8b39f378235d4 17-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer]
-Introduce CheckerV2, a set of templates for convenient declaration & registration of checkers.
Currently useful just for checkers working on the AST not the path-sensitive ones.
-Enhance CheckerManager to actually collect the checkers and turn it into the entry point for
running the checkers.
-Use the new mechanism for the LLVMConventionsChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125778 91177308-0d34-0410-b5e6-96231b3b80d8
c869abe2a9deeff22f778029a7f7f75e009be03f 17-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> When building StaticAnalyzer/Frontend add -I "<Checkers build dir>" to allow Checkers.inc to be
included without '..', thus being compatible with build systems of *BSDs.

Patch by Joerg Sonnenberger!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125758 91177308-0d34-0410-b5e6-96231b3b80d8
0b1ba6227c67d5e04b589ed8a08afa2345a40666 16-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Use the new registration mechanism on the apple checkers:


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125636 91177308-0d34-0410-b5e6-96231b3b80d8
c9f2e0f286500c7e747849b3aa9c0e67a4dc90d7 15-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Use the new registration mechanism on the IdempotentOperationChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125611 91177308-0d34-0410-b5e6-96231b3b80d8
e9baa6b82625a6e55d21a32ca0227950d30ec57d 15-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove ObjCSelfInitCheck from AnalyzerOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125599 91177308-0d34-0410-b5e6-96231b3b80d8
27af04bcca46f8a3374586be1301477f9123f5e1 15-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix the clang-wpa example.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125565 91177308-0d34-0410-b5e6-96231b3b80d8
027a6abdd6cedc0b8203da72eed6d15c796dce9d 15-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Use the new registration mechanism on some of the internal checks. These are:


The rest have/create implicit dependencies between checkers and need to be handled differently.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125559 91177308-0d34-0410-b5e6-96231b3b80d8
43dee220252ef0b42c5f8a3bb1eca97f84f2565f 14-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Overhauling of the checker registration mechanism.

-Checkers will be defined in the tablegen file 'Checkers.td'.
-Apart from checkers, we can define checker "packages" that will contain a collection of checkers.
-Checkers can be enabled with -analyzer-checker=<name> and disabled with -analyzer-disable-checker=<name> e.g:
Enable checkers from 'cocoa' and 'corefoundation' packages except the self-initialization checker:
-analyzer-checker=cocoa -analyzer-checker=corefoundation -analyzer-disable-checker=cocoa.SelfInit
-Introduces CheckerManager and CheckerProvider. CheckerProviders get the set of checker names to enable/disable and
register them with the CheckerManager which will be the entry point for all checker-related functionality.

Currently only the self-initialization checker takes advantage of the new mechanism.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125503 91177308-0d34-0410-b5e6-96231b3b80d8
5f83d6f36a7308eef21d87104fd70c421e854448 14-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove ManagerRegistry which is not used. In the future we may load analyzer plugins dynamically but
registration through static constructors should be avoided.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125502 91177308-0d34-0410-b5e6-96231b3b80d8
e6348c336fecc8da9288ea367375a1b1cd2358d2 14-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Move include/clang/StaticAnalyzer/AnalysisConsumer.h -> lib/StaticAnalyzer/Frontend/AnalysisConsumer.h since
FrontendActions.cpp is the only user.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125501 91177308-0d34-0410-b5e6-96231b3b80d8
f49a009c18b9c6fd92868600c3195afe4eb97259 14-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Move Checkers/FrontendActions.cpp -> Frontend/FrontendActions.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125500 91177308-0d34-0410-b5e6-96231b3b80d8
e817771c57d0eacbe069a314ba619c43d0ac70ab 14-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Introduce libclangStaticAnalyzerFrontend and move Checkers/AnalysisConsumer.cpp into Frontend lib.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125499 91177308-0d34-0410-b5e6-96231b3b80d8