Commit Graph

325 Commits

Author SHA1 Message Date
Ted Kremenek 219bab3be9 Added "PreprocessorFactory", an interface for lazily creating Preprocessor objects on-demand.
llvm-svn: 49868
2008-04-17 21:23:07 +00:00
Ted Kremenek c2c08caf9c Add support in HTML macro expansion for hovering over a macro and automatically
expanding its definition.  This is a pure CSS solution.

Tested on IE7, Firefox 3b4, and Safari 3.1.

Patch by Cedric Venet!

llvm-svn: 49865
2008-04-17 19:57:27 +00:00
Fariborz Jahanian 8e36cddde0 Added property decl support for protocols.
Added assertion if unexpected property decls are found where they don't belong.
Consolidated property decl. printing by using a helper function.

llvm-svn: 49862
2008-04-17 18:25:18 +00:00
Ted Kremenek a506fec90a Added transfer function support for ReturnStmt to support detecting leaks
involving objects that are returned but have an excessive reference count.

llvm-svn: 49861
2008-04-17 18:12:53 +00:00
Argyrios Kyrtzidis 6d05303342 Use TranslationUnitDecl as DeclContext of builtin functions.
llvm-svn: 49856
2008-04-17 14:47:13 +00:00
Argyrios Kyrtzidis c3b69ae815 Addition of TranslationUnitDecl to the AST:
-Added TranslationUnitDecl class to serve as top declaration context
-ASTContext gets a TUDecl member and a getTranslationUnitDecl() function
-All ScopedDecls get the TUDecl as DeclContext when declared at global scope

llvm-svn: 49855
2008-04-17 14:40:12 +00:00
Argyrios Kyrtzidis fc2f058230 Fix MSVC compiler error: "initialization of 'VD' is skipped by 'case' label"
llvm-svn: 49853
2008-04-17 13:52:22 +00:00
Chris Lattner f1c70d79b8 insert macro expansions into floating divs. For now, they are always displayed,
but we want some javascript or something toggle their display.

llvm-svn: 49836
2008-04-17 00:40:45 +00:00
Chris Lattner 775fdd3618 correctly hilight multi-line macro definitions and other
preprocessor directives.

llvm-svn: 49828
2008-04-16 23:21:17 +00:00
Chris Lattner 10dbbb0c5a Make HighlightRange correctly handle multi-line ranges. This causes us to
correctly handle multi-line comments.

llvm-svn: 49827
2008-04-16 23:06:45 +00:00
Ted Kremenek 9c375158a0 Handle ReturnStmts by dispatching to "EvalReturn" in the transfer function object.
llvm-svn: 49826
2008-04-16 23:05:51 +00:00
Chris Lattner 8e3006a4e3 add a new HighlightRange API, it doesn't handle multiline ranges
yet, but it will soon...

llvm-svn: 49825
2008-04-16 22:45:51 +00:00
Ted Kremenek cbf4c6134e CF ref. count checker: Register memory leaks at the end of a path.
llvm-svn: 49824
2008-04-16 22:32:20 +00:00
Ted Kremenek 86051690ea Bug fix in GREndPathNodeBuilderImpl: Use the specified state to construct
a node, not the state of the predecessor.

llvm-svn: 49823
2008-04-16 22:30:40 +00:00
Fariborz Jahanian 549e83caa0 New AST class for property implementation declarations.
llvm-svn: 49821
2008-04-16 22:00:24 +00:00
Fariborz Jahanian d634dfae0f Fixed a comment.
llvm-svn: 49819
2008-04-16 21:11:25 +00:00
Ted Kremenek c1f9a28e4d Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a block's terminator.
Refactored LiveVariables to use getTerminatorCondition() in VisitTerminator().

Bug fix: CFG now computes Block-level expression numbers using information
from block terminators.  This fixes <rdar://problem/5868189>.

llvm-svn: 49818
2008-04-16 21:10:48 +00:00
Fariborz Jahanian 9d981eb9ae This patch adds support for declaraing properties in categories,
just as they are declared in objc classes.

llvm-svn: 49817
2008-04-16 21:08:45 +00:00
Chris Lattner e9786c3199 reenable highlighting of (the first line of) comments
llvm-svn: 49816
2008-04-16 20:54:51 +00:00
Chris Lattner 0bb0e7ee8a switch from relexing with the preprocessor to do syntax highlighting to relexing
with the Lexer.  This is cheaper and gives us some advantages.  For now we start
highlighting preprocessor directives (which need improvement), and disable 
comments.  Comments to be restored later.

llvm-svn: 49815
2008-04-16 20:51:51 +00:00
Ted Kremenek 7145489c37 Small tweaks to EvalStore: pass an "RVal" instead of "LVal" for the TargetLV to
represent possible stores to "Unknown."

llvm-svn: 49811
2008-04-16 20:40:59 +00:00
Ted Kremenek 673b5c1e42 Add missing file.
llvm-svn: 49805
2008-04-16 18:39:25 +00:00
Ted Kremenek 90c7cb6810 Hook up "EvalStore" from GRTransferFuncs to GRExprEngine.
llvm-svn: 49804
2008-04-16 18:39:06 +00:00
Ted Kremenek 2044a5183d Take first step to migrating handling of "stores" to values from GRExprEngine
to the plug-in GRTransferFuncs object.

llvm-svn: 49801
2008-04-16 18:21:25 +00:00
Ted Kremenek ed30e8da56 LiveVariables now updates the liveness state of block-level expressions that
are referenced by CFGBlock terminators.

llvm-svn: 49798
2008-04-16 17:07:59 +00:00
Ted Kremenek 08e562d3c8 In ExplodedGraphImpl::Trim, prioritize for paths that don't span loops by using
two worklists: for nodes whose locations are block edges with loop terminators
and another for nodes with all other locations.  We only dequeue from the loop
worklist when the other is empty.  Exploration of the graph is still in
reverse-BFS.

llvm-svn: 49791
2008-04-16 15:51:26 +00:00
Chris Lattner 03b8fcc247 Take a stab at highlighting #defines and #includes. This doesn't work yet.
llvm-svn: 49781
2008-04-16 06:53:09 +00:00
Chris Lattner 5e69a2dd9a Syntax highlight keywords. I assume someone else will pick less appaling colors.
llvm-svn: 49780
2008-04-16 06:35:07 +00:00
Chris Lattner a5a75e7a10 split syntax highlighting of macros from keywords and comments,
allowing us to use a cheaper means to highlight keywords and making
it so that comments won't foul up macro expansions.

Start highlighting macro expansions.

llvm-svn: 49779
2008-04-16 06:32:08 +00:00
Chris Lattner 060d8aa2ed Add a mode of hackily syntax highlighting comments. This has a number of
problems, including the fact that it doesn't work well with multi-line 
comments due to Ted's crazy table.  However, that could be fixed, and it
does work with single-line ones :).

llvm-svn: 49778
2008-04-16 06:11:58 +00:00
Chris Lattner c326f7e860 Switch AddLineNumbers to hack on a rewritebuffer instead of on a
rewriter, getting sourcelocations out of the picture.

llvm-svn: 49775
2008-04-16 04:37:29 +00:00
Chris Lattner e7d696ec7f In html::EscapeText, instead of going through the rewriter with
a SourceLocation to get a RewriteBuffer, poke the RewriteBuffer
with an offset directly.  THis is no faster, but results in 
cleaner code.

llvm-svn: 49774
2008-04-16 04:33:23 +00:00
Ted Kremenek b65a67d7b6 Remove uses of "Selector&" and "const Selector&", since Selector is just an
immutable smart pointer (we don't need to pass references, just pass Selector).

llvm-svn: 49773
2008-04-16 04:30:16 +00:00
Ted Kremenek 8cb96e92a1 Implemented toll-free bridging support for CF Reference count checker.
llvm-svn: 49771
2008-04-16 04:28:53 +00:00
Chris Lattner 05e5310ad8 switch AddLineNumber to use a SmallString instead of sstream. This
speeds up -emit-html on ted's testcase by 29% (.138 -> 0.107s) in a
release build.

llvm-svn: 49767
2008-04-16 04:11:35 +00:00
Ted Kremenek e556f9e39c Simplify some code.
llvm-svn: 49763
2008-04-16 02:59:55 +00:00
Ted Kremenek 748c7ce4ba Added initial boilerplate to support toll-free bridging in the ref-count checker.
llvm-svn: 49756
2008-04-15 23:44:31 +00:00
Ted Kremenek 667cacb2ff Added some comments to GRExprEngine. Reorder some of the method definitions
to start logically organizing them.

Added initial plug-in transfer function support for Objective-C message expressions.

llvm-svn: 49752
2008-04-15 23:06:53 +00:00
Ted Kremenek 6204498aad Change "VisitBlockVarDecl" to "VisitVarDecl". UninitializedValues now works
as before r49748 (where BlockVarDecl was removed).

llvm-svn: 49749
2008-04-15 23:02:18 +00:00
Steve Naroff 08899ff85d Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().
This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).

llvm-svn: 49748
2008-04-15 22:42:06 +00:00
Ted Kremenek 7d6219f501 For HTML diagnostics, output more information about a bug report.
llvm-svn: 49742
2008-04-15 21:25:08 +00:00
Ted Kremenek 82ff6d65bc Fix bug in terminator processing for uninitialized-values: simply ignore the terminator, don't reprocess it.
LiveVariables analysis now does a flow-insensitive analysis to determine what variables have their address taken; these variables are now always treated as being live.

The DataflowSolver now uses "SetTopValue()" when getting the initial value for the entry/exit block.

llvm-svn: 49734
2008-04-15 18:35:30 +00:00
Argyrios Kyrtzidis 45887902b6 Fix a compiler error on MSVC (variable name 'E' clash).
llvm-svn: 49727
2008-04-15 16:30:10 +00:00
Chris Lattner 3e142b2585 finish commenting RewriteRope
llvm-svn: 49712
2008-04-15 06:37:11 +00:00
Ted Kremenek 6d41b82ea4 Improve dead store diagnostic.
llvm-svn: 49711
2008-04-15 05:31:00 +00:00
Ted Kremenek 8adeebb274 Added initial support into the flow-sensitive dataflow solver to visit the Block-level expression
in a block's terminator.  This expression is visited within a block, but it is accessed by the
terminator.  This is important to observe because for live-variables analysis the block-level
expression is live between the terminator and where the expression occurs in the block.  So far
this hasn't been an issue to not observe this because the block-level expression used in the
terminator is always the last one in the block, and we have never queried the liveness information
about this point (but before the terminator).

llvm-svn: 49709
2008-04-15 04:39:08 +00:00
Ted Kremenek 66279073f7 Bug fix in dead stores: don't always check the liveness of the first decl
in a DeclStmt.

llvm-svn: 49708
2008-04-15 04:11:48 +00:00
Ted Kremenek cd76f95dd0 ++/-- makes a variable live since it is used; thus the liveness state is
"Alive" as opposed to staying the same.

llvm-svn: 49707
2008-04-15 04:08:54 +00:00
Ted Kremenek f4212bdbc3 Bug fix in LiveVariables: Operators ++/-- may kill a value, but the variable
is still live.

llvm-svn: 49705
2008-04-15 03:47:30 +00:00
Chris Lattner 52bc4ac84f Fix a corner case that ted hit in -emit-html, rdar://5863212
llvm-svn: 49703
2008-04-15 02:26:21 +00:00