summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/IndexingContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libclang] Separate the underlying indexing functionality of libclang and ↵Argyrios Kyrtzidis2016-02-121-1173/+0
| | | | | | | | introduce it into the clangIndex library. It is a general goodness for libclang itself to mostly be a wrapper of functionality provided by the libraries. llvm-svn: 260760
* [libclang] indexing: for a synthesized property reference have the parent be ↵Argyrios Kyrtzidis2016-02-091-2/+3
| | | | | | the ObjC implementation decl. llvm-svn: 260253
* [libclang] indexing: Have the semantic container of synthesized ObjC ↵Argyrios Kyrtzidis2016-02-091-4/+7
| | | | | | | | getter/setter methods be the implementation decl. Matches the behavior of other ObjC methods. llvm-svn: 260250
* Refactor: Simplify boolean conditional return statements in tools/libclangAlexander Kornienko2015-12-281-4/+1
| | | | | | | | | | | | | | Summary: Use clang-tidy to simplify boolean conditional return statements. Reviewers: alexfh Subscribers: alexfh, chfast, cfe-commits Patch by Richard Thomson! Differential Revision: http://reviews.llvm.org/D10024 llvm-svn: 256498
* [C++11] Use 'nullptr'. Tools edition.Craig Topper2014-06-081-29/+32
| | | | llvm-svn: 210422
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-3/+1
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* [C++11] Replacing Decl iterators attr_begin() and attr_end() with ↵Aaron Ballman2014-03-081-3/+1
| | | | | | | | iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops. This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage. llvm-svn: 203362
* Fully reverting r203236 -- it seems the only bots that are happy are the ↵Aaron Ballman2014-03-071-1/+3
| | | | | | MSVC bots. llvm-svn: 203237
* [C++11] Replacing iterators attr_begin() and attr_end() with iterator_range ↵Aaron Ballman2014-03-071-3/+1
| | | | | | attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203236
* Fix typo: s/Occurence/Occurrence/Alp Toker2013-11-301-3/+3
| | | | | | This is a private class member so the fix shouldn't impact external projects. llvm-svn: 195985
* Remove a whole lot of unused variablesAlp Toker2013-11-271-1/+0
| | | | | | | There are about 30 removed in this patch, generated by a new FixIt I haven't got round to submitting yet. llvm-svn: 195814
* Store a TypeArgument on an attribute as a TypeSourceInfo*, rather than as aRichard Smith2013-10-311-3/+5
| | | | | | QualType with a SourceLocation stashed alongside. llvm-svn: 193803
* Factor out custom parsing for iboutletcollection and vec_type_hint attributesRichard Smith2013-10-311-2/+2
| | | | | | | | | into a separate "parse an attribute that takes a type argument" codepath. This results in both codepaths being a lot cleaner and simpler, and fixes some bugs where the type argument handling bled into the expression argument handling and caused us to both accept invalid and reject valid attribute arguments. llvm-svn: 193731
* Rename some functions for consistency.Rafael Espindola2013-10-171-4/+4
| | | | | | Every other function in Redeclarable.h was using Decl instead of Declaration. llvm-svn: 192900
* Remove unnecessary inclusion of Sema.hDavid Blaikie2013-09-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let me tell you a tale... Within some twisted maze of debug info I've ended up implementing an insane man's Include What You Use device. When the debugger emits debug info it really shouldn't, I find out why & then realize the code could be improved too. In this instance CIndexDiagnostics.cpp had a lot more debug info with Clang than GCC. Upon inspection a major culprit was all the debug info describing clang::Sema. This was emitted because clang::Sema is befriended by DiagnosticEngine which was rightly required, but GCC doesn't emit debug info for friends so it never emitted anything for Clang. Clang does emit debug info for friends (will be fixed/changed to reduce debug info size). But why didn't Clang just emit a declaration of Sema if this entire TU didn't require a definition? 1) Diagnostic.h did the right thing, only using a declaration of Sema and not including Sema.h at all. 2) Some other dependency of CIndexDiagnostics.cpp didn't do the right thing. ASTUnit.h, only needing a declaration, still included Sema.h (hence this commit which removes that include and adds the necessary includes to the cpp files that were relying on this) 3) -flimit-debug-info didn't save us because of EnterExpressionEvaluationContext, defined inline in Sema.h which fires the "requiresCompleteType" check/flag (since it uses nested types from Sema and calls Sema member functions) and thus, if debug info is ever emitted for the type, the whole type is emitted and not just a declaration. Improving -flimit-debug-info to account for this would be... hard. Modifying the code so that's not 'required to be complete' might be possible, but probably only by moving EnterExpressionEvaluationContext either into Sema, or out of Sema.h. That might be a bit too much of a contortion to be bothered with. Also, this is only one of the cases where emitting debug info for friends caused us to emit a lot more debug info (this change reduces Clang's DWO size by 0.93%, dropping friends entirely reduces debug info by 3.2%) - I haven't hunted down the other cases, but I assume they might be similar (Sema or something like it). IWYU or a similar tool might help us reduce build times a bit, but analyzing debug info to find these differences isn't worthwhile. I'll take the 3.2% win, provide this small improvement to the code itself, and move on. llvm-svn: 190715
* Fix linkage computation for derived types in inline functions.Rafael Espindola2013-05-251-0/+1
| | | | | | | | | | | | | | | | | John noticed that the fix for pr15930 (r181981) didn't handle indirect uses of local types. For example, a pointer to local struct, or a function that returns it. One way to implement this would be to recursively look for local types. This would look a lot like the linkage computation itself for types. To avoid code duplication and utilize the existing linkage cache, this patch just makes the computation of "type with no linkage but externally visible because it is from an inline function" part of the linkage computation itself. llvm-svn: 182711
* Cleanup handling of UniqueExternalLinkage.Rafael Espindola2013-05-131-1/+2
| | | | | | | | | | | | | This patch renames getLinkage to getLinkageInternal. Only code that needs to handle UniqueExternalLinkage specially should call this. Linkage, as defined in the c++ standard, is provided by getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage. Most places in the compiler actually want isExternallyVisible, which handles UniqueExternalLinkage as internal. llvm-svn: 181677
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-0/+6
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-10/+10
| | | | | | | | | | | | | | 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. llvm-svn: 175462
* libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)Dmitri Gribenko2013-01-261-2/+2
| | | | | | into a getter cxtu::getASTUnit(TU) llvm-svn: 173585
* Fix CastingDavid Greene2013-01-151-6/+11
| | | | | | Use const_cast<> to avoid a cast-away-const error. llvm-svn: 172565
* libclang: remove a few const_castsDmitri Gribenko2013-01-141-3/+2
| | | | llvm-svn: 172373
* Add a missing 'else'. Found by grep '} if'Dmitri Gribenko2012-12-191-1/+1
| | | | | | | No testcase because this did not affect correctness: a declaration can only be ClassTemplateDecl or a FunctionTemplateDecl, not both. llvm-svn: 170565
* [libclang] Introduce a new indexing mode where we skip function bodiesArgyrios Kyrtzidis2012-12-061-4/+24
| | | | | | | | | | | | | | | 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. llvm-svn: 169539
* Sort #include lines for tools/...Chandler Carruth2012-12-041-3/+2
| | | | | | Completely automated with sort_includes.py llvm-svn: 169240
* Fix name of this file.Nick Lewycky2012-10-291-1/+1
| | | | llvm-svn: 166913
* [libclang] Invoke a ppIncludedFile callback when indexing implicit module ↵Argyrios Kyrtzidis2012-10-181-2/+3
| | | | | | imports. llvm-svn: 166161
* [libclang] Now that we have a CXModule object, pass it to theArgyrios Kyrtzidis2012-10-051-6/+4
| | | | | | importedASTFile indexing callback. llvm-svn: 165281
* [libclang] When indexing, invoke the importedASTFile for PCH files as well.Argyrios Kyrtzidis2012-10-031-0/+15
| | | | llvm-svn: 165161
* [libclang] Simplify indexing of module imports by handling implicitArgyrios Kyrtzidis2012-10-031-9/+10
| | | | | | imports via ImportDecls. llvm-svn: 165160
* [libclang] Implement the importedASTFile indexing callback to provideArgyrios Kyrtzidis2012-10-021-0/+21
| | | | | | info about imported modules. llvm-svn: 165020
* [libclang] Do index 'extern' declarations inside functions.Argyrios Kyrtzidis2012-09-101-1/+21
| | | | | | rdar://12257073 llvm-svn: 163563
* Normalize line endings of r163013 (part 2).Joao Matos2012-08-311-10/+10
| | | | llvm-svn: 163032
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-6/+10
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* [libclang] Fix use-after-free bug when handling attributes indexing info.Argyrios Kyrtzidis2012-03-311-27/+19
| | | | | | | | | 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. llvm-svn: 153792
* [AST] When we @synthesize a property with a user-defined ivar name,Argyrios Kyrtzidis2012-02-281-5/+10
| | | | | | | | | | 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 llvm-svn: 151635
* [libclang] When indexing an objc property, also provide information aboutArgyrios Kyrtzidis2012-02-281-2/+20
| | | | | | | | the getter/setter objc method entities that the property is associated with. rdar://10244558 llvm-svn: 151634
* Implement indexing support for lambdas in libclang (both kinds), asDouglas Gregor2012-02-151-1/+3
| | | | | | | well as improving the RecursiveASTVisitor's walk of lambda expressions. llvm-svn: 150549
* [libclang] Indexing: only index implicit template instantiations via an ↵Argyrios Kyrtzidis2012-02-141-11/+11
| | | | | | opt-in indexing option. llvm-svn: 150517
* drop more llvm:: prefixes on SmallString<>Dylan Noblesmith2012-02-131-2/+2
| | | | | | More cleanup after r149799. llvm-svn: 150380
* [libclang] Indexing API: Fully index implict template instantiations.Argyrios Kyrtzidis2012-02-101-2/+27
| | | | llvm-svn: 150267
* [libclang] Indexing: When suppressing references, suppress referencesArgyrios Kyrtzidis2012-02-081-0/+13
| | | | | | of bases in C++ classes. rdar://10768707 llvm-svn: 150048
* [libclang] Do not index implicit C++ member functions. rdar://10769813Argyrios Kyrtzidis2012-02-071-1/+1
| | | | llvm-svn: 150007
* Added location for template keyword in TemplateSpecializationTypeLoc. In the ↵Abramo Bagnara2012-02-061-1/+1
| | | | | | process removed some naming ambiguities. llvm-svn: 149870
* [libclang] For:Argyrios Kyrtzidis2012-01-231-0/+3
| | | | | | | | | @implementation I(cat) suppress subsequent references to 'I'. rdar://10568103 llvm-svn: 148730
* Introduce CXXRecordDecl::isCLike() that is true if the class is C-like,Argyrios Kyrtzidis2012-01-231-5/+2
| | | | | | | | | without C++-specific features. Use it to set the language to C++ when indexing non-C-like structs. rdar://10732579 llvm-svn: 148708
* [libclang] Fix crash when indexing attributes, rdar://10702250.Argyrios Kyrtzidis2012-01-201-1/+1
| | | | llvm-svn: 148524
* [libclang] Make sure Preprocessor is set in ASTUnit during indexing.Argyrios Kyrtzidis2012-01-171-0/+4
| | | | llvm-svn: 148319
* De-virtualize getPreviousDecl() and getMostRecentDecl() when we knowDouglas Gregor2012-01-141-2/+2
| | | | | | | | | | | | 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. llvm-svn: 148187
* [libclang] If CXIndexOpt_IndexFunctionLocalSymbols is enabled, alsoArgyrios Kyrtzidis2012-01-141-1/+5
| | | | | | index parameters. llvm-svn: 148169
OpenPOWER on IntegriCloud