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

16 years agoTest commit: fix a typo
Douglas Gregor [Sun, 13 Apr 2008 19:35:01 +0000 (19:35 +0000)]
Test commit: fix a typo

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

16 years agoThis patch is just the easy part of the class names patch, which
Chris Lattner [Sun, 13 Apr 2008 18:59:07 +0000 (18:59 +0000)]
This patch is just the easy part of the class names patch, which
allows the parsing of "class" in addition to "struct" and "union" to
declare a record.  So this patch allows:

 class C { };
 class C c1;

But it does not contain the lookup bits, so this won't work yet:

 C c2;

Patch by Doug Gregor!

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

16 years agoChange the btree algorithm to split nodes bottom-up instead of top-down.
Chris Lattner [Sun, 13 Apr 2008 08:52:45 +0000 (08:52 +0000)]
Change the btree algorithm to split nodes bottom-up instead of top-down.
This results in an (IMO) simpler algorithm, results in fewer splits, and
is more amenable to delta handling (there is no reason to mutate the tree
at all when adding a delta to a position that already exists in the tree).

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

16 years agosplit node splitting from interior node restructuring.
Chris Lattner [Sun, 13 Apr 2008 08:22:30 +0000 (08:22 +0000)]
split node splitting from interior node restructuring.

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

16 years agoupdate to follow mainline llvm API change.
Chris Lattner [Sun, 13 Apr 2008 07:32:11 +0000 (07:32 +0000)]
update to follow mainline llvm API change.

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

16 years agoUse static_cast<> instead of cast<> in Decl::Destroy(). Suggestion by Argiris
Sam Bishop [Sun, 13 Apr 2008 04:32:18 +0000 (04:32 +0000)]
Use static_cast<> instead of cast<> in Decl::Destroy().  Suggestion by Argiris
Kirtzidis!

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

16 years agoDefault argument cleanups and minor improvements, patch by
Chris Lattner [Sat, 12 Apr 2008 23:52:44 +0000 (23:52 +0000)]
Default argument cleanups and minor improvements, patch by
Doug Gregor!

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

16 years agofinal cleanup, the code is now in a reviewable state.
Chris Lattner [Sat, 12 Apr 2008 22:04:18 +0000 (22:04 +0000)]
final cleanup, the code is now in a reviewable state.

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

16 years agomove the DeltaTree implementation out of line, remove debugging printfs etc.
Chris Lattner [Sat, 12 Apr 2008 22:00:40 +0000 (22:00 +0000)]
move the DeltaTree implementation out of line, remove debugging printfs etc.

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

16 years agoremove ifdefs
Chris Lattner [Sat, 12 Apr 2008 20:34:05 +0000 (20:34 +0000)]
remove ifdefs

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

16 years agoDo an initial hack at replacing one of the incredibly inefficient
Chris Lattner [Sat, 12 Apr 2008 20:28:24 +0000 (20:28 +0000)]
Do an initial hack at replacing one of the incredibly inefficient
(but simple!) datastructures in the rewriter with a more complex but
more efficient one.

This replaces the Deltas vector with a specialized BTree that makes
delta lookups much more efficient.  This speeds up -emit-html on a 500K
.i file from 157.154 to 27.127 seconds on my machine (5.8x).

While this code is functional, it isn't very pretty, I have much
refactoring planned for it, and will remove the USE_VECTOR ifdef.
Stay tuned.

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

16 years agoUse std::list's push_back instead of resize to add an element.
Argyrios Kyrtzidis [Sat, 12 Apr 2008 12:38:58 +0000 (12:38 +0000)]
Use std::list's push_back instead of resize to add an element.

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

16 years agodon't diagnose empty source files, thanks Neil!
Chris Lattner [Sat, 12 Apr 2008 05:54:25 +0000 (05:54 +0000)]
don't diagnose empty source files, thanks Neil!

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

16 years agoFixed comments.
Argyrios Kyrtzidis [Sat, 12 Apr 2008 01:50:47 +0000 (01:50 +0000)]
Fixed comments.
Moved IdDeclInfo class to anonymous namespace.
Replaced array with a std::vector.

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

16 years agoAdded PushOnScopeChains method to Sema, that adds a decl to both the IdResolver and...
Argyrios Kyrtzidis [Sat, 12 Apr 2008 00:47:19 +0000 (00:47 +0000)]
Added PushOnScopeChains method to Sema, that adds a decl to both the IdResolver and the Scope.

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

16 years agoAST generation for objc2's property declarations.
Fariborz Jahanian [Fri, 11 Apr 2008 23:40:25 +0000 (23:40 +0000)]
AST generation for objc2's property declarations.

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

16 years agoAdd some boilerplate to report memory leaks at the end of an analyzed function.
Ted Kremenek [Fri, 11 Apr 2008 22:25:11 +0000 (22:25 +0000)]
Add some boilerplate to report memory leaks at the end of an analyzed function.
Still need some boilerplate in BugReporter to report bugs at the end
of a function (not associated with a particular statement).

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

16 years agoAdded "EvalEndPath" to GRTransferFuncs: the default implementation does not
Ted Kremenek [Fri, 11 Apr 2008 22:07:59 +0000 (22:07 +0000)]
Added "EvalEndPath" to GRTransferFuncs: the default implementation does not
change the state (and thus the GREndPathNodeBuilder automatically contructs a
node).

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

16 years agoAdded "GREndPathNodeBuilder", a new node builder that will be used for
Ted Kremenek [Fri, 11 Apr 2008 22:03:04 +0000 (22:03 +0000)]
Added "GREndPathNodeBuilder", a new node builder that will be used for
evaluating transfer functions at the end-of-path.

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

16 years agoAdded FIXME
Ted Kremenek [Fri, 11 Apr 2008 20:51:02 +0000 (20:51 +0000)]
Added FIXME

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

16 years agoFix regression introduced by my last commit.
Ted Kremenek [Fri, 11 Apr 2008 20:23:24 +0000 (20:23 +0000)]
Fix regression introduced by my last commit.

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

16 years agoChanged behavior of how we handle "NULL" summaries: just call
Ted Kremenek [Fri, 11 Apr 2008 20:11:19 +0000 (20:11 +0000)]
Changed behavior of how we handle "NULL" summaries: just call
GRSimpleVals::EvalCal(), and don't change reference counts.

Remove "getDoNothingSummary()", as a NULL summary does the same thing.

Added temporary hack for the "Get" rule for objects that return a pointer type:
treat them as non-owned CF objects.

Added test case to detect the release of a non-owned object.

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

16 years agoAdd class and super class location info to ObjCInterfaceDecl...
Steve Naroff [Fri, 11 Apr 2008 19:35:35 +0000 (19:35 +0000)]
Add class and super class location info to ObjCInterfaceDecl...

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

16 years agoUse RangedBugReport to report better ranges for reference count errors.
Ted Kremenek [Fri, 11 Apr 2008 18:40:51 +0000 (18:40 +0000)]
Use RangedBugReport to report better ranges for reference count errors.

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

16 years agoAdded "RangedBugReport".
Ted Kremenek [Fri, 11 Apr 2008 18:40:29 +0000 (18:40 +0000)]
Added "RangedBugReport".

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

16 years agoUpdate Xcode project with missing files.
Ted Kremenek [Fri, 11 Apr 2008 18:30:21 +0000 (18:30 +0000)]
Update Xcode project with missing files.

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

16 years agoInvoke destructors in Decl::Destroy().
Sam Bishop [Fri, 11 Apr 2008 18:04:39 +0000 (18:04 +0000)]
Invoke destructors in Decl::Destroy().

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

16 years agoMinor changes per Chris L's review.
Fariborz Jahanian [Fri, 11 Apr 2008 16:55:42 +0000 (16:55 +0000)]
Minor changes per Chris L's review.

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

16 years agodon't read off the front of the buffer. Thanks to Sam for pointing this out.
Chris Lattner [Fri, 11 Apr 2008 16:20:41 +0000 (16:20 +0000)]
don't read off the front of the buffer.  Thanks to Sam for pointing this out.

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