summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/ResolveLocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused location-to-AST-node resolver. libclang's implementation ↵Douglas Gregor2010-07-191-602/+0
| | | | | | supercedes it llvm-svn: 108708
* Renamed misleading getSourceRange -> getLocalSourceRange and ↵Abramo Bagnara2010-05-201-1/+1
| | | | | | getFullSourceRange -> getSourceRange for TypeLoc. llvm-svn: 104220
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-19/+8
| | | | | | | | | | | | | | | | | | | | | 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
* Add -cursor-at=file:line:column command line option to c-index-test,Douglas Gregor2010-01-151-1/+1
| | | | | | | | 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
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-21/+21
| | | | | | | | | | | | | | | | | | | | | 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
* Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.Benjamin Kramer2009-11-281-4/+3
| | | | llvm-svn: 90044
* Add special clang_getCursor() support for @class. Handles ↵Ted Kremenek2009-11-181-0/+12
| | | | | | <rdar://problem/7383421>. llvm-svn: 89183
* Silence some warnings produced by Clang, and add a missing headerDouglas Gregor2009-11-171-1/+1
| | | | llvm-svn: 89051
* Preserve type source information in sizeof/alignof expressions, and pass itJohn McCall2009-11-041-0/+20
| | | | | | through to indexing. llvm-svn: 86018
* Remove _clang_initCXLookupHint() and _clang_getCursorWithHint(). Related to ↵Steve Naroff2009-10-281-8/+37
| | | | | | | | | | <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
* Preserve type source information in TypedefDecls. Preserve it acrossJohn McCall2009-10-241-0/+14
| | | | | | | | | 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
* When building types from declarators, instead of building two types (one forJohn McCall2009-10-221-7/+38
| | | | | | | | | | | | | | | | | | | | | 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
* Extend clang_getCursor() to take a 'relativeDecl' argument (so speed up ↵Steve Naroff2009-10-211-1/+4
| | | | | | | | | | | | | | 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
* Clone the full Type hierarchy into the TypeLoc hierarchy. NormalizeJohn McCall2009-10-181-10/+10
| | | | | | | | | | | | | 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
* Pull TypeLocVisitor into its own header file.Argyrios Kyrtzidis2009-09-291-1/+1
| | | | llvm-svn: 83112
* Resolve a source location inside the return type of a functon.Argyrios Kyrtzidis2009-09-291-0/+3
| | | | llvm-svn: 83101
* Resolve a source location that is inside a type declarator.Argyrios Kyrtzidis2009-09-291-4/+134
| | | | llvm-svn: 83098
* Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:Argyrios Kyrtzidis2009-09-291-1/+1
| | | | | | | -A NamedDecl reference -A TypeLoc llvm-svn: 83095
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-8/+8
| | | | llvm-svn: 81346
* For a CXXOperatorCallExpr, fix the order that StmtLocResolver uses to check ↵Argyrios Kyrtzidis2009-07-311-0/+33
| | | | | | subexpressions. llvm-svn: 77713
* Remove StmtLocResolver::VisitObjCIvarRefExpr, it was only there to avoid ↵Argyrios Kyrtzidis2009-07-181-7/+0
| | | | | | | | 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) llvm-svn: 76296
* Resolve a location that is inside an ObjCMethodDecl.Argyrios Kyrtzidis2009-07-181-1/+58
| | | | llvm-svn: 76272
* Search through all Decls that are DeclContexts.Argyrios Kyrtzidis2009-07-181-7/+2
| | | | llvm-svn: 76270
* If we are not doing a Debug build, no need for the debugging print methods.Argyrios Kyrtzidis2009-07-171-2/+6
| | | | llvm-svn: 76138
* In ResolveLocationInAST, handle locations that are inside TagDecl definitions.Argyrios Kyrtzidis2009-07-141-4/+17
| | | | llvm-svn: 75594
* Simplify a bit by using functions instead of checking enum values. No ↵Argyrios Kyrtzidis2009-07-101-15/+30
| | | | | | functionality change. llvm-svn: 75221
* Refactor DeclLocResolver/StmtLocResolver into a more functional style by ↵Argyrios Kyrtzidis2009-07-071-187/+117
| | | | | | | | removing the search state and by having their Visit* methods return the ASTLocation directly. llvm-svn: 74887
* Move the 'ResolveLocationInAST' function from the Frontend library to the ↵Argyrios Kyrtzidis2009-07-061-0/+332
Index library. Also, cut down its comments; more comments will be added to ASTLocation. llvm-svn: 74860
OpenPOWER on IntegriCloud