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

16 years agoStub out and start using a Decl::Destroy() method.
Sam Bishop [Fri, 11 Apr 2008 15:01:25 +0000 (15:01 +0000)]
Stub out and start using a Decl::Destroy() method.

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

16 years agoUse the ASTContext allocator when creating deserialized Decl objects.
Sam Bishop [Fri, 11 Apr 2008 14:49:10 +0000 (14:49 +0000)]
Use the ASTContext allocator when creating deserialized Decl objects.

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

16 years agotwo new files for previous patch, by Argiris Kirtzidis
Chris Lattner [Fri, 11 Apr 2008 07:06:57 +0000 (07:06 +0000)]
two new files for previous patch, by Argiris Kirtzidis

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

16 years agoSwitch sema to maintaining its own scope chain information for variable
Chris Lattner [Fri, 11 Apr 2008 07:00:53 +0000 (07:00 +0000)]
Switch sema to maintaining its own scope chain information for variable
shadowing, instead of threading it through the AST.  This patch contributed
by Argiris Kirtzidis!

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

16 years agoFix rdar://5843510 don't assert and die when an invalid output
Chris Lattner [Fri, 11 Apr 2008 06:14:11 +0000 (06:14 +0000)]
Fix rdar://5843510 don't assert and die when an invalid output
file is specified, print a happy little error message.

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

16 years agoFixed some logic errors in the CF ref count checker; we now can detect simple
Ted Kremenek [Thu, 10 Apr 2008 23:44:06 +0000 (23:44 +0000)]
Fixed some logic errors in the CF ref count checker; we now can detect simple
use-after-release errors.  Added test case.

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

16 years agoPatch for:
Fariborz Jahanian [Thu, 10 Apr 2008 23:32:45 +0000 (23:32 +0000)]
Patch for:
1) objc ivar processing is split out of ActOnField into its own ActOnIvar method.
2) the new objc ivar action takes visibility info directly, eliminating
  AllVisibilities in ParseObjCClassInstanceVariables.

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

16 years agoSimplify CF ref. count checker state machine.
Ted Kremenek [Thu, 10 Apr 2008 23:09:18 +0000 (23:09 +0000)]
Simplify CF ref. count checker state machine.

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

16 years agoFix some bonehead bugs in summary generation in CFRefCount.
Ted Kremenek [Thu, 10 Apr 2008 22:58:08 +0000 (22:58 +0000)]
Fix some bonehead bugs in summary generation in CFRefCount.

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

16 years agoUsed --checker-simple.
Ted Kremenek [Thu, 10 Apr 2008 22:17:23 +0000 (22:17 +0000)]
Used --checker-simple.

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

16 years agoRefactored all logic to run the GRSimpleVals and CFRef checker into a common
Ted Kremenek [Thu, 10 Apr 2008 22:16:52 +0000 (22:16 +0000)]
Refactored all logic to run the GRSimpleVals and CFRef checker into a common
code path in the clang driver.

Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref.

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

16 years agoreduce the amount of 'C++ magic' this code depends on :)
Chris Lattner [Thu, 10 Apr 2008 16:37:40 +0000 (16:37 +0000)]
reduce the amount of 'C++ magic' this code depends on :)

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

16 years agoCFRefCount analysis now properly calls "EmitWarnings" after analyzing a function.
Ted Kremenek [Thu, 10 Apr 2008 16:21:09 +0000 (16:21 +0000)]
CFRefCount analysis now properly calls "EmitWarnings" after analyzing a function.

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

16 years agoWhen not emitting path diagnostics in BugReporter::EmitWarning(), use the
Ted Kremenek [Thu, 10 Apr 2008 16:12:38 +0000 (16:12 +0000)]
When not emitting path diagnostics in BugReporter::EmitWarning(), use the
BugReport-specific SourceRanges (when available).

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

16 years agoFixed regressions in error reporting due to copy-paste errors (using the "begin"
Ted Kremenek [Thu, 10 Apr 2008 16:05:13 +0000 (16:05 +0000)]
Fixed regressions in error reporting due to copy-paste errors (using the "begin"
iterator instead of "end") and not implementing "getDescription()" for Nil
argument checks.

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

16 years agorefactor Parser::ParseStructDeclaration to return a vector of uninterpreted
Chris Lattner [Thu, 10 Apr 2008 06:46:29 +0000 (06:46 +0000)]
refactor Parser::ParseStructDeclaration to return a vector of uninterpreted
declarators.  This allows the clients (C structs, objc classes, objc
properties, [future] C++ classes) etc, to do custom processing before invoking
an action.

This has two benefits in the short term:
1) objc ivar processing should be split out of ActOnField into its own ActOn method.
2) the new objc ivar action can take visibility info directly, eliminating
   AllVisibilities in ParseObjCClassInstanceVariables.
3) objc properties can pass their own special sauce down to sema as well.

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

16 years agoSimplify lifetime of location object.
Chris Lattner [Thu, 10 Apr 2008 06:15:14 +0000 (06:15 +0000)]
Simplify lifetime of location object.

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

16 years agoFix typo.
Eric Christopher [Thu, 10 Apr 2008 05:23:15 +0000 (05:23 +0000)]
Fix typo.

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

16 years ago typedef void T;
Chris Lattner [Thu, 10 Apr 2008 02:26:16 +0000 (02:26 +0000)]
 typedef void T;
 void f(T);

is only invalid in C++ mode, not C89 mode.

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

16 years agoSeveral improvements from Doug Gregor related to default
Chris Lattner [Thu, 10 Apr 2008 02:22:51 +0000 (02:22 +0000)]
Several improvements from Doug Gregor related to default
argument handling.  I'll fix up the c89 (void) thing next.

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

16 years agoHooked up initial reference-count checks to the BugReporter interface.
Ted Kremenek [Wed, 9 Apr 2008 23:49:11 +0000 (23:49 +0000)]
Hooked up initial reference-count checks to the BugReporter interface.

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

16 years agoMajor refactoring/cleanup of GRExprEngine, ExplodedGraph, and BugReporter.
Ted Kremenek [Wed, 9 Apr 2008 21:41:14 +0000 (21:41 +0000)]
Major refactoring/cleanup of GRExprEngine, ExplodedGraph, and BugReporter.

Bugs are now reported using a combination of "BugType" (previously
BugDescription) and Bug "BugReport" objects, which are fed to BugReporter (which
generates PathDiagnostics). This provides a far more modular way of registering
bug types and plugging in diagnostics.

GRExprEngine now owns its copy of GRCoreEngine, and is not owned by the
ExplodedGraph.

ExplodedGraph is no longer templated on the "checker", but instead on the state
contained in the nodes.

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

16 years agoThe dtor CGObjCRuntime::~CGObjCRuntime() was implemented twice, once
Ted Kremenek [Wed, 9 Apr 2008 15:51:31 +0000 (15:51 +0000)]
The dtor CGObjCRuntime::~CGObjCRuntime() was implemented twice, once
in CGObjCGNU.cpp and once in CGObjCEtoile.cpp.  Moved its definition to
CGObjC.cpp.  This resolves a build error in Xcode, and also cleans things up.

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

16 years agoAdd SemaDeclCXX.cpp to Xcode project.
Ted Kremenek [Wed, 9 Apr 2008 15:50:11 +0000 (15:50 +0000)]
Add SemaDeclCXX.cpp to Xcode project.

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

16 years agoMicro-optimization: Don't use ostringstream when using a C-string literal
Ted Kremenek [Wed, 9 Apr 2008 15:40:40 +0000 (15:40 +0000)]
Micro-optimization: Don't use ostringstream when using a C-string literal
will work just fine.

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

16 years agoAdded some boilerplate for emitting warnings from the CF-reference count checker.
Ted Kremenek [Wed, 9 Apr 2008 01:10:13 +0000 (01:10 +0000)]
Added some boilerplate for emitting warnings from the CF-reference count checker.

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

16 years agoAdded new "BugReporterHelper" class which is used by BugReporter to emit
Ted Kremenek [Wed, 9 Apr 2008 00:20:43 +0000 (00:20 +0000)]
Added new "BugReporterHelper" class which is used by BugReporter to emit
checker-specific diagnostics.

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

16 years agoFor -emit-html, use the Rewriter to expand tabs.
Ted Kremenek [Tue, 8 Apr 2008 23:25:54 +0000 (23:25 +0000)]
For -emit-html, use the Rewriter to expand tabs.

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

16 years agoDon't expand tabs in EscapeText, but rather expand them when writing out
Ted Kremenek [Tue, 8 Apr 2008 22:37:58 +0000 (22:37 +0000)]
Don't expand tabs in EscapeText, but rather expand them when writing out
the HTML file.  This should reduce the amount of memory pressure on the
rewriter for files that have a lot of tabs.

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

16 years agoAdd HTMLRewrite.h to Xcode project.
Ted Kremenek [Tue, 8 Apr 2008 22:31:28 +0000 (22:31 +0000)]
Add HTMLRewrite.h to Xcode project.

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

16 years agoWhen substituting tabs during HTMLification, only add "&nbsp;" when we are
Ted Kremenek [Tue, 8 Apr 2008 22:28:15 +0000 (22:28 +0000)]
When substituting tabs during HTMLification, only add "&nbsp;" when we are
"escaping" spaces.

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

16 years agoImprove range highlighting in HTMLDiagnostic to correctly highlight ranges
Ted Kremenek [Tue, 8 Apr 2008 21:29:14 +0000 (21:29 +0000)]
Improve range highlighting in HTMLDiagnostic to correctly highlight ranges
that span multiple lines by inserting multiple "</span>" and "<span>" tags.

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

16 years agoMake SourceManager::getFullFilePos() public.
Ted Kremenek [Tue, 8 Apr 2008 21:26:35 +0000 (21:26 +0000)]
Make SourceManager::getFullFilePos() public.

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

16 years agoChanged the Decl::Kind enum of the ObjCPropertyDecl class, so that it follows
Sam Bishop [Tue, 8 Apr 2008 20:49:25 +0000 (20:49 +0000)]
Changed the Decl::Kind enum of the ObjCPropertyDecl class, so that it follows
the pattern of the other Decl classes.

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

16 years agoSet the location of ccc-analyzer to be the same directory as where scan-build
Ted Kremenek [Tue, 8 Apr 2008 20:22:12 +0000 (20:22 +0000)]
Set the location of ccc-analyzer to be the same directory as where scan-build
is located.

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

16 years agosilence some warnings when assertions are disabled.
Chris Lattner [Tue, 8 Apr 2008 05:52:18 +0000 (05:52 +0000)]
silence some warnings when assertions are disabled.

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

16 years agoAdd support for C++ default arguments, and rework Parse-Sema
Chris Lattner [Tue, 8 Apr 2008 05:04:30 +0000 (05:04 +0000)]
Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!

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

16 years agoAdd support for C++ default arguments, and rework Parse-Sema
Chris Lattner [Tue, 8 Apr 2008 04:40:51 +0000 (04:40 +0000)]
Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!

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

16 years agoFix rdar://5846705: "clang -E foo.c -o foo.i" should remove foo.i on error.
Chris Lattner [Tue, 8 Apr 2008 04:16:20 +0000 (04:16 +0000)]
Fix rdar://5846705: "clang -E foo.c -o foo.i" should remove foo.i on error.

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

16 years agoAdd ids for line numbers, allowing us to jump to arbitrary line numbers within
Ted Kremenek [Mon, 7 Apr 2008 23:53:30 +0000 (23:53 +0000)]
Add ids for line numbers, allowing us to jump to arbitrary line numbers within
an HTMLified source file.

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

16 years agoLeft-justify text in report table.
Ted Kremenek [Mon, 7 Apr 2008 23:50:07 +0000 (23:50 +0000)]
Left-justify text in report table.

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

16 years agoTweak message bubble color (gold)
Ted Kremenek [Mon, 7 Apr 2008 23:43:44 +0000 (23:43 +0000)]
Tweak message bubble color (gold)

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

16 years agoImprove BugReport diagnostics for loops and ? operator.
Ted Kremenek [Mon, 7 Apr 2008 23:35:17 +0000 (23:35 +0000)]
Improve BugReport diagnostics for loops and ? operator.

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

16 years agoFix analyzer breakage introduced by r49213: http://llvm.org/viewvc/llvm-project?rev...
Ted Kremenek [Mon, 7 Apr 2008 23:27:54 +0000 (23:27 +0000)]
Fix analyzer breakage introduced by r49213: http://llvm.org/viewvc/llvm-project?rev=49213&view=rev

The problem is that some clients of gcc lookout at the stdout output of gcc;
this requires that all the analyzer diagnostics go to stderr to avoid polluting
stdout.

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

16 years agoPass the ASTContext object around when deserializing Decl and Stmt objects, so
Sam Bishop [Mon, 7 Apr 2008 21:55:54 +0000 (21:55 +0000)]
Pass the ASTContext object around when deserializing Decl and Stmt objects, so
they can be created using the same allocator as in the "from source code" case.

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

16 years agoHave Parser::FuzzyParseMicrosoftAsmStatement() return the null statement (';').
Steve Naroff [Mon, 7 Apr 2008 21:06:54 +0000 (21:06 +0000)]
Have Parser::FuzzyParseMicrosoftAsmStatement() return the null statement (';').

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

16 years agorandom whitespace fixes.
Chris Lattner [Mon, 7 Apr 2008 07:01:58 +0000 (07:01 +0000)]
random whitespace fixes.

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

16 years agofix a bug I introduced in my previous checkin.
Chris Lattner [Mon, 7 Apr 2008 06:58:21 +0000 (06:58 +0000)]
fix a bug I introduced in my previous checkin.

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

16 years agosimplify array compatibility testing.
Chris Lattner [Mon, 7 Apr 2008 06:56:55 +0000 (06:56 +0000)]
simplify array compatibility testing.

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

16 years agosimplify reference handling.
Chris Lattner [Mon, 7 Apr 2008 06:52:53 +0000 (06:52 +0000)]
simplify reference handling.

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

16 years agomove some code around, no other change.
Chris Lattner [Mon, 7 Apr 2008 06:51:04 +0000 (06:51 +0000)]
move some code around, no other change.

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

16 years agosimplify compatibility testing for tag types.
Chris Lattner [Mon, 7 Apr 2008 06:49:41 +0000 (06:49 +0000)]
simplify compatibility testing for tag types.

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

16 years agomerge compatibility testing of qualified/unqualified interfaces together
Chris Lattner [Mon, 7 Apr 2008 06:38:24 +0000 (06:38 +0000)]
merge compatibility testing of qualified/unqualified interfaces together
and fix a bug.

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

16 years agoFix a really bad bug where type uniquing would merge a<x> with b<x> as the same
Chris Lattner [Mon, 7 Apr 2008 06:37:47 +0000 (06:37 +0000)]
Fix a really bad bug where type uniquing would merge a<x> with b<x> as the same
type, because it did not include a/b in the hash.

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

16 years agoMyOtherClass<MyProtocol>* is compatible with MyClass*
Chris Lattner [Mon, 7 Apr 2008 06:06:56 +0000 (06:06 +0000)]
MyOtherClass<MyProtocol>* is compatible with MyClass*
if MyClass is a superclass of MyOtherClass, there is no need for
an exact interface match.

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