Commit Graph

2039 Commits

Author SHA1 Message Date
Ted Kremenek 88b7439a8c 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.

llvm-svn: 42562
2007-10-03 00:48:55 +00:00
Steve Naroff 0c37b0cb5a Rename several ObjC action methods to use the "ActOn" prefix (still a few more to do).
Remove Action::ObjCStartCategoryInterface/ObjCFinishInterface - they are unused.
.

llvm-svn: 42559
2007-10-02 22:39:18 +00:00
Fariborz Jahanian b75640c9f1 Unified SuperClass field name in an objective-c class.
llvm-svn: 42556
2007-10-02 22:12:45 +00:00
Fariborz Jahanian b8d9e088a7 Unified such names as protocol references, instance methods and class methods
and their accessors in a variety of objective-c classes.

llvm-svn: 42555
2007-10-02 22:05:16 +00:00
Steve Naroff d174155204 Remove Action::ActOnImpleIvarVsClassIvars(), it is only called by Sema (not Parser).
Add Sema::CheckImplementationIvars() to replace the previous action.

llvm-svn: 42553
2007-10-02 21:43:37 +00:00
Steve Naroff f5a55c5a9f 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:-)

llvm-svn: 42545
2007-10-02 20:26:23 +00:00
Fariborz Jahanian adf84f3f3c Previously, I warned those methods not implemented in implementation class/category.
Now, I also warn those class/categories which are incomplete because of this.

llvm-svn: 42544
2007-10-02 20:06:01 +00:00
Steve Naroff c6814ea670 - 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.

llvm-svn: 42543
2007-10-02 20:01:56 +00:00
Fariborz Jahanian 19d765fa6c ObjcCategoryDecl Does not subclass from ScopedDecl any more.
Ted may want to take a look at the change I made at 
FGRecStmtDeclVisitor.h.

llvm-svn: 42535
2007-10-02 17:36:55 +00:00
Ted Kremenek 190b1ed4fc 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.

llvm-svn: 42534
2007-10-02 17:12:02 +00:00
Fariborz Jahanian 89b8ef92be This patch introduces the ObjcCategoryImplDecl class and does the checking related to
unimplemented methods in category implementation.

llvm-svn: 42531
2007-10-02 16:38:50 +00:00
Ted Kremenek a6d930a925 Added DenseMapInfo traits for ProgramEdges
llvm-svn: 42530
2007-10-02 16:38:05 +00:00
Steve Naroff b6c0518d11 Use Identifier::getLength() instead of strlen() in Selector::getName() and MultiKeywordSelector::getName().
llvm-svn: 42524
2007-10-02 02:01:22 +00:00
Hartmut Kaiser 9f4dee8973 Added a missing #include.
llvm-svn: 42516
2007-10-02 00:36:52 +00:00
Steve Naroff bf81db14c5 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.

llvm-svn: 42513
2007-10-02 00:10:42 +00:00
Hartmut Kaiser 587cc42864 Updated VC++ build system.
llvm-svn: 42512
2007-10-01 23:57:52 +00:00
Steve Naroff e5e25fae1d 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.

llvm-svn: 42507
2007-10-01 22:54:34 +00:00
Ted Kremenek fb4750b639 Migrated LiveVariables and UninitializedVariables to now use the
tracked BlkExpr information now maintained by the CFG class.

llvm-svn: 42498
2007-10-01 20:33:52 +00:00
Ted Kremenek f2d4372ba9 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.

llvm-svn: 42495
2007-10-01 19:33:33 +00:00
Steve Naroff 67391b8a54 Move ObjC decls to DeclObjC.h, a new AST header.
Update clients and add to project file.

llvm-svn: 42494
2007-10-01 19:00:59 +00:00
Fariborz Jahanian ebb34d7141 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.

llvm-svn: 42491
2007-10-01 17:19:59 +00:00
Fariborz Jahanian f26702eb54 Took care of clatter's suggestions, dated.
September 30, 2007 12:36:58 AM PDT and
September 30, 2007 12:50:05 AM PDT

llvm-svn: 42490
2007-10-01 16:53:59 +00:00
Ted Kremenek 7f74e13535 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.

llvm-svn: 42489
2007-10-01 16:34:52 +00:00
Fariborz Jahanian a725bf7782 Unused ObjcProtoMethod is removed.
llvm-svn: 42485
2007-09-30 18:53:32 +00:00
Chris Lattner 2b6abdce50 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.

llvm-svn: 42481
2007-09-30 08:32:27 +00:00
Chris Lattner 6c44b9f145 Fix a bug I just introduced.
llvm-svn: 42479
2007-09-30 08:31:00 +00:00
Chris Lattner 90c26ba9de improve comment.
llvm-svn: 42478
2007-09-30 08:13:22 +00:00
Chris Lattner 4730430bd8 simplify an expression
llvm-svn: 42477
2007-09-30 08:01:04 +00:00
Fariborz Jahanian 0886d252d7 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.

llvm-svn: 42473
2007-09-29 18:24:58 +00:00
Fariborz Jahanian ec7b3333e1 Code clean up. Moved couple of static functions to be private members of Sema class.
Avoiding passing a Sema object to these utility functions.

llvm-svn: 42472
2007-09-29 17:14:55 +00:00
Fariborz Jahanian fa0667b547 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.

llvm-svn: 42471
2007-09-29 17:04:06 +00:00
Fariborz Jahanian 343f7098db 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.

llvm-svn: 42463
2007-09-29 00:54:24 +00:00
Steve Naroff 92866f4fbb Add some comments to MultiKeywordSelector, make all methods private, add a friend, move some methods around.
llvm-svn: 42456
2007-09-28 23:39:26 +00:00
Ted Kremenek 1b61261a25 Added ProgramEdge.h, which defines ProgramEdge (and subclasses) that
encapsulate a program point within a CFG for use by our path-sensitive
dataflow solver.

llvm-svn: 42455
2007-09-28 23:15:21 +00:00
Steve Naroff 8017506d9c 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.

llvm-svn: 42452
2007-09-28 22:22:11 +00:00
Devang Patel 8ec4f837fa Do not codegen dummy block.
Dummy block is an empty block with no predecessors.

llvm-svn: 42451
2007-09-28 21:49:18 +00:00
Ted Kremenek 14851c3de3 Fixed bug where assignments to variables wrapped in parentheses would not
properly kill variables.  e.g:

(x) = 1;

llvm-svn: 42450
2007-09-28 21:29:33 +00:00
Ted Kremenek a1c256dd0e Fixed UninitializedValues to properly propagate uninitialized "taint"
in assignment operations of the form +=, -=, *=, etc.

llvm-svn: 42449
2007-09-28 21:08:51 +00:00
Ted Kremenek a6ef56e6d2 DeadStores no longer reports warnings for stores to non-local variables.
llvm-svn: 42447
2007-09-28 20:48:41 +00:00
Ted Kremenek 0064ff47e6 Significant cleanups and bug-fixes to LiveVariables. Uses new refactored
ExprDeclBitVector class for defining dataflow state.

llvm-svn: 42446
2007-09-28 20:38:59 +00:00
Ted Kremenek 254c126c15 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.

llvm-svn: 42445
2007-09-28 20:12:10 +00:00
Ted Kremenek 483e305210 Fixed bug where declaration initializer expressions were not
traversed by the visitor.

llvm-svn: 42438
2007-09-28 17:55:50 +00:00
Ted Kremenek 07eff9a2fe Added iterator mechanism to iterator over the decls and expressions
tracked by an ExprDeclBitVector analysis.

llvm-svn: 42437
2007-09-28 17:55:22 +00:00
Fariborz Jahanian b75db4cc8c Patch to warn on umimplemented methods coming from class's
protocols.

llvm-svn: 42436
2007-09-28 17:40:07 +00:00
Ted Kremenek f91d1c92ba 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.

llvm-svn: 42421
2007-09-28 00:09:38 +00:00
Fariborz Jahanian fa80e80da9 Patch to use case-stmt for keywords used as selectgor names.
llvm-svn: 42416
2007-09-27 19:52:15 +00:00
Fariborz Jahanian f6546b38b2 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.

llvm-svn: 42412
2007-09-27 18:57:03 +00:00
Steve Naroff 65ca537b55 Fix bug in SelectorInfo::getName() - method buffer needs to be passed by reference.
llvm-svn: 42411
2007-09-27 18:52:21 +00:00
Ted Kremenek b9ce295b0a 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.

llvm-svn: 42408
2007-09-27 18:20:22 +00:00
Chris Lattner cc61bf5e0c Fix some use of uninit variables issues, reported by Anton.
llvm-svn: 42396
2007-09-27 15:15:46 +00:00