aboutsummaryrefslogtreecommitdiff
path: root/lib/Index
AgeCommit message (Collapse)Author
2009-11-17Silence some warnings produced by Clang, and add a missing headerDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04Preserve type source information in sizeof/alignof expressions, and pass itJohn McCall
through to indexing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28Remove _clang_initCXLookupHint() and _clang_getCursorWithHint(). Related to ↵Steve Naroff
<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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24Preserve type source information in TypedefDecls. Preserve it acrossJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22When building types from declarators, instead of building two types (one forJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21Extend clang_getCursor() to take a 'relativeDecl' argument (so speed up ↵Steve Naroff
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:-) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18Clone the full Type hierarchy into the TypeLoc hierarchy. NormalizeJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08Installation of Clang libraries and headers, from Axel Naumann!Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29Pull TypeLocVisitor into its own header file.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29Keep track of type references in DeclReferenceMap.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83111 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29In ASTVisitor, call the correct base methods.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83110 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29Resolve a source location inside the return type of a functon.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29Resolve a source location that is inside a type declarator.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:Argyrios Kyrtzidis
-A NamedDecl reference -A TypeLoc git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29Add more const-goodness to ASTLocation.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23Don't install Clang libraries.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31For a CXXOperatorCallExpr, fix the order that StmtLocResolver uses to check ↵Argyrios Kyrtzidis
subexpressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30Lexically order files.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77607 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30Fix Selector <-> GlobalSelector conversion.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30Fix gcc warning.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30Add support for ObjC message expressions, in the Analyzer:Argyrios Kyrtzidis
-Accept an ObjC method and find all message expressions that this method may respond to. -Accept an ObjC message expression and find all methods that may respond to it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30Update CMake.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77548 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Support ObjC methods as Entities.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Index the selectors and provide the translation units that contain themArgyrios Kyrtzidis
through the IndexProvider. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77543 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Introduce SelectorMap whose purpose is to map selectors to objc methods and ↵Argyrios Kyrtzidis
message exprs, inside a particular ASTContext. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Find references inside blocks.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Use helper class ASTVisitor to fully traverse an AST.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Introduce the GlobalSelector class in the Indexing library.Argyrios Kyrtzidis
GlobalSelector is an ASTContext-independent way to refer to Objective C selectors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Use an IdentifierTable for names used for Entities.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29-Introduce the idx::Analyzer class used for getting indexing information, ↵Argyrios Kyrtzidis
like finding references of a declaration across translation units. -Modify the index-test tool to use it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Introduce TULocation and TULocationHandler classes.Argyrios Kyrtzidis
TULocation is like ASTLocation but also contains the TranslationUnit* that the ASTLocation originated from. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Modify the Indexer class so that it can return the TranslationUnit that internalArgyrios Kyrtzidis
decls originated from. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77534 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Constify ASTLocation::print.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Introduce a helper template for the Handler classes and use it insteadArgyrios Kyrtzidis
of the iterator of the Indexer class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77528 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Add an assert.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Accept Handler objects in parameters as references.Argyrios Kyrtzidis
Reinforces that they shouldn't be null and it's a bit more natural when they are passed as stack objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Rename EntityHandler::HandleEntity to Handle.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29-Make IndexProvider an abstract interface for getting indexing information.Argyrios Kyrtzidis
-Introduce Indexer as an IndexProvider implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24Constify methods.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23constify methods.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21Remove the ASTContext parameter from Entity::getPrintableName().Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21Keep only canonical Decls in Entities.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21Change the semantics for Entity.Argyrios Kyrtzidis
Entity can now refer to declarations that are not visible outside the translation unit. It is a wrapper of a pointer union, it's either a Decl* for declarations that don't "cross" translation units, or an EntityImpl* which is associated with the specific "visible" Decl. Included is a test case for handling fields across translation units. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21Handle references from ObjCIvarRefExprs.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76507 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20The children statements might be NULL. Check for this case in Zhongxing Xu
isContainedInStatement(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18Introduce ASTLocation::getReferencedDecl(), for getting the declaration that ↵Argyrios Kyrtzidis
the ASTLocation references. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18Handle invalid ASTLocations instead of asserting.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18Remove StmtLocResolver::VisitObjCIvarRefExpr, it was only there to avoid ↵Argyrios Kyrtzidis
returning an implicit 'self' instead of the ivar. Since implicit 'self' no longer has a source location, it's not needed. (plus we also want to check for a 'self' that is visible in source code) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76296 91177308-0d34-0410-b5e6-96231b3b80d8