]> granicus.if.org Git - clang/log
clang
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

16 years agoUpdated test cases so that they do not emit warnings for dead stores.
Ted Kremenek [Mon, 14 Apr 2008 17:40:10 +0000 (17:40 +0000)]
Updated test cases so that they do not emit warnings for dead stores.

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

16 years agoHooked up the dead-store checker to the BugReporter interface. Now dead-store
Ted Kremenek [Mon, 14 Apr 2008 17:39:48 +0000 (17:39 +0000)]
Hooked up the dead-store checker to the BugReporter interface.  Now dead-store
warnings are emitted as part of the warnings registered by GRSimpleVals.

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

16 years agoAdded version of "getClient()" for class Diagnostic that returns a non-const
Ted Kremenek [Mon, 14 Apr 2008 17:37:31 +0000 (17:37 +0000)]
Added version of "getClient()" for class Diagnostic that returns a non-const
reference to the DiagnosticClient.  This is useful for DiagnosticClients
that have internal state when processing diagnostics.

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

16 years agoremove ifdefs
Chris Lattner [Mon, 14 Apr 2008 17:12:49 +0000 (17:12 +0000)]
remove ifdefs

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

16 years agoAdded test case to dead stores checker.
Ted Kremenek [Mon, 14 Apr 2008 15:56:17 +0000 (15:56 +0000)]
Added test case to dead stores checker.

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

16 years agoHandle -D and -U options in order, so that they can cancel each other out when
Sam Bishop [Mon, 14 Apr 2008 14:41:57 +0000 (14:41 +0000)]
Handle -D and -U options in order, so that they can cancel each other out when
intermixed.

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

16 years agoChange the RewriteRope::Chunks data structure from an std::list into
Chris Lattner [Mon, 14 Apr 2008 07:17:29 +0000 (07:17 +0000)]
Change the RewriteRope::Chunks data structure from an std::list into
a nice shiny B+ Tree variant.  This fixes the last of the known algorithmic
issues with the rewriter, allowing a significant speedup.  For example,
-emit-html on Ted's 500K .i file speeds up from 26.8s -> 0.64s in a
debug build (41x!) and 5.475s -> 0.132s (41x!) in an optimized build.

This code is functional but needs to be cleaned up, ifdefs removed, better
commented, and moved to a .cpp file.  I plan to do this tomorrow.

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

16 years agoEnable clang to codegen emmintrin.h until we have our own emmintrin.h
Nate Begeman [Mon, 14 Apr 2008 04:49:57 +0000 (04:49 +0000)]
Enable clang to codegen emmintrin.h until we have our own emmintrin.h

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

16 years agoFix typo
Nate Begeman [Mon, 14 Apr 2008 02:26:39 +0000 (02:26 +0000)]
Fix typo

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

16 years agoArgiris Kirtzidis's fix for handling empty IdDeclInfo's in IdentifierResolver::AddDecl
Douglas Gregor [Mon, 14 Apr 2008 00:26:07 +0000 (00:26 +0000)]
Argiris Kirtzidis's fix for handling empty IdDeclInfo's in IdentifierResolver::AddDecl

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

16 years agoMake Parser::getAccessSpecifierIfPresent const, since it does not modify the state
Douglas Gregor [Mon, 14 Apr 2008 00:13:42 +0000 (00:13 +0000)]
Make Parser::getAccessSpecifierIfPresent const, since it does not modify the state

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

16 years agoMove IdDeclInfoMap class in an anonymous namespace. Suggestion by Chris Lattner.
Argyrios Kyrtzidis [Mon, 14 Apr 2008 00:09:21 +0000 (00:09 +0000)]
Move IdDeclInfoMap class in an anonymous namespace. Suggestion by Chris Lattner.

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

16 years agoThis patch adds very basic support for parsing and type-checking class
Douglas Gregor [Sun, 13 Apr 2008 21:30:24 +0000 (21:30 +0000)]
This patch adds very basic support for parsing and type-checking class
inheritance in C++. It'll parse the base-specifier list, e.g.,

 class D : public B1, virtual public B2 { };

and do some of the simpler semantic checks (B1 and B2 are classes;
they aren't unions or incomplete types, etc).

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

16 years agoIntroduce support for finding class and enum names via ordinary name lookup in C++
Douglas Gregor [Sun, 13 Apr 2008 21:07:44 +0000 (21:07 +0000)]
Introduce support for finding class and enum names via ordinary name lookup in C++

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

16 years agoFix PR2220, making diagnostics for unexpected tokens in pp expressions
Chris Lattner [Sun, 13 Apr 2008 20:38:43 +0000 (20:38 +0000)]
Fix PR2220, making diagnostics for unexpected tokens in pp expressions
more nice.

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

16 years agothis started failing because a GEP was constant folded,
Chris Lattner [Sun, 13 Apr 2008 19:54:28 +0000 (19:54 +0000)]
this started failing because a GEP was constant folded,
improve the robustness of the test.

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