aboutsummaryrefslogtreecommitdiff
path: root/lib/Index/ResolveLocation.cpp
AgeCommit message (Collapse)Author
2009-11-18Add special clang_getCursor() support for @class. Handles ↵Ted Kremenek
<rdar://problem/7383421>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89183 91177308-0d34-0410-b5e6-96231b3b80d8
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-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-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-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-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-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-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
2009-07-18Resolve a location that is inside an ObjCMethodDecl.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18Search through all Decls that are DeclContexts.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17If we are not doing a Debug build, no need for the debugging print methods.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14In ResolveLocationInAST, handle locations that are inside TagDecl definitions.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10Simplify a bit by using functions instead of checking enum values. No ↵Argyrios Kyrtzidis
functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07Refactor DeclLocResolver/StmtLocResolver into a more functional style by ↵Argyrios Kyrtzidis
removing the search state and by having their Visit* methods return the ASTLocation directly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06Move the 'ResolveLocationInAST' function from the Frontend library to the ↵Argyrios Kyrtzidis
Index library. Also, cut down its comments; more comments will be added to ASTLocation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74860 91177308-0d34-0410-b5e6-96231b3b80d8