Граф коммитов

24 Коммитов

Автор SHA1 Сообщение Дата
John McCall a93c934af4 DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated 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 '{}' \;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 02:54:59 +00:00
Benjamin Kramer 85b4521e34 Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 19:45:26 +00:00
Ted Kremenek 1d5fdf3d3b Add special clang_getCursor() support for @class. Handles <rdar://problem/7383421>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89183 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 02:02:52 +00:00
Douglas Gregor 6490ae5003 Silence some warnings produced by Clang, and add a missing header
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 06:14:37 +00:00
John McCall 5ab7517205 Preserve type source information in sizeof/alignof expressions, and pass it
through to indexing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 07:28:41 +00:00
Steve Naroff f96b524306 Remove _clang_initCXLookupHint() and _clang_getCursorWithHint(). Related to <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-28 20:44:47 +00:00
John McCall ba6a9bd384 Preserve type source information in TypedefDecls. Preserve it across
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-24 08:00:42 +00:00
John McCall 54e14c4db7 When building types from declarators, instead of building two types (one for
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-22 22:37:11 +00:00
Steve Naroff 6a6de8b4fc Extend clang_getCursor() to take a 'relativeDecl' argument (so speed up 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-21 13:56:23 +00:00
John McCall 51bd803fbd Clone the full Type hierarchy into the TypeLoc hierarchy. Normalize
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-18 01:05:36 +00:00
Argyrios Kyrtzidis 0c411806d5 Pull TypeLocVisitor into its own header file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 21:27:32 +00:00
Argyrios Kyrtzidis 5a70ea6c75 Resolve a source location inside the return type of a functon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:58:16 +00:00
Argyrios Kyrtzidis ef6cd6712c Resolve a source location that is inside a type declarator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:45:41 +00:00
Argyrios Kyrtzidis f4526e3fd4 Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:
-A NamedDecl reference
-A TypeLoc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:44:27 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Argyrios Kyrtzidis 8c4dc1ffd2 For a CXXOperatorCallExpr, fix the order that StmtLocResolver uses to check subexpressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 19:02:11 +00:00
Argyrios Kyrtzidis 21b01c7e48 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)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 08:49:56 +00:00
Argyrios Kyrtzidis 0df134715d Resolve a location that is inside an ObjCMethodDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 00:33:52 +00:00
Argyrios Kyrtzidis 7e4fe3b60a Search through all Decls that are DeclContexts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 00:33:40 +00:00
Argyrios Kyrtzidis ada45428b6 If we are not doing a Debug build, no need for the debugging print methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 01:20:03 +00:00
Argyrios Kyrtzidis 2e46aeef8b In ResolveLocationInAST, handle locations that are inside TagDecl definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 03:18:17 +00:00
Argyrios Kyrtzidis a6488a14be Simplify a bit by using functions instead of checking enum values. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 03:41:26 +00:00
Argyrios Kyrtzidis bd2ab6e8f6 Refactor DeclLocResolver/StmtLocResolver into a more functional style by 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-07 00:53:31 +00:00
Argyrios Kyrtzidis 818e15b89f Move the 'ResolveLocationInAST' function from the Frontend library to the 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
2009-07-06 21:35:02 +00:00