|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | - New isDefined() function checks for deletedness
 - isThisDeclarationADefinition checks for deletedness
 - New doesThisDeclarationHaveABody() does what
   isThisDeclarationADefinition() used to do
 - The IsDeleted bit is not propagated across redeclarations
 - isDeleted() now checks the canoncial declaration
 - New isDeletedAsWritten() does what it says on the tin.
 - isUserProvided() now correct (thanks Richard!)
This fixes the bug that we weren't catching
void foo() = delete;
void foo() {}
as being a redefinition.
llvm-svn: 131013 | 
| | 
| 
| 
| | llvm-svn: 129567 | 
| | 
| 
| 
| 
| 
| | Luis Felipe Strano Moraes!
llvm-svn: 129559 | 
| | 
| 
| 
| 
| 
| 
| | Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.
llvm-svn: 125450 | 
| | 
| 
| 
| | llvm-svn: 125275 | 
| | 
| 
| 
| | llvm-svn: 114336 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | instead"
This reverts commit r113631
Conflicts:
	CMakeLists.txt
	lib/CodeGen/CMakeLists.txt
llvm-svn: 113817 | 
| | 
| 
| 
| 
| 
| | of whatever we were using before...
llvm-svn: 113631 | 
| | 
| 
| 
| | llvm-svn: 113489 | 
| | 
| 
| 
| | llvm-svn: 113416 | 
| | 
| 
| 
| 
| 
| | This lets us remove Sema.h's dependency on Expr.h and Decl.h.
llvm-svn: 112156 | 
| | 
| 
| 
| 
| 
| | supercedes it
llvm-svn: 108708 | 
| | 
| 
| 
| | llvm-svn: 108633 | 
| | 
| 
| 
| 
| 
| | Add an API to get an Entity associated with a name in the global namespace.
llvm-svn: 107642 | 
| | 
| 
| 
| | llvm-svn: 107630 | 
| | 
| 
| 
| | llvm-svn: 107607 | 
| | 
| 
| 
| 
| 
| 
| | class is available in the same translation unit when it's needed. So we make 
all of them invalid Entity.
llvm-svn: 107606 | 
| | 
| 
| 
| | llvm-svn: 107605 | 
| | 
| 
| 
| | llvm-svn: 107604 | 
| | 
| 
| 
| 
| 
| | object to the Index library.
llvm-svn: 107461 | 
| | 
| 
| 
| | llvm-svn: 105639 | 
| | 
| 
| 
| 
| 
| | scattered throughout the project Makefiles.
llvm-svn: 105638 | 
| | 
| 
| 
| 
| 
| | - This eliminates most dependencies on how Clang is installed relative to LLVM.
llvm-svn: 105637 | 
| | 
| 
| 
| 
| 
| | getFullSourceRange -> getSourceRange for TypeLoc.
llvm-svn: 104220 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | ObjCObjectType, which is basically just a pair of
  one of {primitive-id, primitive-Class, user-defined @class}
with
  a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared).  ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.
Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType.  Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet.  Remove some number of methods that are no
longer used, at least after this patch.
By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.
llvm-svn: 103870 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:
  1) Send to a object instance described by an expression (e.g., [x method:5])
  2) Send to a class described by the class name (e.g., [NSString method:5])
  3) Send to a superclass class (e.g, [super method:5] in class method)
  4) Send to a superclass instance (e.g., [super method:5] in instance method)
Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:
  1) Unchanged; the object instance is represented by an Expr*.
  2) Previously stored the ObjCInterfaceDecl* referring to the class
  receiving the message. Now stores a TypeSourceInfo* so that we know
  how the class was spelled. This both maintains typedef information
  and opens the door for more complicated C++ types (e.g., dependent
  types). There was an alternative, unused representation of these
  sends by naming the class via an IdentifierInfo *. In practice, we
  either had an ObjCInterfaceDecl *, from which we would get the
  IdentifierInfo *, or we fell into the case below...
  3) Previously represented by a class message whose IdentifierInfo *
  referred to "super". Sema and CodeGen would use isStr("super") to
  determine if they had a send to super. Now represented as a
  "class super" send, where we have both the location of the "super"
  keyword and the ObjCInterfaceDecl* of the superclass we're
  targetting (statically).
  4) Previously represented by an instance message whose receiver is a
  an ObjCSuperExpr, which Sema and CodeGen would check for via
  isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
  where we have both the location of the "super" keyword and the
  ObjCInterfaceDecl* of the superclass we're targetting
  (statically). Note that ObjCSuperExpr only has one remaining use in
  the AST, which is for "super.prop" references.
The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!
This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:
  if (message has a receiver expression) {
    // instance message
    if (isa<ObjCSuperExpr>(...)) {
     // send to super
    } else {
     // send to an object
   }
  } else {
    // class message
    if (name->isStr("super")) {
      // class send to super
    } else {
      // send to class
    }
  }
with a switch
  switch (E->getReceiverKind()) {
  case ObjCMessageExpr::SuperInstance: ...
  case ObjCMessageExpr::Instance: ...
  case ObjCMessageExpr::SuperClass: ...
  case ObjCMessageExpr::Class:...
  }
There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.
llvm-svn: 101972 | 
| | 
| 
| 
| 
| 
| 
| 
| | users of getNameAsString on a stream.
The next step is to print the name directly into the stream, avoiding a temporary std::string copy.
llvm-svn: 101632 | 
| | 
| 
| 
| 
| | Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)
llvm-svn: 98399 | 
| | 
| 
| 
| | llvm-svn: 98339 | 
| | 
| 
| 
| 
| 
| | of the class name.
llvm-svn: 97943 | 
| | 
| 
| 
| | llvm-svn: 94379 | 
| | 
| 
| 
| 
| 
| 
| 
| | to directly check the results of clang_getCursor(). Also, start
migrating some index-test tests over to c-index test [*] and some
grep-using tests over to FileCheck.
llvm-svn: 93537 | 
| | 
| 
| 
| | llvm-svn: 90808 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | variables,
but the results are imperfect.
For posterity, I did:
cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF
find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;
llvm-svn: 90743 | 
| | 
| 
| 
| | llvm-svn: 90443 | 
| | 
| 
| 
| | llvm-svn: 90424 | 
| | 
| 
| 
| | llvm-svn: 90044 | 
| | 
| 
| 
| 
| 
| | <rdar://problem/7383421>.
llvm-svn: 89183 | 
| | 
| 
| 
| | llvm-svn: 89051 | 
| | 
| 
| 
| 
| 
| | through to indexing.
llvm-svn: 86018 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | <rdar://problem/7310688>.
Localize the optimization to ResolveLocationInAST(). The last valid AST location is now stored with ASTUnit. There still isn't optimal, however it's an improvement (with a much cleaner API). Having the client manage an "hint" is error prone and complex.
I wanted to land the major changes before finishing up the optimizations. 
llvm-svn: 85425 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | template instantiation.  Preserve it through PCH.  Show it off to the indexer.
I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.
llvm-svn: 84994 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).
To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
  reference type.  Also, preserve the original spelling of the reference type.
  Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
  the various ObjC TypeLocs.  Preserve the spelling of protocol lists except in
  the canonical form.
* Preserve some level of source type structure on parameter types, but
  canonicalize on the canonical function type.  This is still a WIP.
Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.
llvm-svn: 84907 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | searching). Without a 'relativeDecl', the algorithm is n-squared. For example, running the following command on 'Large.m' takes hours without a 'relatvieDecl'.
snaroff% time ../../Debug/bin/c-index-test Large.ast all > Large.out
snaroff% cat Large.m
#import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#import <OpenGL/OpenGL.h>
With a 'relativeDecl', it takes <30 seconds:-)
llvm-svn: 84760 | 
| | 
| 
| 
| | llvm-svn: 84436 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | TypeLoc class names to be $(Type classname)Loc.  Rewrite the visitor.
Provide skeleton implementations for all the new TypeLocs.
Handle all cases in PCH.  Handle a few more cases when inserting
location information in SemaType.
It should be extremely straightforward to add new location information
to existing TypeLoc objects now.
llvm-svn: 84386 | 
| | 
| 
| 
| | llvm-svn: 83582 | 
| | 
| 
| 
| | llvm-svn: 83112 | 
| | 
| 
| 
| | llvm-svn: 83111 | 
| | 
| 
| 
| | llvm-svn: 83110 |