Commit Graph

28 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 8274ad5281 Remove the ASTContext parameter from Entity::getPrintableName().
llvm-svn: 76546
2009-07-21 07:52:21 +00:00
Argyrios Kyrtzidis 3b4e2a7621 Keep only canonical Decls in Entities.
llvm-svn: 76532
2009-07-21 02:10:32 +00:00
Argyrios Kyrtzidis 05ac8276cf Change the semantics for Entity.
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.

llvm-svn: 76515
2009-07-21 00:07:06 +00:00
Argyrios Kyrtzidis b78139f74d Handle references from ObjCIvarRefExprs.
llvm-svn: 76507
2009-07-21 00:05:38 +00:00
Zhongxing Xu 34e0370502 The children statements might be NULL. Check for this case in
isContainedInStatement().

llvm-svn: 76408
2009-07-20 08:28:49 +00:00
Argyrios Kyrtzidis d6bf03c272 Introduce ASTLocation::getReferencedDecl(), for getting the declaration that the ASTLocation references.
llvm-svn: 76336
2009-07-18 21:17:58 +00:00
Argyrios Kyrtzidis fb63b0a317 Handle invalid ASTLocations instead of asserting.
llvm-svn: 76335
2009-07-18 21:17:43 +00:00
Argyrios Kyrtzidis 194a9d8e73 Remove StmtLocResolver::VisitObjCIvarRefExpr, it was only there to avoid 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
2009-07-18 08:49:56 +00:00
Argyrios Kyrtzidis 5614aef776 Move the functionality of ASTContext::getCanonicalDecl(), into a virtual method Decl::getCanonicalDecl().
llvm-svn: 76273
2009-07-18 00:34:07 +00:00
Argyrios Kyrtzidis e842bd16ce Resolve a location that is inside an ObjCMethodDecl.
llvm-svn: 76272
2009-07-18 00:33:52 +00:00
Argyrios Kyrtzidis 38d83defbe Make ASTLocation accept a Stmt that is inside an ObjCMethodDecl.
llvm-svn: 76271
2009-07-18 00:33:46 +00:00
Argyrios Kyrtzidis 340f8af489 Search through all Decls that are DeclContexts.
llvm-svn: 76270
2009-07-18 00:33:40 +00:00
Zhongxing Xu 9d05213899 Rename Entity::getName() to Entity::getPrintableName() to make its purpose
more obvious.

llvm-svn: 76167
2009-07-17 07:49:44 +00:00
Zhongxing Xu 3436f58e40 As suggested by Argyrios, revert r76159 and make "FindImmediateParent"
a public static method of ASTLocation.

llvm-svn: 76166
2009-07-17 07:36:20 +00:00
Zhongxing Xu d25ea831b2 Relax the assertion in ASTLocation's ctor: if the decl is not the immediate
parent of the stmt, find the immediate parent for the stmt.

This is because sometimes we cannot get the immediate decl of the stmt when
creating the ASTLocation. We can only get a parent of the stmt.

llvm-svn: 76159
2009-07-17 06:58:08 +00:00
Argyrios Kyrtzidis 95d401de9d If we are not doing a Debug build, no need for the debugging print methods.
llvm-svn: 76138
2009-07-17 01:20:03 +00:00
Argyrios Kyrtzidis bffa89f42c Check whether the IdentifierInfo is null, before using it.
llvm-svn: 76136
2009-07-17 01:19:03 +00:00
Zhongxing Xu 12b1d137c2 Add getName() method to Entity.
llvm-svn: 75740
2009-07-15 04:39:21 +00:00
Argyrios Kyrtzidis 307b0717f7 In ResolveLocationInAST, handle locations that are inside TagDecl definitions.
llvm-svn: 75594
2009-07-14 03:18:17 +00:00
Argyrios Kyrtzidis a28d145cbb In DeclReferenceMap, map FieldDecls to the MemberExprs that reference them.
llvm-svn: 75593
2009-07-14 03:18:09 +00:00
Chris Lattner c9f6c334f0 fix file headers.
llvm-svn: 75437
2009-07-12 22:33:12 +00:00
Argyrios Kyrtzidis 6dd7181ed4 Simplify a bit by using functions instead of checking enum values. No functionality change.
llvm-svn: 75221
2009-07-10 03:41:26 +00:00
Argyrios Kyrtzidis 3f50f7e853 Refactor DeclLocResolver/StmtLocResolver into a more functional style by removing the search state
and by having their Visit* methods return the ASTLocation directly.

llvm-svn: 74887
2009-07-07 00:53:31 +00:00
Argyrios Kyrtzidis 26e8b9c9c1 Update CMake files.
llvm-svn: 74864
2009-07-06 21:38:29 +00:00
Argyrios Kyrtzidis b8020f0833 Some changes to ASTLocation's methods
-Change hasStmt() to isStmt()
-Add isDecl()
-Add getSourceRange()

llvm-svn: 74862
2009-07-06 21:35:20 +00:00
Argyrios Kyrtzidis f24249554b Move the 'ResolveLocationInAST' function from the Frontend library to the Index library.
Also, cut down its comments; more comments will be added to ASTLocation.

llvm-svn: 74860
2009-07-06 21:35:02 +00:00
Argyrios Kyrtzidis 63afa49add Move ASTLocation and DeclReferenceMap from the AST library to the Index library.
llvm-svn: 74859
2009-07-06 21:34:47 +00:00
Argyrios Kyrtzidis fe37cc831b Introduce the 'Index' library.
Its purpose is to provide the basic infrastructure for cross-translation-unit analysis like indexing, refactoring, etc.

Currently it is very "primitive" and with no type-names support. It can provide functionality like
"show me all references of this function from these translation units".

llvm-svn: 74802
2009-07-05 22:22:19 +00:00