]> granicus.if.org Git - clang/log
clang
16 years agoInitial work for property implementation declarations.
Fariborz Jahanian [Fri, 18 Apr 2008 00:19:30 +0000 (00:19 +0000)]
Initial work for property implementation declarations.
Mostly semantic checking in this patch. This is on going
and incomplete.

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

16 years agoUpdate VC++ project files.
Steve Naroff [Thu, 17 Apr 2008 23:51:38 +0000 (23:51 +0000)]
Update VC++ project files.

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

16 years agoModified BugReport::getEndPath() to handle the case where end path is at
Ted Kremenek [Thu, 17 Apr 2008 23:44:37 +0000 (23:44 +0000)]
Modified BugReport::getEndPath() to handle the case where end path is at
the exit block of the CFG.

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

16 years agoHook up reporting reference count memory leaks to the BugReporter mechanism.
Ted Kremenek [Thu, 17 Apr 2008 23:43:50 +0000 (23:43 +0000)]
Hook up reporting reference count memory leaks to the BugReporter mechanism.

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

16 years agoFix a problem noticed by Nuno, where we wouldn't escape characters in
Chris Lattner [Thu, 17 Apr 2008 23:03:14 +0000 (23:03 +0000)]
Fix a problem noticed by Nuno, where we wouldn't escape characters in
macro expansions.

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

16 years agoclass Preprocessor: Now owns the "predefines" char*; it deletes [] it in its dstor.
Ted Kremenek [Thu, 17 Apr 2008 22:31:54 +0000 (22:31 +0000)]
class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its dstor.

clang.cpp: InitializePreprocessor now makes a copy of the contents of PredefinesBuffer and
  passes it to the preprocessor object.

clang.cpp: DriverPreprocessorFactory now calls "InitializePreprocessor" instead of this being done in main().

html::HighlightMacros() now takes a PreprocessorFactory, allowing it to conjure up a new
Preprocessor to highlight macros.

class HTMLDiagnostics now takes a PreprocessorFactory* that it can use for html::HighlightMacros().
Updated clients of HTMLDiagnostics to use this new interface.

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

16 years agoHandle text escaping (e.g. & -> &) last, to avoid interactions between 'replace...
Chris Lattner [Thu, 17 Apr 2008 22:24:51 +0000 (22:24 +0000)]
Handle text escaping (e.g. & -> &) last, to avoid interactions between 'replace' operations and insert operations.  This fixes a problem with "&;&" on line 666 of the gcc.c example I sent out.

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

16 years agoGenerate the Preprocessor using a local PreprocessorFactory object.
Ted Kremenek [Thu, 17 Apr 2008 21:38:34 +0000 (21:38 +0000)]
Generate the Preprocessor using a local PreprocessorFactory object.
While this adds no extra functionality now, we will soon pass the
PreprocessorFactory object to some ASTConsumers.

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

16 years agodon't give macros a background
Chris Lattner [Thu, 17 Apr 2008 21:32:46 +0000 (21:32 +0000)]
don't give macros a background

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

16 years agoMake sure popup is on top over other spans. wrap long line.
Chris Lattner [Thu, 17 Apr 2008 21:28:41 +0000 (21:28 +0000)]
Make sure popup is on top over other spans.  wrap long line.

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

16 years agoAdded "PreprocessorFactory", an interface for lazily creating Preprocessor objects...
Ted Kremenek [Thu, 17 Apr 2008 21:23:07 +0000 (21:23 +0000)]
Added "PreprocessorFactory", an interface for lazily creating Preprocessor objects on-demand.

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

16 years agoAdd support in HTML macro expansion for hovering over a macro and automatically
Ted Kremenek [Thu, 17 Apr 2008 19:57:27 +0000 (19:57 +0000)]
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!

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

16 years agoTemporarily disable macro expansion in the HTML output of HTMLDiagnostics to
Ted Kremenek [Thu, 17 Apr 2008 18:39:57 +0000 (18:39 +0000)]
Temporarily disable macro expansion in the HTML output of HTMLDiagnostics to
avoid corrupting Preprocessor state.  Working on a fix.

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

16 years agoHAve HTMLDiagnostics use html::HighlightRange to highlight message ranges.
Ted Kremenek [Thu, 17 Apr 2008 18:37:23 +0000 (18:37 +0000)]
HAve HTMLDiagnostics use html::HighlightRange to highlight message ranges.

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

16 years agoAdded property decl support for protocols.
Fariborz Jahanian [Thu, 17 Apr 2008 18:25:18 +0000 (18:25 +0000)]
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.

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

16 years agoAdded transfer function support for ReturnStmt to support detecting leaks
Ted Kremenek [Thu, 17 Apr 2008 18:12:53 +0000 (18:12 +0000)]
Added transfer function support for ReturnStmt to support detecting leaks
involving objects that are returned but have an excessive reference count.

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

16 years agoAllow redirecting text diagnostic printer output to any llvm::OStream, rather
Nate Begeman [Thu, 17 Apr 2008 18:06:57 +0000 (18:06 +0000)]
Allow redirecting text diagnostic printer output to any llvm::OStream, rather
than hard coding llvm::cerr.

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

16 years agoUse TranslationUnitDecl as DeclContext of builtin functions.
Argyrios Kyrtzidis [Thu, 17 Apr 2008 14:47:13 +0000 (14:47 +0000)]
Use TranslationUnitDecl as DeclContext of builtin functions.

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

16 years agoAddition of TranslationUnitDecl to the AST:
Argyrios Kyrtzidis [Thu, 17 Apr 2008 14:40:12 +0000 (14:40 +0000)]
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

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

16 years agoFix MSVC compiler error: "initialization of 'VD' is skipped by 'case' label"
Argyrios Kyrtzidis [Thu, 17 Apr 2008 13:52:22 +0000 (13:52 +0000)]
Fix MSVC compiler error: "initialization of 'VD' is skipped by 'case' label"

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

16 years agoinsert macro expansions into floating divs. For now, they are always displayed,
Chris Lattner [Thu, 17 Apr 2008 00:40:45 +0000 (00:40 +0000)]
insert macro expansions into floating divs.  For now, they are always displayed,
but we want some javascript or something toggle their display.

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

16 years agocorrectly hilight multi-line macro definitions and other
Chris Lattner [Wed, 16 Apr 2008 23:21:17 +0000 (23:21 +0000)]
correctly hilight multi-line macro definitions and other
preprocessor directives.

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

16 years agoMake HighlightRange correctly handle multi-line ranges. This causes us to
Chris Lattner [Wed, 16 Apr 2008 23:06:45 +0000 (23:06 +0000)]
Make HighlightRange correctly handle multi-line ranges.  This causes us to
correctly handle multi-line comments.

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

16 years agoHandle ReturnStmts by dispatching to "EvalReturn" in the transfer function object.
Ted Kremenek [Wed, 16 Apr 2008 23:05:51 +0000 (23:05 +0000)]
Handle ReturnStmts by dispatching to "EvalReturn" in the transfer function object.

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

16 years agoadd a new HighlightRange API, it doesn't handle multiline ranges
Chris Lattner [Wed, 16 Apr 2008 22:45:51 +0000 (22:45 +0000)]
add a new HighlightRange API, it doesn't handle multiline ranges
yet, but it will soon...

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

16 years agoCF ref. count checker: Register memory leaks at the end of a path.
Ted Kremenek [Wed, 16 Apr 2008 22:32:20 +0000 (22:32 +0000)]
CF ref. count checker: Register memory leaks at the end of a path.

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

16 years agoBug fix in GREndPathNodeBuilderImpl: Use the specified state to construct
Ted Kremenek [Wed, 16 Apr 2008 22:30:40 +0000 (22:30 +0000)]
Bug fix in GREndPathNodeBuilderImpl: Use the specified state to construct
a node, not the state of the predecessor.

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

16 years agoNew AST class for property implementation declarations.
Fariborz Jahanian [Wed, 16 Apr 2008 22:00:24 +0000 (22:00 +0000)]
New AST class for property implementation declarations.

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

16 years agoFixed a comment.
Fariborz Jahanian [Wed, 16 Apr 2008 21:11:25 +0000 (21:11 +0000)]
Fixed a comment.

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

16 years agoAdded CFGBlock::getTerminatorCondition() to get the Expr* of the condition a block...
Ted Kremenek [Wed, 16 Apr 2008 21:10:48 +0000 (21:10 +0000)]
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>.

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

16 years agoThis patch adds support for declaraing properties in categories,
Fariborz Jahanian [Wed, 16 Apr 2008 21:08:45 +0000 (21:08 +0000)]
This patch adds support for declaraing properties in categories,
just as they are declared in objc classes.

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

16 years agoreenable highlighting of (the first line of) comments
Chris Lattner [Wed, 16 Apr 2008 20:54:51 +0000 (20:54 +0000)]
reenable highlighting of (the first line of) comments

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

16 years agoswitch from relexing with the preprocessor to do syntax highlighting to relexing
Chris Lattner [Wed, 16 Apr 2008 20:51:51 +0000 (20:51 +0000)]
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.

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

16 years agoAdd extra test cases to test "escaping" for the reference count checker.
Ted Kremenek [Wed, 16 Apr 2008 20:41:27 +0000 (20:41 +0000)]
Add extra test cases to test "escaping" for the reference count checker.

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

16 years agoSmall tweaks to EvalStore: pass an "RVal" instead of "LVal" for the TargetLV to
Ted Kremenek [Wed, 16 Apr 2008 20:40:59 +0000 (20:40 +0000)]
Small tweaks to EvalStore: pass an "RVal" instead of "LVal" for the TargetLV to
represent possible stores to "Unknown."

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

16 years agoUpdate XCode project (added GRTransferFuncs.cpp).
Ted Kremenek [Wed, 16 Apr 2008 18:39:47 +0000 (18:39 +0000)]
Update XCode project (added GRTransferFuncs.cpp).

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

16 years agoAdd missing file.
Ted Kremenek [Wed, 16 Apr 2008 18:39:25 +0000 (18:39 +0000)]
Add missing file.

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

16 years agoHook up "EvalStore" from GRTransferFuncs to GRExprEngine.
Ted Kremenek [Wed, 16 Apr 2008 18:39:06 +0000 (18:39 +0000)]
Hook up "EvalStore" from GRTransferFuncs to GRExprEngine.

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

16 years agoTake first step to migrating handling of "stores" to values from GRExprEngine
Ted Kremenek [Wed, 16 Apr 2008 18:21:25 +0000 (18:21 +0000)]
Take first step to migrating handling of "stores" to values from GRExprEngine
to the plug-in GRTransferFuncs object.

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

16 years agoLiveVariables now updates the liveness state of block-level expressions that
Ted Kremenek [Wed, 16 Apr 2008 17:07:59 +0000 (17:07 +0000)]
LiveVariables now updates the liveness state of block-level expressions that
are referenced by CFGBlock terminators.

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

16 years agoAdded fixme.
Ted Kremenek [Wed, 16 Apr 2008 16:53:18 +0000 (16:53 +0000)]
Added fixme.

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

16 years agoHook up HTMLDiagnostics to use Chris's new syntax highlighting. --html-diags
Ted Kremenek [Wed, 16 Apr 2008 16:39:56 +0000 (16:39 +0000)]
Hook up HTMLDiagnostics to use Chris's new syntax highlighting.  --html-diags
currently doesn't pass in the Preprocessor from the driver, so we don't get
syntax highlighting when we create HTMLDiagnostics in that way.

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

16 years agoIn ExplodedGraphImpl::Trim, prioritize for paths that don't span loops by using
Ted Kremenek [Wed, 16 Apr 2008 15:51:26 +0000 (15:51 +0000)]
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.

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

16 years agoTake a stab at highlighting #defines and #includes. This doesn't work yet.
Chris Lattner [Wed, 16 Apr 2008 06:53:09 +0000 (06:53 +0000)]
Take a stab at highlighting #defines and #includes.  This doesn't work yet.

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

16 years agoSyntax highlight keywords. I assume someone else will pick less appaling colors.
Chris Lattner [Wed, 16 Apr 2008 06:35:07 +0000 (06:35 +0000)]
Syntax highlight keywords.  I assume someone else will pick less appaling colors.

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

16 years agosplit syntax highlighting of macros from keywords and comments,
Chris Lattner [Wed, 16 Apr 2008 06:32:08 +0000 (06:32 +0000)]
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.

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

16 years agoAdd a mode of hackily syntax highlighting comments. This has a number of
Chris Lattner [Wed, 16 Apr 2008 06:11:58 +0000 (06:11 +0000)]
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 :).

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

16 years agoAdd -o support for -emit-html, make it not produce a file on an error.
Chris Lattner [Wed, 16 Apr 2008 05:21:09 +0000 (05:21 +0000)]
Add -o support for -emit-html, make it not produce a file on an error.

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

16 years agoRemove "--html-test" driver option and its corresponding code; all of this
Ted Kremenek [Wed, 16 Apr 2008 04:38:45 +0000 (04:38 +0000)]
Remove "--html-test" driver option and its corresponding code; all of this
functionality has been migrated into "--emit-html" and "--html-diags".

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

16 years agoSwitch AddLineNumbers to hack on a rewritebuffer instead of on a
Chris Lattner [Wed, 16 Apr 2008 04:37:29 +0000 (04:37 +0000)]
Switch AddLineNumbers to hack on a rewritebuffer instead of on a
rewriter, getting sourcelocations out of the picture.

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

16 years agoIn html::EscapeText, instead of going through the rewriter with
Chris Lattner [Wed, 16 Apr 2008 04:33:23 +0000 (04:33 +0000)]
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.

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

16 years agoRemove uses of "Selector&" and "const Selector&", since Selector is just an
Ted Kremenek [Wed, 16 Apr 2008 04:30:16 +0000 (04:30 +0000)]
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).

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

16 years agoUpdate CF reference count checker test case to illustrate the use of
Ted Kremenek [Wed, 16 Apr 2008 04:29:21 +0000 (04:29 +0000)]
Update CF reference count checker test case to illustrate the use of
toll-free bridging.

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

16 years agoImplemented toll-free bridging support for CF Reference count checker.
Ted Kremenek [Wed, 16 Apr 2008 04:28:53 +0000 (04:28 +0000)]
Implemented toll-free bridging support for CF Reference count checker.

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

16 years agomake a method public.
Chris Lattner [Wed, 16 Apr 2008 04:28:52 +0000 (04:28 +0000)]
make a method public.

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

16 years agoswitch AddLineNumber to use a SmallString instead of sstream. This
Chris Lattner [Wed, 16 Apr 2008 04:11:35 +0000 (04:11 +0000)]
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.

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

16 years agospeed up -emit-html in a release build by 6.5% by avoiding std::string.
Chris Lattner [Wed, 16 Apr 2008 03:46:57 +0000 (03:46 +0000)]
speed up -emit-html in a release build by 6.5% by avoiding std::string.

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

16 years agoSimplify some code.
Ted Kremenek [Wed, 16 Apr 2008 02:59:55 +0000 (02:59 +0000)]
Simplify some code.

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

16 years agoAdded initial boilerplate to support toll-free bridging in the ref-count checker.
Ted Kremenek [Tue, 15 Apr 2008 23:44:31 +0000 (23:44 +0000)]
Added initial boilerplate to support toll-free bridging in the ref-count checker.

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

16 years agoAdded some comments to GRExprEngine. Reorder some of the method definitions
Ted Kremenek [Tue, 15 Apr 2008 23:06:53 +0000 (23:06 +0000)]
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.

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

16 years agoRevert my previous patch.
Ted Kremenek [Tue, 15 Apr 2008 23:06:05 +0000 (23:06 +0000)]
Revert my previous patch.

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

16 years agoRemove dispatch to "VisitParmVarDecl".
Ted Kremenek [Tue, 15 Apr 2008 23:03:58 +0000 (23:03 +0000)]
Remove dispatch to "VisitParmVarDecl".

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

16 years agoChange "VisitBlockVarDecl" to "VisitVarDecl". UninitializedValues now works
Ted Kremenek [Tue, 15 Apr 2008 23:02:18 +0000 (23:02 +0000)]
Change "VisitBlockVarDecl" to "VisitVarDecl".  UninitializedValues now works
as before r49748 (where BlockVarDecl was removed).

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

16 years agoRemove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl...
Steve Naroff [Tue, 15 Apr 2008 22:42:06 +0000 (22:42 +0000)]
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).

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

16 years agoFor HTML diagnostics, output more information about a bug report.
Ted Kremenek [Tue, 15 Apr 2008 21:25:08 +0000 (21:25 +0000)]
For HTML diagnostics, output more information about a bug report.

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

16 years agoAdded "summary table" to generated index.html page that allows one to
Ted Kremenek [Tue, 15 Apr 2008 20:47:02 +0000 (20:47 +0000)]
Added "summary table" to generated index.html page that allows one to
toggle which bug reports are displayed in the report table.

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

16 years agoAdded test case illustrating the use of '&'.
Ted Kremenek [Tue, 15 Apr 2008 18:37:29 +0000 (18:37 +0000)]
Added test case illustrating the use of '&'.

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

16 years agoFix bug in terminator processing for uninitialized-values: simply ignore the terminat...
Ted Kremenek [Tue, 15 Apr 2008 18:35:30 +0000 (18:35 +0000)]
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.

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

16 years agoFix a compiler error on MSVC (variable name 'E' clash).
Argyrios Kyrtzidis [Tue, 15 Apr 2008 16:30:10 +0000 (16:30 +0000)]
Fix a compiler error on MSVC (variable name 'E' clash).

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

16 years agofinish commenting RewriteRope
Chris Lattner [Tue, 15 Apr 2008 06:37:11 +0000 (06:37 +0000)]
finish commenting RewriteRope

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

16 years agoImprove dead store diagnostic.
Ted Kremenek [Tue, 15 Apr 2008 05:31:00 +0000 (05:31 +0000)]
Improve dead store diagnostic.

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

16 years agoBug fix in VisitChildren: Only visit the last statement in a StmtExpr and the RHS...
Ted Kremenek [Tue, 15 Apr 2008 05:11:28 +0000 (05:11 +0000)]
Bug fix in VisitChildren: Only visit the last statement in a StmtExpr and the RHS of a comma expression, as the other Stmts will be visited elsewhere in a CFGBlock.

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

16 years agoAdded initial support into the flow-sensitive dataflow solver to visit the Block...
Ted Kremenek [Tue, 15 Apr 2008 04:39:08 +0000 (04:39 +0000)]
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).

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

16 years agoBug fix in dead stores: don't always check the liveness of the first decl
Ted Kremenek [Tue, 15 Apr 2008 04:11:48 +0000 (04:11 +0000)]
Bug fix in dead stores: don't always check the liveness of the first decl
in a DeclStmt.

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

16 years ago++/-- makes a variable live since it is used; thus the liveness state is
Ted Kremenek [Tue, 15 Apr 2008 04:08:54 +0000 (04:08 +0000)]
++/-- makes a variable live since it is used; thus the liveness state is
"Alive" as opposed to staying the same.

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

16 years agoHandle "__private_extern__" storage class when printing FunctionDecls.
Ted Kremenek [Tue, 15 Apr 2008 03:57:09 +0000 (03:57 +0000)]
Handle "__private_extern__" storage class when printing FunctionDecls.

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

16 years agoBug fix in LiveVariables: Operators ++/-- may kill a value, but the variable
Ted Kremenek [Tue, 15 Apr 2008 03:47:30 +0000 (03:47 +0000)]
Bug fix in LiveVariables: Operators ++/-- may kill a value, but the variable
is still live.

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

16 years agoFix a corner case that ted hit in -emit-html, rdar://5863212
Chris Lattner [Tue, 15 Apr 2008 02:26:21 +0000 (02:26 +0000)]
Fix a corner case that ted hit in -emit-html, rdar://5863212

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

16 years agoNew AST representation for each objc2's property declaration.
Fariborz Jahanian [Mon, 14 Apr 2008 23:36:35 +0000 (23:36 +0000)]
New AST representation for each objc2's property declaration.

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

16 years agoRemove bogus token...
Steve Naroff [Mon, 14 Apr 2008 22:53:48 +0000 (22:53 +0000)]
Remove bogus token...

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

16 years agosimplify the implementation of the insert/split operation to return
Chris Lattner [Mon, 14 Apr 2008 22:10:58 +0000 (22:10 +0000)]
simplify the implementation of the insert/split operation to return
the new RHS directly instead of indirecting through the 'InsertResult'
struct.  This eliminates InsertResult.

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

16 years agoRename a file and update the Xcode project.
Steve Naroff [Mon, 14 Apr 2008 22:05:54 +0000 (22:05 +0000)]
Rename a file and update the Xcode project.

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

16 years agoRename RewriteTest->RewriteObjC.
Steve Naroff [Mon, 14 Apr 2008 22:03:09 +0000 (22:03 +0000)]
Rename RewriteTest->RewriteObjC.

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

16 years agoAdd a bunch of comments, move RewriteRope::MakeRopeString out of line.
Chris Lattner [Mon, 14 Apr 2008 21:41:00 +0000 (21:41 +0000)]
Add a bunch of comments, move RewriteRope::MakeRopeString out of line.

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

16 years agoFix comment.
Steve Naroff [Mon, 14 Apr 2008 21:39:16 +0000 (21:39 +0000)]
Fix comment.

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

16 years agoUse isFromMainFile instead of comparing FileIDs directly.
Ted Kremenek [Mon, 14 Apr 2008 21:24:13 +0000 (21:24 +0000)]
Use isFromMainFile instead of comparing FileIDs directly.

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

16 years agoFix regression in Diagnostic that caused it to not register the number
Ted Kremenek [Mon, 14 Apr 2008 21:21:38 +0000 (21:21 +0000)]
Fix regression in Diagnostic that caused it to not register the number
of errors.

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

16 years agoUse SourceManager::isFromMainFile()
Ted Kremenek [Mon, 14 Apr 2008 21:14:41 +0000 (21:14 +0000)]
Use SourceManager::isFromMainFile()

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

16 years agoConvert over to new SourceManager::isFromMainFile() instead of doing direct
Ted Kremenek [Mon, 14 Apr 2008 21:14:03 +0000 (21:14 +0000)]
Convert over to new SourceManager::isFromMainFile() instead of doing direct
FileID comparison (fixes insidious corner case with chunks).

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

16 years agoHTMLDiagnostics now uses the new "getCanonicalID()", "isFromMainFileID()" methods...
Ted Kremenek [Mon, 14 Apr 2008 21:06:04 +0000 (21:06 +0000)]
HTMLDiagnostics now uses the new "getCanonicalID()", "isFromMainFileID()" methods from
SourceManager when doing HTML pretty-printing.  This resolves an insidious bug when
presenting error reports that only occurred in large source files.

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

16 years agoAdded "getCanonicalID()", "isFromSameFile", and "isFromMainFile" to compare
Ted Kremenek [Mon, 14 Apr 2008 21:04:18 +0000 (21:04 +0000)]
Added "getCanonicalID()", "isFromSameFile", and "isFromMainFile" to compare
the files of different SourceLocations.  These methods correctly handle the
case where a file may have multiple FileIDs due to it being large enough
to be spread across several chunks.

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

16 years agofix more uninit ivars, who wrote this junk? :)
Chris Lattner [Mon, 14 Apr 2008 20:07:03 +0000 (20:07 +0000)]
fix more uninit ivars, who wrote this junk? :)

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

16 years agoFix an assertion ted was hitting, due to an uninitialized variable.
Chris Lattner [Mon, 14 Apr 2008 20:05:32 +0000 (20:05 +0000)]
Fix an assertion ted was hitting, due to an uninitialized variable.

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

16 years agoOnly increment the number of diagnostics when the DiagnosticClient used
Ted Kremenek [Mon, 14 Apr 2008 19:56:12 +0000 (19:56 +0000)]
Only increment the number of diagnostics when the DiagnosticClient used
is the one attached to the Diagnostic object.

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

16 years agoAdded driver option "-checker-opt-analyze-headers" to force the static
Ted Kremenek [Mon, 14 Apr 2008 18:40:58 +0000 (18:40 +0000)]
Added driver option "-checker-opt-analyze-headers" to force the static
analyzer to analyze functions declared in header files.

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

16 years agoDon't flag dead stores that occur in macros.
Ted Kremenek [Mon, 14 Apr 2008 18:28:25 +0000 (18:28 +0000)]
Don't flag dead stores that occur in macros.

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

16 years agoHave BugReporter::EmitWarning use the PathDiagnosticClient if it is available.
Ted Kremenek [Mon, 14 Apr 2008 18:06:42 +0000 (18:06 +0000)]
Have BugReporter::EmitWarning use the PathDiagnosticClient if it is available.

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

16 years agomove a ton of code out of line, from RewriteRope.h -> RewriteRope.cpp
Chris Lattner [Mon, 14 Apr 2008 17:54:23 +0000 (17:54 +0000)]
move a ton of code out of line, from RewriteRope.h -> RewriteRope.cpp

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

16 years agoBug fix in dead-store checker when walking the Decls in a DeclStmt: don't
Ted Kremenek [Mon, 14 Apr 2008 17:52:13 +0000 (17:52 +0000)]
Bug fix in dead-store checker when walking the Decls in a DeclStmt: don't
assume that DeclStmts only have VarDecls; they can have TypedefDecls.

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

16 years agoTreat calls to unresolved functions in the CF-ref count checker as calls
Ted Kremenek [Mon, 14 Apr 2008 17:45:13 +0000 (17:45 +0000)]
Treat calls to unresolved functions in the CF-ref count checker as calls
to functions with NULL summaries.

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