summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/Indexing.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [index] Allow calling createIndexingAction() without passing another action ↵Argyrios Kyrtzidis2016-02-141-2/+3
| | | | | | to wrap over. llvm-svn: 260841
* [libclang] Separate the underlying indexing functionality of libclang and ↵Argyrios Kyrtzidis2016-02-121-111/+57
| | | | | | | | 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: Enable skip-parsed-bodies on win32.NAKAMURA Takumi2016-02-101-22/+0
| | | | | | I guess it would be working since Rafael's r187619. llvm-svn: 260344
* [libclang] indexing: handle 'TopLevelDeclInObjCContainers' at the point ↵Argyrios Kyrtzidis2016-02-091-3/+2
| | | | | | | | where they are reported. It isn't much benefit and doesn't worth the complexity to try to handle them after the container is encountered. llvm-svn: 260254
* Refactor: Simplify boolean conditional return statements in tools/libclangAlexander Kornienko2015-12-281-3/+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
* [libclang] Add a flag to create the precompiled preamble on the first parse.Benjamin Kramer2015-12-151-1/+9
| | | | | | | | | | | | | | | | | | | | | Summary: The current default is to create the preamble on the first reparse, aka second parse. This is useful for clients that do not want to block when opening a file because serializing the preamble takes a bit of time. However, this makes the reparse much more expensive and that may be on the critical path as it's the first interaction a user has with the source code. YouCompleteMe currently optimizes for the first code interaction by parsing the file twice when loaded. That's just unnecessarily slow and this flag helps to avoid that. Reviewers: doug.gregor, klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15490 llvm-svn: 255635
* [libclang] Make sure to use the raw module format for libclang parsing.Argyrios Kyrtzidis2015-11-201-0/+4
| | | | | | | Fixes crash when passing '-gmodules' in the compiler options. rdar://23588717 llvm-svn: 253645
* [libclang] Add entry points that take a full command line including argv[0].Benjamin Kramer2015-11-181-0/+16
| | | | | | | | | | | | This provides both a more uniform interface and makes libclang behave like clang tooling wrt relative paths against argv[0]. This is necessary for finding paths to a c++ standard library relative to a clang binary given in a compilation database. It can also be used to find paths relative to libclang.so if the full path to it is passed in. Differential Revision: http://reviews.llvm.org/D14695 llvm-svn: 253466
* Roll-back r250822.Angel Garcia Gomez2015-10-201-1/+3
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-3/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* [libclang] Use lambdas instead of explicit structs when storing arguments.Benjamin Kramer2015-07-251-100/+46
| | | | | | | This boilerplate code was necessary to move arguments between threads in C++98, lambdas make this much easier. No functionality change intended. llvm-svn: 243227
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Introduce a PCHContainerOperations interface (NFC).Adrian Prantl2015-06-201-13/+8
| | | | | | | | | | | | | | | | A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 llvm-svn: 240225
* Switch PPCallbacks to take the new MacroDefinition instead of ↵Richard Smith2015-05-041-2/+2
| | | | | | MacroDirective*, in order to preserve full information on module macro expansion. llvm-svn: 236404
* Update APIs that return a pair of iterators to return an iterator_range instead.Benjamin Kramer2015-02-061-6/+1
| | | | | | Convert uses of those APIs into ranged for loops. NFC. llvm-svn: 228404
* Unique_ptrify PPCallbacks ownership.Craig Topper2014-09-101-2/+2
| | | | | | Unique_ptr creation stil needs to be moved earlier at some of the call sites. llvm-svn: 217474
* Update for LLVM api change.Rafael Espindola2014-08-271-3/+3
| | | | llvm-svn: 216585
* Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)David Blaikie2014-08-101-6/+5
| | | | | | | | After post-commit review and community discussion, this seems like a reasonable direction to continue, making ownership semantics explicit in the source using the type system. llvm-svn: 215323
* Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie2014-07-171-5/+6
| | | | | | | | | This reverts commit r213307. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. llvm-svn: 213325
* unique_ptr-ify ownership of ASTConsumersDavid Blaikie2014-07-171-6/+5
| | | | | | | | | (after fixing a bug in MultiplexConsumer I noticed the ownership of the nested consumers was implemented with raw pointers - so this fixes that... and follows the source back to its origin pushing unique_ptr ownership up through there too) llvm-svn: 213307
* libclang: pass return code out argument by referenceAlp Toker2014-07-071-8/+6
| | | | | | | | r212427 formalized the message-passing pattern by making these argument structures const. This commit changes output arguments to get passed by reference so we can eliminate mutable fields. llvm-svn: 212497
* libclang: refactor handling of unsaved_filesAlp Toker2014-07-071-33/+30
| | | | | | | Consolidate CXUnsavedFile argument handling in API functions to support a wider cleanup of various file remapping schemes in the frontend. llvm-svn: 212427
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-051-4/+4
| | | | llvm-svn: 212369
* Remove 'const' from MemoryBuffers used through the SourceManagerDavid Blaikie2014-06-271-2/+2
| | | | | | | | | | | | | | This removes a const_cast added in r211884 that occurred due to an inconsistency in how MemoryBuffers are handled between some parts of clang and LLVM. MemoryBuffers are immutable and the general convention in the LLVM project is to omit const from immutable types as it's simply redundant/verbose (see llvm::Type, for example). While this change doesn't remove "const" from /every/ MemoryBuffer, it at least makes this chain of ownership/usage consistent. llvm-svn: 211915
* [C++11] Use 'nullptr'. Tools edition.Craig Topper2014-06-081-24/+24
| | | | llvm-svn: 210422
* Honour -ivfsoverlay in ASTUnit to match clangBen Langmuir2014-04-151-0/+5
| | | | | | | This allows code indexing, etc. to use the VFS in the same way as the compiler. llvm-svn: 206309
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-151-36/+28
| | | | | | class. llvm-svn: 204002
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-10/+11
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-3/+3
| | | | llvm-svn: 202639
* libclang: report error code for bad PCH filesDmitri Gribenko2014-02-121-10/+28
| | | | | | | | | | | | | | | | | | | This commit improves libclang to report the error condition when CXTranslationUnit can not be created because of a stale PCH file. This allows the caller, for example, to rebuild the PCH file and retry the request. There two are APIs in libclang that return a CXTranslationUnit and don't support reporting detailed errors (the only error condition is a NULL result). For these APIs, a second, superior, version is introduced -- clang_createTranslationUnit2 and clang_parseTranslationUnit2. These functions return a CXTranslationUnit indirectly and also return an error code. Old functions are still supported and are nothing more than convenience wrappers that ignore extended error codes. As a cleanup, this commit also categorizes some libclang errors in the functions I had to modify anyway. llvm-svn: 201249
* Fix a typo in the function name that I just introduced (r201155)Dmitri Gribenko2014-02-111-1/+1
| | | | llvm-svn: 201156
* libclang: audit all APIs that accept a CXTranslationUnit to make sure thatDmitri Gribenko2014-02-111-1/+3
| | | | | | | checks for invalid translation unit are in place. Also, while there, add log output for this case. llvm-svn: 201155
* Use cstdio instead of stdio.hDmitri Gribenko2013-08-191-1/+1
| | | | llvm-svn: 188678
* libclang: cleanup unused includes in public headerDmitri Gribenko2013-08-181-0/+1
| | | | llvm-svn: 188625
* Assume UniqueID is zero for invalid PPRegion to fix uninitialized reads ↵Alexey Samsonov2013-08-021-1/+1
| | | | | | reported by MSan llvm-svn: 187647
* Use llvm::sys::fs::UniqueID for windows and unix.Rafael Espindola2013-08-011-21/+22
| | | | | | | | | | | | | | | | | | | This unifies the unix and windows versions of FileManager::UniqueDirContainer and FileManager::UniqueFileContainer by using UniqueID. We cannot just replace "struct stat" with llvm::sys::fs::file_status, since we want to be able to construct fake ones, and file_status has different members on unix and windows. What the patch does is: * Record only the information that clang is actually using. * Use llvm::sys::fs::status instead of stat and fstat. * Use llvm::sys::fs::UniqueID * Delete the old windows versions of UniqueDirContainer and UniqueFileContainer since the "unix" one now works on windows too. llvm-svn: 187619
* Remove DiagnosticConsumer::clone(), a bad idea that is now unused.Douglas Gregor2013-05-031-6/+1
| | | | llvm-svn: 181070
* [Preprocessor] For the MacroExpands preprocessor callback, also pass the ↵Argyrios Kyrtzidis2013-05-031-1/+1
| | | | | | | | MacroArgs object that provides information about the argument tokens for a function macro. llvm-svn: 181065
* [libclang] If libclang logging is enabled, print all compiler diagnostics to ↵Argyrios Kyrtzidis2013-03-291-3/+7
| | | | | | stderr instead of capturing them. llvm-svn: 178373
* [preprocessor] Use MacroDirective in the preprocessor callbacks to make ↵Argyrios Kyrtzidis2013-02-241-3/+4
| | | | | | | | available the full information about the macro (e.g if it was imported and where). llvm-svn: 175978
* libclang: remove 'using namespace cxstring'Dmitri Gribenko2013-02-031-1/+0
| | | | llvm-svn: 174285
* Attempt to fix Windows build breakage.Evgeniy Stepanov2013-01-311-1/+2
| | | | llvm-svn: 174060
* libclang: type safety for CXTranslationUnitImpl::CIdxDmitri Gribenko2013-01-261-1/+1
| | | | llvm-svn: 173590
* libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)Dmitri Gribenko2013-01-261-1/+1
| | | | | | into a getter cxtu::getASTUnit(TU) llvm-svn: 173585
* Nuke SetUpBuildDumpLog.Sean Silva2013-01-201-2/+0
| | | | | | | Also, it was the only reason that `argc` and `argv` were being passed into createDiagnostics, so remove those parameters and clean up callers. llvm-svn: 172945
* Re-sort all the headers. Lots of regressions have crept in here.Chandler Carruth2013-01-191-1/+1
| | | | | | | | | | Manually fix the order of UnwrappedLineParser.cpp as that one didn't have its associated header as the first header. This also uncovered a subtle inclusion order dependency as CLog.h didn't include LLVM.h to pick up using declarations it relied upon. llvm-svn: 172892
* [libclang] Enhance logging capabilities of libclang.Argyrios Kyrtzidis2013-01-101-0/+9
| | | | | | | | | -provide a "raw_ostream'ish" class to make it convenient to output logging info. -use macros to automate a bit the logging functionality inside libclang functions -when logging, print a stack trace if "LIBCLANG_LOGGING=2" environment is set. -add logging to more functions. llvm-svn: 172089
* Re-sort #include lines using the llvm/utils/sort_includes.py script.Chandler Carruth2013-01-021-2/+2
| | | | | | | Removes a duplicate #include as well as cleaning up some sort order regressions since I last ran the script over Clang. llvm-svn: 171364
* [libclang] Introduce a new indexing mode where we skip function bodiesArgyrios Kyrtzidis2012-12-061-14/+273
| | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud