Jeffrey Yasskin
f6442f80cb
Allow users to set CPPFLAGS and CXXFLAGS on the make command line.
...
Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)
llvm-svn: 98399
2010-03-12 22:55:16 +00:00
Kovarththanan Rajaratnam
47b55969c3
Cleanup using StringRef
...
llvm-svn: 98339
2010-03-12 09:33:31 +00:00
Douglas Gregor
de4827dd34
Extend ObjCMessageExpr for class method sends with the source location
...
of the class name.
llvm-svn: 97943
2010-03-08 16:40:19 +00:00
Chris Lattner
0bcc858a2b
-fno-rtti is now the default.
...
llvm-svn: 94379
2010-01-24 20:43:31 +00:00
Douglas Gregor
082c3e69eb
Add -cursor-at=file:line:column command line option to c-index-test,
...
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
2010-01-15 19:40:17 +00:00
Ted Kremenek
54ad1ab56f
Add the BlockDecl to the DeclContext.
...
llvm-svn: 90808
2009-12-07 22:01:30 +00:00
John McCall
bcd035061d
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 '{}' \;
llvm-svn: 90743
2009-12-07 02:54:59 +00:00
Daniel Dunbar
98f2067ca4
Update CMake for CallGraph.cpp move.
...
llvm-svn: 90443
2009-12-03 09:14:19 +00:00
Daniel Dunbar
19a30ca8c0
Fix layering violation by moving Analysis/CallGraph to Index
...
llvm-svn: 90424
2009-12-03 07:20:04 +00:00
Benjamin Kramer
337e3a5fea
Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.
...
llvm-svn: 90044
2009-11-28 19:45:26 +00:00
Ted Kremenek
0469b7ea00
Add special clang_getCursor() support for @class . Handles <rdar://problem/7383421>.
...
llvm-svn: 89183
2009-11-18 02:02:52 +00:00
Douglas Gregor
120f6a6675
Silence some warnings produced by Clang, and add a missing header
...
llvm-svn: 89051
2009-11-17 06:14:37 +00:00
John McCall
4c98fd8953
Preserve type source information in sizeof/alignof expressions, and pass it
...
through to indexing.
llvm-svn: 86018
2009-11-04 07:28:41 +00:00
Steve Naroff
58bd62d190
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.
llvm-svn: 85425
2009-10-28 20:44:47 +00:00
John McCall
703a3f8a7b
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.
llvm-svn: 84994
2009-10-24 08:00:42 +00:00
John McCall
fc93cf9777
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.
llvm-svn: 84907
2009-10-22 22:37:11 +00:00
Steve Naroff
20bad0b7c6
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:-)
llvm-svn: 84760
2009-10-21 13:56:23 +00:00
Daniel Dunbar
2c422dc9ca
Move clients to use IdentifierInfo::getNameStart() instead of getName()
...
llvm-svn: 84436
2009-10-18 20:26:12 +00:00
John McCall
1700197e65
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.
llvm-svn: 84386
2009-10-18 01:05:36 +00:00
Douglas Gregor
01249503fe
Installation of Clang libraries and headers, from Axel Naumann!
...
llvm-svn: 83582
2009-10-08 22:15:31 +00:00
Argyrios Kyrtzidis
8da9ce6328
Pull TypeLocVisitor into its own header file.
...
llvm-svn: 83112
2009-09-29 21:27:32 +00:00
Argyrios Kyrtzidis
4361bc1b43
Keep track of type references in DeclReferenceMap.
...
llvm-svn: 83111
2009-09-29 21:26:53 +00:00
Argyrios Kyrtzidis
9c28a3d13c
In ASTVisitor, call the correct base methods.
...
llvm-svn: 83110
2009-09-29 21:26:35 +00:00
Argyrios Kyrtzidis
f881301d3a
Resolve a source location inside the return type of a functon.
...
llvm-svn: 83101
2009-09-29 19:58:16 +00:00
Argyrios Kyrtzidis
05677cae08
Resolve a source location that is inside a type declarator.
...
llvm-svn: 83098
2009-09-29 19:45:41 +00:00
Argyrios Kyrtzidis
4cbe85904c
Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:
...
-A NamedDecl reference
-A TypeLoc
llvm-svn: 83095
2009-09-29 19:44:27 +00:00
Argyrios Kyrtzidis
81aba1fe53
Add more const-goodness to ASTLocation.
...
llvm-svn: 83087
2009-09-29 19:39:53 +00:00
Mike Stump
11289f4280
Remove tabs, and whitespace cleanups.
...
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Douglas Gregor
76d8c5725f
Don't install Clang libraries.
...
llvm-svn: 79824
2009-08-23 05:02:18 +00:00
Argyrios Kyrtzidis
260a4703a9
For a CXXOperatorCallExpr, fix the order that StmtLocResolver uses to check subexpressions.
...
llvm-svn: 77713
2009-07-31 19:02:11 +00:00
Ted Kremenek
118cef36b8
Lexically order files.
...
llvm-svn: 77607
2009-07-30 17:41:23 +00:00
Argyrios Kyrtzidis
fc2ed30ab8
Fix Selector <-> GlobalSelector conversion.
...
llvm-svn: 77575
2009-07-30 03:42:08 +00:00
Eli Friedman
13ddd8514f
Fix gcc warning.
...
llvm-svn: 77555
2009-07-30 00:11:31 +00:00
Argyrios Kyrtzidis
bd92767014
Add support for ObjC message expressions, in the Analyzer:
...
-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.
llvm-svn: 77551
2009-07-30 00:03:55 +00:00
Argyrios Kyrtzidis
ce60c5ea60
Update CMake.
...
llvm-svn: 77548
2009-07-30 00:02:19 +00:00
Argyrios Kyrtzidis
2eff90515f
Support ObjC methods as Entities.
...
llvm-svn: 77547
2009-07-29 23:41:46 +00:00
Argyrios Kyrtzidis
d70a92139f
Index the selectors and provide the translation units that contain them
...
through the IndexProvider.
llvm-svn: 77543
2009-07-29 23:41:18 +00:00
Argyrios Kyrtzidis
b8470e4f75
Introduce SelectorMap whose purpose is to map selectors to objc methods and message exprs,
...
inside a particular ASTContext.
llvm-svn: 77541
2009-07-29 23:40:58 +00:00
Argyrios Kyrtzidis
34be01b9f4
Find references inside blocks.
...
llvm-svn: 77540
2009-07-29 23:40:48 +00:00
Argyrios Kyrtzidis
c3deb79049
Use helper class ASTVisitor to fully traverse an AST.
...
llvm-svn: 77539
2009-07-29 23:40:39 +00:00
Argyrios Kyrtzidis
d219a9a763
Introduce the GlobalSelector class in the Indexing library.
...
GlobalSelector is an ASTContext-independent way to refer to Objective C selectors.
llvm-svn: 77538
2009-07-29 23:40:32 +00:00
Argyrios Kyrtzidis
ca8a0e24cb
Use an IdentifierTable for names used for Entities.
...
llvm-svn: 77537
2009-07-29 23:40:21 +00:00
Argyrios Kyrtzidis
91d3df0b53
-Introduce the idx::Analyzer class used for getting indexing information, like finding
...
references of a declaration across translation units.
-Modify the index-test tool to use it.
llvm-svn: 77536
2009-07-29 23:40:14 +00:00
Argyrios Kyrtzidis
a82e8848ee
Introduce TULocation and TULocationHandler classes.
...
TULocation is like ASTLocation but also contains the TranslationUnit* that
the ASTLocation originated from.
llvm-svn: 77535
2009-07-29 23:40:02 +00:00
Argyrios Kyrtzidis
af79296645
Modify the Indexer class so that it can return the TranslationUnit that internal
...
decls originated from.
llvm-svn: 77534
2009-07-29 23:39:52 +00:00
Argyrios Kyrtzidis
bc6c64de44
Constify ASTLocation::print.
...
llvm-svn: 77532
2009-07-29 23:39:35 +00:00
Argyrios Kyrtzidis
f1a0fd852f
Introduce a helper template for the Handler classes and use it instead
...
of the iterator of the Indexer class.
llvm-svn: 77528
2009-07-29 23:39:03 +00:00
Argyrios Kyrtzidis
d3e037ff89
Add an assert.
...
llvm-svn: 77527
2009-07-29 23:38:51 +00:00
Argyrios Kyrtzidis
14df96c730
Accept Handler objects in parameters as references.
...
Reinforces that they shouldn't be null and it's a bit more natural when
they are passed as stack objects.
llvm-svn: 77526
2009-07-29 23:38:45 +00:00
Argyrios Kyrtzidis
9ddd99ade7
Rename EntityHandler::HandleEntity to Handle.
...
llvm-svn: 77525
2009-07-29 23:38:35 +00:00