aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/IndexingContext.cpp
AgeCommit message (Collapse)Author
2013-04-16Basic support for Microsoft property declarations andJohn McCall
references thereto. Patch by Tong Shen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179585 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18Replace TypeLoc llvm::cast support to be well-defined.David Blaikie
The TypeLoc hierarchy used the llvm::cast machinery to perform undefined behavior by casting pointers/references to TypeLoc objects to derived types and then using the derived copy constructors (or even returning pointers to derived types that actually point to the original TypeLoc object). Some context is in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html Though it's spread over a few months which can be hard to read in the mail archive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175462 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)Dmitri Gribenko
into a getter cxtu::getASTUnit(TU) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173585 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15Fix CastingDavid Greene
Use const_cast<> to avoid a cast-away-const error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172565 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14libclang: remove a few const_castsDmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172373 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-19Add a missing 'else'. Found by grep '} if'Dmitri Gribenko
No testcase because this did not affect correctness: a declaration can only be ClassTemplateDecl or a FunctionTemplateDecl, not both. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170565 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06[libclang] Introduce a new indexing mode where we skip function bodiesArgyrios Kyrtzidis
that were already parsed in the same "indexing session". An indexing session is defined as using the same CXIndexAction object for multiple clang_indexSourceFile calls. Passing CXIndexOpt_SkipParsedBodiesInSession as an indexing option will enable the mode where we try to skip bodies that were already parsed in another translation unit. If a function's body was skipped, the "flags" field in the CXIdxDeclInfo structure will have "CXIdxDeclFlag_Skipped" bit was set. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169539 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04Sort #include lines for tools/...Chandler Carruth
Completely automated with sort_includes.py git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169240 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29Fix name of this file.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166913 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18[libclang] Invoke a ppIncludedFile callback when indexing implicit module ↵Argyrios Kyrtzidis
imports. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05[libclang] Now that we have a CXModule object, pass it to theArgyrios Kyrtzidis
importedASTFile indexing callback. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03[libclang] When indexing, invoke the importedASTFile for PCH files as well.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03[libclang] Simplify indexing of module imports by handling implicitArgyrios Kyrtzidis
imports via ImportDecls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165160 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02[libclang] Implement the importedASTFile indexing callback to provideArgyrios Kyrtzidis
info about imported modules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165020 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-10[libclang] Do index 'extern' declarations inside functions.Argyrios Kyrtzidis
rdar://12257073 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163563 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-31Normalize line endings of r163013 (part 2).Joao Matos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163032 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-31Improved MSVC __interface support by adding first class support for it, ↵Joao Matos
instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31[libclang] Fix use-after-free bug when handling attributes indexing info.Argyrios Kyrtzidis
When indexing a property with a getter/setter with attributes, the allocated memory for AttrListInfo could get released before its destructor is run. Fixes rdar://11113442. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153792 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28[AST] When we @synthesize a property with a user-defined ivar name,Argyrios Kyrtzidis
make sure to record the source location of the ivar name. [libclang] When indexing @synthesized objc methods, report the @implementation as the lexical container. Fixes rdar://10905472 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151635 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28[libclang] When indexing an objc property, also provide information aboutArgyrios Kyrtzidis
the getter/setter objc method entities that the property is associated with. rdar://10244558 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151634 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15Implement indexing support for lambdas in libclang (both kinds), asDouglas Gregor
well as improving the RecursiveASTVisitor's walk of lambda expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150549 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14[libclang] Indexing: only index implicit template instantiations via an ↵Argyrios Kyrtzidis
opt-in indexing option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150517 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13drop more llvm:: prefixes on SmallString<>Dylan Noblesmith
More cleanup after r149799. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150380 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10[libclang] Indexing API: Fully index implict template instantiations.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150267 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08[libclang] Indexing: When suppressing references, suppress referencesArgyrios Kyrtzidis
of bases in C++ classes. rdar://10768707 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150048 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07[libclang] Do not index implicit C++ member functions. rdar://10769813Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06Added location for template keyword in TemplateSpecializationTypeLoc. In the ↵Abramo Bagnara
process removed some naming ambiguities. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149870 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23[libclang] For:Argyrios Kyrtzidis
@implementation I(cat) suppress subsequent references to 'I'. rdar://10568103 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148730 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23Introduce CXXRecordDecl::isCLike() that is true if the class is C-like,Argyrios Kyrtzidis
without C++-specific features. Use it to set the language to C++ when indexing non-C-like structs. rdar://10732579 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148708 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20[libclang] Fix crash when indexing attributes, rdar://10702250.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148524 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17[libclang] Make sure Preprocessor is set in ASTUnit during indexing.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148319 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-14De-virtualize getPreviousDecl() and getMostRecentDecl() when we knowDouglas Gregor
we have a redeclarable type, and only use the new virtual versions (getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have that type information. This keeps us from penalizing users with strict type information (and is the moral equivalent of a "final" method). Plus, settle on the names getPreviousDecl() and getMostRecentDecl() throughout. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148187 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-14[libclang] If CXIndexOpt_IndexFunctionLocalSymbols is enabled, alsoArgyrios Kyrtzidis
index parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148169 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-14[libclang] Add CXIndexOpt_IndexFunctionLocalSymbols indexing option to indicateArgyrios Kyrtzidis
that one wants indexing callbacks for function-local symbols as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148160 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor
ObjCProtocolDecl modules forward declarations properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01Move the data that corresponds to the definition of a protocol into aDouglas Gregor
separately-allocated DefinitionData structure. Introduce various functions that will help with the separation of declarations from definitions (isThisDeclarationADefinition(), hasDefinition(), getDefinition()). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147408 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-27Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor
covers both declarations (@class) and definitions (@interface) of an Objective-C class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15Move the definition-specific data of ObjCInterfaceDecl into aDouglas Gregor
separately-allocated DefinitionData structure, which we manage the same way as CXXRecordDecl::DefinitionData. This prepares the way for making ObjCInterfaceDecls redeclarable, to more accurately model forward declarations of Objective-C classes and eliminate the mutation of ObjCInterfaceDecl that causes us serious trouble in the AST reader. Note that ObjCInterfaceDecl's accessors are fairly robust against being applied to forward declarations, because Clang (and Sema in particular) doesn't perform RequireCompleteType/hasDefinition() checks everywhere it has to. Each of these overly-robust cases is marked with a FIXME, which we can tackle over time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15[libclang] Indexing API: provide an attribute list inside CXIdxEntityInfoArgyrios Kyrtzidis
so that we can access the attributes of an entity for a reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146616 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15[libclang] Suppress indexing references for occurrences of the interfaceArgyrios Kyrtzidis
in a superclass and the protocols in a protocol list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146615 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline itsDouglas Gregor
members into ObjCClassDecl, saving ourselves one pointer per forward declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146564 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13[libclang] Indexing API: Provide the protocols list for objc categories as well.Argyrios Kyrtzidis
rdar://10573361 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146498 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13[libclang] Indexing API: Fix suppressing of references in macros and suppressArgyrios Kyrtzidis
@class forward references. rdar://10568080&10568103&10568119 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146496 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146213 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08[libclang] Remove IndexingContext's getScopedContext(), it's not usefulArgyrios Kyrtzidis
now that client containers can be set via function calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07[libclang] Indexing API: provide both the semantic and the lexical container.Argyrios Kyrtzidis
They are generally the same except in C++ cases like out-of-line member functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146069 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07[libclang] Fix indexing of C++ bases in a C++ class.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07[libclang] Introduce CXIdxEntityLanguage that indicates the languageArgyrios Kyrtzidis
of an indexed entity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146067 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07[libclang] Index C++ namespaces.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146019 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05[libclang] When indexing a field in a C++ class, return an entityArgyrios Kyrtzidis
of kind CXIdxEntity_CXXInstanceVariable. rdar://10522503. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145859 91177308-0d34-0410-b5e6-96231b3b80d8