]> granicus.if.org Git - clang/log
clang
17 years agointroduce a new NamedDecl class, switch a couple of things over to using it.
Chris Lattner [Sat, 6 Oct 2007 22:53:46 +0000 (22:53 +0000)]
introduce a new NamedDecl class, switch a couple of things over to using it.
NamedDecl is a Decl that has an IdentifierInfo (for example, ScopedDecl),
but not ObjcMethodDecl.

Simplify some code in ActOnAddMethodsToObjcDecl, by doing the cast from
DeclTy to Decl at the start of the method.

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

17 years agoEvery decl has a SourceLocation, move the location info into the Decl class instead...
Chris Lattner [Sat, 6 Oct 2007 22:16:01 +0000 (22:16 +0000)]
Every decl has a SourceLocation, move the location info into the Decl class instead of being in subclasses.

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

17 years agofuture notes & minor changes
Kevin [Sat, 6 Oct 2007 21:28:47 +0000 (21:28 +0000)]
future notes & minor changes

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

17 years agosimplify the interface to create ObjcClassDecl's.
Chris Lattner [Sat, 6 Oct 2007 20:08:36 +0000 (20:08 +0000)]
simplify the interface to create ObjcClassDecl's.

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

17 years agosimplify the interface for creating ObjcForwardProtocolDecl
Chris Lattner [Sat, 6 Oct 2007 20:05:59 +0000 (20:05 +0000)]
simplify the interface for creating ObjcForwardProtocolDecl

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

17 years agoadd a missing ;
Chris Lattner [Sat, 6 Oct 2007 19:08:22 +0000 (19:08 +0000)]
add a missing ;

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

17 years agostub out some printing of objc decls.
Chris Lattner [Sat, 6 Oct 2007 18:52:10 +0000 (18:52 +0000)]
stub out some printing of objc decls.

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

17 years agospeed up clang startup another 28% by avoiding std::vector<std::string>
Chris Lattner [Sat, 6 Oct 2007 06:57:34 +0000 (06:57 +0000)]
speed up clang startup another 28% by avoiding std::vector<std::string>
for holding builtin target-specific macros.

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

17 years agospeed up clang startup time by about 23% by avoiding lots of
Chris Lattner [Sat, 6 Oct 2007 06:29:41 +0000 (06:29 +0000)]
speed up clang startup time by about 23% by avoiding lots of
stringmap operations when there are no secondary targets.

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

17 years agofix grammaro
Chris Lattner [Sat, 6 Oct 2007 05:48:57 +0000 (05:48 +0000)]
fix grammaro

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

17 years agoedits
Chris Lattner [Sat, 6 Oct 2007 05:42:47 +0000 (05:42 +0000)]
edits

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

17 years agofix accidental commit
Chris Lattner [Sat, 6 Oct 2007 05:38:32 +0000 (05:38 +0000)]
fix accidental commit

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

17 years agoedits
Chris Lattner [Sat, 6 Oct 2007 05:30:19 +0000 (05:30 +0000)]
edits

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

17 years agovarious minor edits, e.g. & -> &amp;
Chris Lattner [Sat, 6 Oct 2007 05:23:00 +0000 (05:23 +0000)]
various minor edits, e.g. & -> &amp;

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

17 years agoNew directory.
Kevin [Sat, 6 Oct 2007 05:15:30 +0000 (05:15 +0000)]
New directory.

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

17 years agoadd a warning.
Chris Lattner [Sat, 6 Oct 2007 05:13:47 +0000 (05:13 +0000)]
add a warning.

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

17 years agominor edits
Chris Lattner [Sat, 6 Oct 2007 05:09:04 +0000 (05:09 +0000)]
minor edits

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

17 years agoFix spacing issues.
Bill Wendling [Sat, 6 Oct 2007 01:56:01 +0000 (01:56 +0000)]
Fix spacing issues.

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

17 years agoJust say "No" to non-ASCII things.
Bill Wendling [Sat, 6 Oct 2007 01:53:09 +0000 (01:53 +0000)]
Just say "No" to non-ASCII things.

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

17 years agoRemove non-ASCII '
Bill Wendling [Sat, 6 Oct 2007 01:44:57 +0000 (01:44 +0000)]
Remove non-ASCII '

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

17 years ago1. May fix encoding issues: server uses UTF; HTML file assumes Western (ISO 8859-1).
Kevin [Sat, 6 Oct 2007 01:28:23 +0000 (01:28 +0000)]
1. May fix encoding issues: server uses UTF; HTML file assumes Western (ISO 8859-1).
2. Added strict doctype.

Closing out tags like <br/> and <meta.../> may still be a problem (necessary for XHTML, but wrong for HTML)....

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

17 years agoModifications to XCode project:
Ted Kremenek [Fri, 5 Oct 2007 23:32:54 +0000 (23:32 +0000)]
Modifications to XCode project:
- Added include/Analysis/ExprDeclBitVector.h
- Added include/Analysis/ProgramEdge.h
- Removed include/Analysis/Visitors/DataflowStmtVisitor.h

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

17 years agoRemoved DataflowStmtVisitor. It is no longer used, and is obsoleted
Ted Kremenek [Fri, 5 Oct 2007 23:27:24 +0000 (23:27 +0000)]
Removed DataflowStmtVisitor.  It is no longer used, and is obsoleted
by newer visitor interfaces.

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

17 years agoA message on the main page about bulding clang.
Kevin [Fri, 5 Oct 2007 21:44:03 +0000 (21:44 +0000)]
A message on the main page about bulding clang.

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

17 years agonew site -- the rest of it
Kevin [Fri, 5 Oct 2007 21:18:52 +0000 (21:18 +0000)]
new site -- the rest of it

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

17 years agonew site
Kevin [Fri, 5 Oct 2007 21:17:52 +0000 (21:17 +0000)]
new site

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

17 years agoThis is the first patch toward supporting protocol conforming
Fariborz Jahanian [Fri, 5 Oct 2007 21:01:53 +0000 (21:01 +0000)]
This is the first patch toward supporting protocol conforming
objective-c types. It also removes use of Scope* parameter in
getObjCProtocolDecl.

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

17 years agoSupport case statement ranges.
Devang Patel [Fri, 5 Oct 2007 20:54:07 +0000 (20:54 +0000)]
Support case statement ranges.

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

17 years agoPer request... about to make changes to the website.
Kevin [Fri, 5 Oct 2007 20:31:57 +0000 (20:31 +0000)]
Per request... about to make changes to the website.

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

17 years agoImplement DenseMapInfo for Selector, allowing use of DenseMap/DenseSet of
Chris Lattner [Fri, 5 Oct 2007 20:15:24 +0000 (20:15 +0000)]
Implement DenseMapInfo for Selector, allowing use of DenseMap/DenseSet of
Selector's instead of requiring void* to be used.  I converted one use of
DenseSet<void*> over to use DenseSet<Selector> but the others should change
as well.

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

17 years agoLayering refinements for selectors (suggested by Chris). Specifics...
Steve Naroff [Fri, 5 Oct 2007 18:42:47 +0000 (18:42 +0000)]
Layering refinements for selectors (suggested by Chris). Specifics...

- Add SelectorTable, which enables us to remove MultiKeywordSelector from the public header.
- Remove FoldingSet from IdentifierInfo.h and Preprocessor.h.
- Remove Parser::ObjcGetUnarySelector and Parser::ObjcGetKeywordSelector, they are subsumed by SelectorTable.
- Add MultiKeywordSelector to IdentifierInfo.cpp.
- Move a bunch of selector related methods from ParseObjC.cpp to IdentifierInfo.cpp.
- Added some comments.

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

17 years agoPatch for 1) Checking for duplicate methods decls in intterface and category.
Fariborz Jahanian [Fri, 5 Oct 2007 18:00:57 +0000 (18:00 +0000)]
Patch for 1) Checking for duplicate methods decls in intterface and category.
2) Use of the new DenseSet<t> abstractions instead of DenseMap<t,char>.

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

17 years agoswitch statement code gen.
Devang Patel [Thu, 4 Oct 2007 23:45:31 +0000 (23:45 +0000)]
switch statement code gen.

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

17 years agothis patch accomodates clattner's comments on expression processing in @try-statement.
Fariborz Jahanian [Thu, 4 Oct 2007 20:19:06 +0000 (20:19 +0000)]
this patch accomodates clattner's comments on expression processing in @try-statement.

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

17 years agoMore tab removal activity.
Fariborz Jahanian [Thu, 4 Oct 2007 17:06:28 +0000 (17:06 +0000)]
More tab removal activity.

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

17 years agominor cleanups, make code more defensive, less branchy in Selector ctor.
Chris Lattner [Thu, 4 Oct 2007 05:21:22 +0000 (05:21 +0000)]
minor cleanups, make code more defensive, less branchy in Selector ctor.

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

17 years agofix an incorrect assertion
Chris Lattner [Thu, 4 Oct 2007 05:16:42 +0000 (05:16 +0000)]
fix an incorrect assertion

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

17 years agoFixed tabs in couple of sources.
Fariborz Jahanian [Thu, 4 Oct 2007 00:45:27 +0000 (00:45 +0000)]
Fixed tabs in couple of sources.

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

17 years agoFixed all my recent test cases to have the RUN command and
Fariborz Jahanian [Thu, 4 Oct 2007 00:22:33 +0000 (00:22 +0000)]
Fixed all my recent test cases to have the RUN command and
fixed consequence of these changes in clang.

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

17 years agominor cleanup
Chris Lattner [Wed, 3 Oct 2007 22:03:06 +0000 (22:03 +0000)]
minor cleanup

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

17 years agomove DeclObjc.h down to be alphabetically organized
Chris Lattner [Wed, 3 Oct 2007 21:56:39 +0000 (21:56 +0000)]
move DeclObjc.h down to be alphabetically organized

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

17 years agoFinish renaming ObjC declaration actions.
Steve Naroff [Wed, 3 Oct 2007 21:00:46 +0000 (21:00 +0000)]
Finish renaming ObjC declaration actions.
Add comments.
Switch to new indentation style for the Action class. Since many actions take many arguments, the new style will...
- make it easier to add/remove arguments without messing up the indentation...
- make it easier to add comments to each argument (see ActOnMethodDeclaration for an example)...
- in general, just makes it easier to see what is being passed.

The rest of Actions will be converted "lazily"...there is no immediate need to hack all the existing methods.

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

17 years agoRenamed getCatLoc() to getLocation() to be consistant for such
Fariborz Jahanian [Wed, 3 Oct 2007 16:23:52 +0000 (16:23 +0000)]
Renamed getCatLoc() to getLocation() to be consistant for such
getter names.

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

17 years agoFixed bug where intrusive_ptr_add_ref and intrusive_ptr_release were
Ted Kremenek [Wed, 3 Oct 2007 00:48:55 +0000 (00:48 +0000)]
Fixed bug where intrusive_ptr_add_ref and intrusive_ptr_release were
not declared "static inline."

Removed member templates for operator= and copy constructor.  They simply
didn't work as expected.

Fixed reference counting bug when a smart pointer is assigned the
value of another smart pointer that refers to the same address.

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

17 years agoRename several ObjC action methods to use the "ActOn" prefix (still a few more to...
Steve Naroff [Tue, 2 Oct 2007 22:39:18 +0000 (22:39 +0000)]
Rename several ObjC action methods to use the "ActOn" prefix (still a few more to do).
Remove Action::ObjCStartCategoryInterface/ObjCFinishInterface - they are unused.
.

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

17 years agoUnified SuperClass field name in an objective-c class.
Fariborz Jahanian [Tue, 2 Oct 2007 22:12:45 +0000 (22:12 +0000)]
Unified SuperClass field name in an objective-c class.

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

17 years agoUnified such names as protocol references, instance methods and class methods
Fariborz Jahanian [Tue, 2 Oct 2007 22:05:16 +0000 (22:05 +0000)]
Unified such names as protocol references, instance methods and class methods
and their accessors in a variety of objective-c classes.

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

17 years agoRemove Action::ActOnImpleIvarVsClassIvars(), it is only called by Sema (not Parser).
Steve Naroff [Tue, 2 Oct 2007 21:43:37 +0000 (21:43 +0000)]
Remove Action::ActOnImpleIvarVsClassIvars(), it is only called by Sema (not Parser).
Add Sema::CheckImplementationIvars() to replace the previous action.

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

17 years agoRename ObjcInterfaceDecl::getIsForwardDecl() to isForwardDecl().
Steve Naroff [Tue, 2 Oct 2007 20:26:23 +0000 (20:26 +0000)]
Rename ObjcInterfaceDecl::getIsForwardDecl() to isForwardDecl().
Rename ObjcProtocolDecl::getIsForwardProtoDecl() to isForwardDecl().
Rename ObjcInterfaceDecl::setIsForwardDecl() to setForwardDecl().
Rename ObjcProtocolDecl::setIsForwardProtoDecl() to setForwardDecl().

Two reasons:

#1: boolean predicates should start with "is".
#2: Since these two sets of methods represent the same concept, they should be named the same (polymorphism is good:-)

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

17 years agoPreviously, I warned those methods not implemented in implementation class/category.
Fariborz Jahanian [Tue, 2 Oct 2007 20:06:01 +0000 (20:06 +0000)]
Previously, I warned those methods not implemented in implementation class/category.
Now, I also warn those class/categories which are incomplete because of this.

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

17 years ago- Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().
Steve Naroff [Tue, 2 Oct 2007 20:01:56 +0000 (20:01 +0000)]
- Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().
- Add ObjcMessageExpr::getSelector(), getClassName().
- Change Sema::getObjCInterfaceDecl() to simply take an IdentifierInfo (no Scope needed).
- Remove FIXME for printing ObjCMessageExpr's.

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

17 years agoObjcCategoryDecl Does not subclass from ScopedDecl any more.
Fariborz Jahanian [Tue, 2 Oct 2007 17:36:55 +0000 (17:36 +0000)]
ObjcCategoryDecl Does not subclass from ScopedDecl any more.
Ted may want to take a look at the change I made at
FGRecStmtDeclVisitor.h.

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

17 years agoMoved ProgramEdge out out include/.../Analysis/PathSensitive to include/.../Analysis...
Ted Kremenek [Tue, 2 Oct 2007 17:12:02 +0000 (17:12 +0000)]
Moved ProgramEdge out out include/.../Analysis/PathSensitive to include/.../Analysis, as it is now used by the FlowSensitive subsystem as well.

Removed "Edge" nested class by CFG, as it is now subsumed by ProgramEdge.

Adjusted DataflowSolver and DataflowValues to use ProgramEdges instead
of CFG::Edge.

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

17 years agoThis patch introduces the ObjcCategoryImplDecl class and does the checking related to
Fariborz Jahanian [Tue, 2 Oct 2007 16:38:50 +0000 (16:38 +0000)]
This patch introduces the ObjcCategoryImplDecl class and does the checking related to
unimplemented methods in category implementation.

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

17 years agoAdded DenseMapInfo traits for ProgramEdges
Ted Kremenek [Tue, 2 Oct 2007 16:38:05 +0000 (16:38 +0000)]
Added DenseMapInfo traits for ProgramEdges

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

17 years agoUse Identifier::getLength() instead of strlen() in Selector::getName() and MultiKeywo...
Steve Naroff [Tue, 2 Oct 2007 02:01:22 +0000 (02:01 +0000)]
Use Identifier::getLength() instead of strlen() in Selector::getName() and MultiKeywordSelector::getName().

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

17 years agoAdded a missing #include.
Hartmut Kaiser [Tue, 2 Oct 2007 00:36:52 +0000 (00:36 +0000)]
Added a missing #include.

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

17 years agoAdd comment to ObjcClassDecl.
Steve Naroff [Tue, 2 Oct 2007 00:10:42 +0000 (00:10 +0000)]
Add comment to ObjcClassDecl.
Move ObjcClassDecl to be next to ObjcForwardProtocolDecl. Since they are very similar, might want to unify their names (e.g. ObjcForwardClassDecl).
Change indentation of ObjcForwardProtocolDecl to conform to everything else in DeclObjC.h.

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

17 years agoUpdated VC++ build system.
Hartmut Kaiser [Mon, 1 Oct 2007 23:57:52 +0000 (23:57 +0000)]
Updated VC++ build system.

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

17 years agoAdd comments for ObjC Decl's.
Steve Naroff [Mon, 1 Oct 2007 22:54:34 +0000 (22:54 +0000)]
Add comments for ObjC Decl's.
Removed a constructor that was #if 0's out.
Added a FIXME for fariborz...categories shouldn't inherit from ScopedDecl.

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

17 years agoMigrated LiveVariables and UninitializedVariables to now use the
Ted Kremenek [Mon, 1 Oct 2007 20:33:52 +0000 (20:33 +0000)]
Migrated LiveVariables and UninitializedVariables to now use the
tracked BlkExpr information now maintained by the CFG class.

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

17 years agoCFG objects now internally store a (lazily created) map from block-level
Ted Kremenek [Mon, 1 Oct 2007 19:33:33 +0000 (19:33 +0000)]
CFG objects now internally store a (lazily created) map from block-level
expressions to IDs.  This is used by various dataflow analyses, but is
also useful for anyone querying a CFG to determine where an expression
is evaluated.

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

17 years agoMove ObjC decls to DeclObjC.h, a new AST header.
Steve Naroff [Mon, 1 Oct 2007 19:00:59 +0000 (19:00 +0000)]
Move ObjC decls to DeclObjC.h, a new AST header.
Update clients and add to project file.

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

17 years agoMoved two bitfields back to top of class ObjcMethodDecl so they pack
Fariborz Jahanian [Mon, 1 Oct 2007 17:19:59 +0000 (17:19 +0000)]
Moved two bitfields back to top of class ObjcMethodDecl so they pack
with those in their base class. In response to clattner's
September 30, 2007 12:54:49 AM PDT email.

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

17 years agoTook care of clatter's suggestions, dated.
Fariborz Jahanian [Mon, 1 Oct 2007 16:53:59 +0000 (16:53 +0000)]
Took care of clatter's suggestions, dated.
September 30, 2007 12:36:58 AM PDT and
September 30, 2007 12:50:05 AM PDT

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

17 years agoRemoved "hasImplicitControlFlow" from class CFG, and moved it to class Stmt
Ted Kremenek [Mon, 1 Oct 2007 16:34:52 +0000 (16:34 +0000)]
Removed "hasImplicitControlFlow" from class CFG, and moved it to class Stmt
as a member function.  This function is no longer needed within the CFG
class, and logically belongs to the Stmt class as a predicate for a
Stmt instance.

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

17 years agoUnused ObjcProtoMethod is removed.
Fariborz Jahanian [Sun, 30 Sep 2007 18:53:32 +0000 (18:53 +0000)]
Unused ObjcProtoMethod is removed.

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

17 years agoAdd a new getLength() method to IdentifierInfo, which relies on a newly added
Chris Lattner [Sun, 30 Sep 2007 08:32:27 +0000 (08:32 +0000)]
Add a new getLength() method to IdentifierInfo, which relies on a newly added
method to StringMapEntry.  Steve, please use this to remove the
strlen calls in selector processing.

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

17 years agoFix a bug I just introduced.
Chris Lattner [Sun, 30 Sep 2007 08:31:00 +0000 (08:31 +0000)]
Fix a bug I just introduced.

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

17 years agoimprove comment.
Chris Lattner [Sun, 30 Sep 2007 08:13:22 +0000 (08:13 +0000)]
improve comment.

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

17 years agosimplify an expression
Chris Lattner [Sun, 30 Sep 2007 08:01:04 +0000 (08:01 +0000)]
simplify an expression

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

17 years agoThis patch fixes all issues mentioned in clattner's feedback of
Fariborz Jahanian [Sat, 29 Sep 2007 18:24:58 +0000 (18:24 +0000)]
This patch fixes all issues mentioned in clattner's feedback of
September 28, 2007 4:39:24 PM PDT
Please let me know if I missed anything.

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

17 years agoCode clean up. Moved couple of static functions to be private members of Sema class.
Fariborz Jahanian [Sat, 29 Sep 2007 17:14:55 +0000 (17:14 +0000)]
Code clean up. Moved couple of static functions to be private members of Sema class.
Avoiding passing a Sema object to these utility functions.

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

17 years agoPatch to remove use of has table for protocol name lookup. This patch mirrors my
Fariborz Jahanian [Sat, 29 Sep 2007 17:04:06 +0000 (17:04 +0000)]
Patch to remove use of has table for protocol name lookup. This patch mirrors my
previous patch to do the same for class name lookup using a hash table.

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

17 years agoRemoved use of hash table for class decls and do a name look up directly.
Fariborz Jahanian [Sat, 29 Sep 2007 00:54:24 +0000 (00:54 +0000)]
Removed use of hash table for class decls and do a name look up directly.
There is still an issue if doing ScopedLookup is an overkill and we can
just access the decl using the identifier.

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

17 years agoAdd some comments to MultiKeywordSelector, make all methods private, add a friend...
Steve Naroff [Fri, 28 Sep 2007 23:39:26 +0000 (23:39 +0000)]
Add some comments to MultiKeywordSelector, make all methods private, add a friend, move some methods around.

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

17 years agoAdded ProgramEdge.h, which defines ProgramEdge (and subclasses) that
Ted Kremenek [Fri, 28 Sep 2007 23:15:21 +0000 (23:15 +0000)]
Added ProgramEdge.h, which defines ProgramEdge (and subclasses) that
encapsulate a program point within a CFG for use by our path-sensitive
dataflow solver.

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

17 years agoYesterday I discovered that 78% of all selectors in "Cocoa.h" take 0/1 argument.
Steve Naroff [Fri, 28 Sep 2007 22:22:11 +0000 (22:22 +0000)]
Yesterday I discovered that 78% of all selectors in "Cocoa.h" take 0/1 argument.

This motivated implementing a devious clattner inspired solution:-)

This approach uses a small value "Selector" class to point to an IdentifierInfo for the 0/1 case. For multi-keyword selectors, we instantiate a MultiKeywordSelector object (previously known as SelectorInfo). Now, the incremental cost for selectors is only 24,800 for Cocoa.h! This saves 156,592 bytes, or 86%!! The size reduction is also the result of getting rid of the AST slot, which was not strictly necessary (we will associate a selector with it's method using another table...most likely in Sema).

This change was critical to make now, before we have too many clients.

I still need to add some comments to the Selector class...will likely add later today/tomorrow.

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

17 years agoDo not codegen dummy block.
Devang Patel [Fri, 28 Sep 2007 21:49:18 +0000 (21:49 +0000)]
Do not codegen dummy block.
Dummy block is an empty block with no predecessors.

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

17 years agoFixed bug where assignments to variables wrapped in parentheses would not
Ted Kremenek [Fri, 28 Sep 2007 21:29:33 +0000 (21:29 +0000)]
Fixed bug where assignments to variables wrapped in parentheses would not
properly kill variables.  e.g:

(x) = 1;

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

17 years agoFixed UninitializedValues to properly propagate uninitialized "taint"
Ted Kremenek [Fri, 28 Sep 2007 21:08:51 +0000 (21:08 +0000)]
Fixed UninitializedValues to properly propagate uninitialized "taint"
in assignment operations of the form +=, -=, *=, etc.

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

17 years agoDeadStores no longer reports warnings for stores to non-local variables.
Ted Kremenek [Fri, 28 Sep 2007 20:48:41 +0000 (20:48 +0000)]
DeadStores no longer reports warnings for stores to non-local variables.

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

17 years agoSignificant cleanups and bug-fixes to LiveVariables. Uses new refactored
Ted Kremenek [Fri, 28 Sep 2007 20:38:59 +0000 (20:38 +0000)]
Significant cleanups and bug-fixes to LiveVariables.  Uses new refactored
ExprDeclBitVector class for defining dataflow state.

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

17 years agoRefactored ExprDeclBitVector into two classes:
Ted Kremenek [Fri, 28 Sep 2007 20:12:10 +0000 (20:12 +0000)]
Refactored ExprDeclBitVector into two classes:
 DeclBitVector
 ExprDeclBitVector (which subclasses the former)

DeclBitVector is for analyses that just want to track bitvector state
for declarations.

ExprDeclBitVector is for analyses that want to track bitvector state
for both both declarations and CFGBlock-level expressions.

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

17 years agoFixed bug where declaration initializer expressions were not
Ted Kremenek [Fri, 28 Sep 2007 17:55:50 +0000 (17:55 +0000)]
Fixed bug where declaration initializer expressions were not
traversed by the visitor.

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

17 years agoAdded iterator mechanism to iterator over the decls and expressions
Ted Kremenek [Fri, 28 Sep 2007 17:55:22 +0000 (17:55 +0000)]
Added iterator mechanism to iterator over the decls and expressions
tracked by an ExprDeclBitVector analysis.

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

17 years agoPatch to warn on umimplemented methods coming from class's
Fariborz Jahanian [Fri, 28 Sep 2007 17:40:07 +0000 (17:40 +0000)]
Patch to warn on umimplemented methods coming from class's
protocols.

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

17 years agoFixed several bugs in the propagation of "uninitialized value"
Ted Kremenek [Fri, 28 Sep 2007 00:09:38 +0000 (00:09 +0000)]
Fixed several bugs in the propagation of "uninitialized value"
taintness across expressions.

Made "smart-culling" of taint propagation (for error reporting)
correctly handle conditional expressions and a few other edge cases.

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

17 years agoPatch to use case-stmt for keywords used as selectgor names.
Fariborz Jahanian [Thu, 27 Sep 2007 19:52:15 +0000 (19:52 +0000)]
Patch to use case-stmt for keywords used as selectgor names.

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

17 years agoPatch for method implementation. It populates ObjcImplementationDecl object with...
Fariborz Jahanian [Thu, 27 Sep 2007 18:57:03 +0000 (18:57 +0000)]
Patch for method implementation. It populates ObjcImplementationDecl object with method implementation declarations .
It checks and warns on those methods declared in class interface and not implemented.

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

17 years agoFix bug in SelectorInfo::getName() - method buffer needs to be passed by reference.
Steve Naroff [Thu, 27 Sep 2007 18:52:21 +0000 (18:52 +0000)]
Fix bug in SelectorInfo::getName() - method buffer needs to be passed by reference.

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

17 years agoCreated new "ExprDeclBitVector" type bundle for dataflow analyses that need boolean
Ted Kremenek [Thu, 27 Sep 2007 18:20:22 +0000 (18:20 +0000)]
Created new "ExprDeclBitVector" type bundle for dataflow analyses that need boolean
values associated with ScopedDecls and CFGBlock-level Exprs.  This is the common
boilerplate needed by UninitializedValues and LiveVariables.

Refactored UninitializedValues to use ExprDeclBitVector.

Shortened the string diagnostic for UninitializedValues.

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

17 years agoFix some use of uninit variables issues, reported by Anton.
Chris Lattner [Thu, 27 Sep 2007 15:15:46 +0000 (15:15 +0000)]
Fix some use of uninit variables issues, reported by Anton.

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

17 years agoAdd SelectorInfo (similar in spirit to IdentifierInfo). The key difference is Selecto...
Steve Naroff [Thu, 27 Sep 2007 14:38:14 +0000 (14:38 +0000)]
Add SelectorInfo (similar in spirit to IdentifierInfo). The key difference is SelectorInfo is not string-oriented, it is a unique aggregate of IdentifierInfo's (using a folding set).  SelectorInfo also has a richer API that simplifies the parser/action interface. 3 noteworthy benefits:

#1: It is cleaner. I never "liked" storing keyword selectors (i.e. foo:bar:baz) in the IdentifierTable.

#2: It is more space efficient. Since Cocoa keyword selectors can be quite long, this technique is space saving. For Cocoa.h, pulling the keyword selectors out saves ~180k. The cost of the SelectorInfo data is ~100k. Saves ~80k, or 43%.

#3: It results in many API simplifications. Here are some highlights:

- Removed 3 actions (ActOnKeywordMessage, ActOnUnaryMessage, & one flavor of ObjcBuildMethodDeclaration that was specific to unary messages).
- Removed 3 funky structs from DeclSpec.h (ObjcKeywordMessage, ObjcKeywordDecl, and ObjcKeywordInfo).
- Removed 2 ivars and 2 constructors from ObjCMessageExpr (fyi, this space savings has not been measured).

I am happy with the way it turned out (though it took a bit more hacking than I expected). Given the central role of selectors in ObjC, making sure this is "right" will pay dividends later.

Thanks to Chris for talking this through with me and suggesting this approach.

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

17 years agoobjc messages have side effects, return true from hasLocalSideEffect,
Chris Lattner [Wed, 26 Sep 2007 22:06:30 +0000 (22:06 +0000)]
objc messages have side effects, return true from hasLocalSideEffect,
fixing:

VoidMethod.m:14:5: warning: expression result unused
    [Greeter hello];
    ^~~~~~~~~~~~~~~

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

17 years agoAdded extra guard for null Stmt* when traversing the AST using VisitChildren.
Ted Kremenek [Wed, 26 Sep 2007 21:36:20 +0000 (21:36 +0000)]
Added extra guard for null Stmt* when traversing the AST using VisitChildren.
Added assertion that Block-level statements should not be NULL.

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

17 years agoFixed two bugs in CFG construction:
Ted Kremenek [Wed, 26 Sep 2007 21:23:31 +0000 (21:23 +0000)]
Fixed two bugs in CFG construction:

BUG 1)

CFG failed to build for empty functions, or functions containing only
NullStmts or empty compound statements.

We now handle such cases, although now we cannot test for CFG
construction failure by asserting that the last block constructed is
not NULL (since it now may be).

BUG 2)

CFG construction segfaulted on some cases when walking the AST and not
taking into account that some children of a statement may be NULL.

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

17 years agoRemoved option "-parse-ast-check" from clang driver. This is now implemented
Ted Kremenek [Wed, 26 Sep 2007 20:14:22 +0000 (20:14 +0000)]
Removed option "-parse-ast-check" from clang driver.  This is now implemented
using "-parse-ast -verify".

Updated all test cases (using a sed script) that invoked -parse-ast-check to
now use -parse-ast -verify.

Fixed a bug where using "-verify" instead of "-parse-ast-check" would not
correctly create the DiagClient needed to accumulate diagnostics.

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

17 years agoMoved "VerifyDiagnostics" variable declaration to right below ProgAction
Ted Kremenek [Wed, 26 Sep 2007 19:42:19 +0000 (19:42 +0000)]
Moved "VerifyDiagnostics" variable declaration to right below ProgAction
declaration.  This is because this option is logically tightly connected
to the actions defined in ProgAction.

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

17 years agoRemoved inclusion of <memory>, which is no longer needed since we
Ted Kremenek [Wed, 26 Sep 2007 19:41:07 +0000 (19:41 +0000)]
Removed inclusion of <memory>, which is no longer needed since we
aren't used auto_ptr's anymore.

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