summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/Indexing.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Sort #include lines for tools/...Chandler Carruth2012-12-041-10/+9
| | | | | | Completely automated with sort_includes.py llvm-svn: 169240
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-231-6/+6
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* [libclang] Invoke a ppIncludedFile callback when indexing implicit module ↵Argyrios Kyrtzidis2012-10-181-16/+11
| | | | | | imports. llvm-svn: 166161
* Disable the preprocessing record when indexing a source fileArgyrios Kyrtzidis2012-10-101-0/+3
| | | | | | and modules are not enabled. llvm-svn: 165593
* When indexing a module file, for the ppIncludedFile callback giveArgyrios Kyrtzidis2012-10-101-2/+9
| | | | | | | an invalid location if the location points to the synthetic buffer for the module input. llvm-svn: 165592
* [libclang] Don't disable the preprocessing record while indexing so asArgyrios Kyrtzidis2012-10-061-20/+4
| | | | | | | | | | | | to not mess up with module building. It was not worth trying to combine indexing without preprocessing record and building modules with one because: -just importing a module/PCH that was built with a pp record, enables it anyway -the performance gain of indexing without the preprocessing record is insignificant. llvm-svn: 165352
* [libclang] When indexing, invoke the importedASTFile for PCH files as well.Argyrios Kyrtzidis2012-10-031-1/+11
| | | | llvm-svn: 165161
* [libclang] Simplify indexing of module imports by handling implicitArgyrios Kyrtzidis2012-10-031-2/+1
| | | | | | imports via ImportDecls. llvm-svn: 165160
* Some renames to use the 'visitor' nomenclature, no functionality change.Argyrios Kyrtzidis2012-10-031-2/+2
| | | | llvm-svn: 165083
* [libclang] When indexing an AST file, only deserialize the file levelArgyrios Kyrtzidis2012-10-021-23/+9
| | | | | | declarations of the current primary module. llvm-svn: 165046
* [libclang] When indexing an AST file, only deserialize the preprocessing recordArgyrios Kyrtzidis2012-10-021-12/+1
| | | | | | entities of the current primary module. llvm-svn: 165023
* Add info in the preprocessing record whether an inclusion directiveArgyrios Kyrtzidis2012-10-021-1/+2
| | | | | | resulted in an automatic module import. llvm-svn: 165022
* [libclang] Even though we disable the preprocessing record during indexing,Argyrios Kyrtzidis2012-10-021-5/+18
| | | | | | make sure that it gets enabled for when a module needs to be created. llvm-svn: 165021
* [libclang] Implement the importedASTFile indexing callback to provideArgyrios Kyrtzidis2012-10-021-0/+6
| | | | | | info about imported modules. llvm-svn: 165020
* For PPCallbacks::InclusionDirective() add a parameter for the module, wheneverArgyrios Kyrtzidis2012-09-291-1/+2
| | | | | | | an inclusion directive was automatically turned into a module import, and PPCallbacks::moduleImport() for an explicit module import. llvm-svn: 164874
* Per discussion in ↵Argyrios Kyrtzidis2012-09-271-1/+1
| | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets. rdar://11113134 & http://llvm.org/PR13880 llvm-svn: 164743
* [libclang] Do a AST concurrency check in clang_indexTranslationUnit_Impl.Argyrios Kyrtzidis2012-09-251-0/+2
| | | | llvm-svn: 164626
* Introduce a flag in SourceManager to treat non-system source filesArgyrios Kyrtzidis2012-07-111-2/+5
| | | | | | | | | | | | | | | | | | | | as "volatile", meaning there's a high enough chance that they may change while we are trying to use them. This flag is only enabled by libclang. Currently "volatile" source files will be stat'ed immediately before opening them, because the file size stat info may not be accurate since when we got it (e.g. from the PCH). This avoids crashes when trying to reference mmap'ed memory from a file whose size is not what we expect. Note that there's still a window for a racing issue to occur but the window for it should be way smaller than before. We can consider later on to avoid mmap completely on such files. rdar://11612916 llvm-svn: 160074
* [libclang] Don't bind a StringRef to a temporary std::string object.Argyrios Kyrtzidis2012-06-281-2/+1
| | | | | | | | It may end up pointing at garbage. Fixes the MSVC debug build. rdar://11703319 llvm-svn: 159377
OpenPOWER on IntegriCloud