summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a typo.Adrian Prantl2015-06-181-1/+1
| | | | llvm-svn: 240025
* Revert r237339 as sanitizer-ppc64-linux1 does not like it.Yaron Keren2015-05-141-7/+6
| | | | | | | | | | | | | | | | | | | Complains: /home/buildbots/sanitizerslave1/sanitizer-ppc64-1/build/llvm/tools/clang/tools/c-index-test/c-index-test.c:829:30: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat] I, TAK, clang_Cursor_getTemplateArgumentValue(Cursor, I)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I'm not sure now how this should be fixed. %lld is non-standard and not accepted by mingw on Windows while PRId64 is bad for this bot. Is long long longer than 64 bits here? if not, why is PRId64 incompatible with it? something seems wrong. Probably all the datatypes should be replaced to unsigned or uint64_t depending upin requirements instead of the non standard long long. llvm-svn: 237346
* Replace non-standard %lld printf usage with PRId64.Yaron Keren2015-05-141-6/+7
| | | | | | See also r180024. llvm-svn: 237339
* [libclang] Add functions to get information about fields.Argyrios Kyrtzidis2015-04-131-18/+41
| | | | | | Patch by Loïc Jaquemet! llvm-svn: 234762
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-4/+2
| | | | llvm-svn: 230454
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-251-2/+4
| | | | | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. This reapplies r230044 with a fixed configure+make build and updated dependencies and testcase requirements. Over the last iteration this version adds - missing target requirements for testcases that specify an x86 triple, - a missing clangCodeGen.a dependency to libClang.a in the make build. rdar://problem/19104245 llvm-svn: 230423
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-241-4/+5
| | | | | | | This reverts commit r230305. Off to fix another round of missing dependencies on various platforms. llvm-svn: 230309
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-241-5/+4
| | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. Take 3. llvm-svn: 230305
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-211-3/+1
| | | | | | | | This reverts commit 230099. The Linux configure+make build variant still needs some work. llvm-svn: 230103
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-1/+3
| | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. Take 2. llvm-svn: 230089
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-201-3/+1
| | | | | | | | This reverts commit r230067. Investigating another batch of problems found by the bots. llvm-svn: 230073
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-1/+3
| | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. llvm-svn: 230067
* This reverts commit r227432, r227438 and r227448.Rafael Espindola2015-01-291-41/+18
| | | | | | | | | | | | | | | | | | | | | | | It should bring the bots back. Original messagses: r227448: Remove unnecessary default. r227438: Fix Index/print-type.cpp test following r227432. r227432: libclang: Add three functions useful for dealing with anonymous fields: clang_Cursor_getOffsetOfField clang_Cursor_isAnonymous clang_Type_visitFields Python: Add corresponding methods for dealing with anonymous fields. Patch by Loïc Jaquemet llvm-svn: 227472
* libclang: Add three functions useful for dealing with anonymous fields:Francois Pichet2015-01-291-18/+41
| | | | | | | | | | | clang_Cursor_getOffsetOfField clang_Cursor_isAnonymous clang_Type_visitFields Python: Add corresponding methods for dealing with anonymous fields. Patch by Loïc Jaquemet llvm-svn: 227432
* Support LLVM_BUILD_STATIC.Rafael Espindola2014-11-051-2/+8
| | | | llvm-svn: 221346
* [autoconf] Add clangToolingCore.a to Makefile(s) for static build w/o ↵NAKAMURA Takumi2014-10-301-0/+1
| | | | | | libclang.dll. llvm-svn: 220904
* Add libclang capabilities to retriete template arguments from specializations.Eli Bendersky2014-10-101-2/+29
| | | | | | | | | Includes Python bindings. Reviewed in http://reviews.llvm.org/D5621 Patch by Rob Springer llvm-svn: 219529
* Fix a memory leak in one of the test unit. Silent coverity warning CID 1095912Sylvestre Ledru2014-08-181-0/+1
| | | | llvm-svn: 215898
* Fix a memory leak - dispose of the CXString after printing it in mangling.Eli Bendersky2014-08-011-0/+1
| | | | | | Thanks to kcc@ for noticing. llvm-svn: 214506
* Exposes a C API to name mangling for a given cursor.Eli Bendersky2014-07-311-0/+15
| | | | | | | | | Inspired by https://gist.github.com/tritao/2766291, and was previously discussed on cfe-dev: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-June/037577.html Adding testing capability via c-index-test. llvm-svn: 214410
* Make clang's rewrite engine a core featureAlp Toker2014-07-161-1/+1
| | | | | | | | | | | | | | | The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. llvm-svn: 213171
* Fix C++ style // comments in a couple of C filesTimur Iskhodzhanov2014-06-061-2/+2
| | | | llvm-svn: 210325
* Flush C stdio streams upon process terminationReid Kleckner2014-06-051-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to what can only be described as a CRT bug, stdout and amazingly even stderr are not always flushed upon process termination, especially when the system is under high threading pressure. I have found two repros for this: 1) In lib\Support\Threading.cpp, change sys::Mutex to an std::recursive_mutex and run check-clang. Usually between 30 and 40 tests will fail. 2) Add OutputDebugStrings in code that runs during static initialization and static shutdown. This will sometimes generate similar failures. After a substantial amount of troubleshooting and debugging, I found that I could reproduce this from the command line without running check-clang. Simply make the mutex change described in #1, then manually run the following command many times by running it once, then pressing Up -> Enter very quickly: D:\src\llvm\build\vs2013\Debug\bin\c-index-test.EXE -cursor-at=D:\src\llvm\tools\clang\test\Index\targeted-preamble.h:2:15 D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -include D:\src\llvm\build\vs2013\tools\clang\test\Index\Output\targeted-cursor.c.tmp.h -Xclang -error-on-deserialized-decl=NestedVar1 -Xclang -error-on-deserialized-decl=TopVar | D:\src\llvm\build\vs2013\Debug\bin\FileCheck.EXE D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -check-prefix=PREAMBLE-CURSOR1 Sporadically they will fail, and attaching a debugger to a failed instance indicates that stdin of FileCheck.exe is empty. Note that due to the repro in #2, we can rule out a bug in the STL's mutex implementation, and instead conclude that this is a real flake in the windows test harness. Test Plan: Without patch: Ran check-clang 10 times and saw over 30 Unexpected failures on every run. With patch: Ran check-clang 10 times and saw 0 unexpected failures across all runs. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D4021 Patch by Zachary Turner! llvm-svn: 210225
* Remove the last remaining llvm/Config/config.h includesAlp Toker2014-06-041-1/+1
| | | | | | | | | | | | This corrects long-standing misuses of LLVM's internal config.h. In most cases the public llvm-config.h header was intended and we can now remove the old hacks thanks to LLVM r210144. The config.h header is private, won't be installed and should no longer be included by clang or other modules. llvm-svn: 210145
* [libclang] Introduce clang_Module_isSystem(), which returns non-zero if the ↵Argyrios Kyrtzidis2014-05-151-2/+2
| | | | | | given CXModule is a system one. llvm-svn: 208846
* [liblang] Introduce clang_getModuleForFile, which given a CXFile header ↵Argyrios Kyrtzidis2014-05-141-1/+15
| | | | | | file, returns the module that contains it, if one exists. llvm-svn: 208822
* c-index-test: Don't leak diagnostic category text.Nico Weber2014-05-111-0/+1
| | | | llvm-svn: 208503
* Don't leak CXStrings for replacement fix-its in c-index-test.Nico Weber2014-05-101-1/+0
| | | | | | | | | | | | | | The loop body used to contain a switch statement; it looks like r96685 replaced that with an if/else if/else but accidentally left one of the three break statements from the switch behind, skipping the clang_disposeString() call for replacements (and the rest of the loop too, which apparently doesn't make a differences for the test cases we have). r96685: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100215/027754.html This too might possibly the last leak in clang (PR19521). llvm-svn: 208483
* c-index-test: Don't leak the strings returned by makeClientContainer().Nico Weber2014-05-071-6/+37
| | | | llvm-svn: 208249
* Make 2 functions static, remove unneeded cast, rewrap. No behavior change.Nico Weber2014-05-071-10/+13
| | | | llvm-svn: 208247
* [leaks] Parse the schema file every time we try to verify the XML. Yes,Chandler Carruth2014-05-021-29/+16
| | | | | | | | | | | | this is wasteful, blah blah, but this is a test utility only. It turns out that without doing this, libxml2 will always leak a bunch of the XML data, and that is causing failures with LSan. This is also quite a bit simpler and I don't think it is slow enough to really be a show stopper. If someone yells about the runtime of c-index-test, we can do other things to try to mitigate it, but the current strategy wasn't working well. llvm-svn: 207882
* libclang: split out the documentation comment APIAlp Toker2014-04-281-0/+1
| | | | | | | | | | | | | | | | | It's possible that the "comment AST" may be replaced or split out in the midterm, any anyway this makes the headers easier to read. Developers don't currently need to include "clang-c/Documentation.h" explicitly and there's no macro to test for availability yet. The raw comment and brief comment accessors have been kept in Index.h though brief support may also move here as a separate proposal. This is not a deprecation, just a gentle separation of concerns as we look to simplify the built-in representation of comment nodes and support external comment processors. llvm-svn: 207392
* libclang: remove 'CXDiagnostic_Remark'Alp Toker2014-04-261-1/+0
| | | | | | | | | | | | | | | | The change was landed without review or test cases. It trivially broke almost any stable application checking for Severity >= CXDiagnostic_Error or indeed any other kind of severity comparison upon encountering a 'remark'. Mapped to CXDiagnostic_Warning until a workable solution is proposed to the list that preserves API stability. (It's also not clear why the rest of r202475 wasn't simply implemented as a modifier to the existing 'warning' level.) llvm-svn: 207319
* Fix two leaks in c-index-test found by LSan.Nico Weber2014-04-241-6/+14
| | | | | | The result of clang_getCursorSpelling() needs to be clang_getCursorSpelling()ed. llvm-svn: 207073
* Make c-index-test -test-print-type include pointeekind for pointer typesAnders Waldenborg2014-04-091-0/+7
| | | | | | | | | The idea is to give visibility to more type kinds, especially for getting a better grasp of what appears as unexposed type kind with libclang. Differential Revision: http://reviews.llvm.org/D3325 llvm-svn: 205921
* libclang: add clang_CXXMethod_isConst API that allows to determine if a C++Dmitri Gribenko2014-04-071-0/+2
| | | | | | | | member function or member function template is declared 'const' Patch by Kevin Funk with testcase updates by me. llvm-svn: 205714
* Remove a dead store, add a FIXME for another.Richard Smith2014-03-061-1/+1
| | | | llvm-svn: 203169
* Add 'remark' diagnostic type in 'clang'Tobias Grosser2014-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | A 'remark' is information that is not an error or a warning, but rather some additional information provided to the user. In contrast to a 'note' a 'remark' is an independent diagnostic, whereas a 'note' always depends on another diagnostic. A typical use case for remark nodes is information provided to the user, e.g. information provided by the vectorizer about loops that have been vectorized. This patch provides the initial implementation of 'remarks'. It includes the actual definiton of the remark nodes, their printing as well as basic parameter handling. We are reusing the existing diagnostic parameters which means a remark can be enabled with normal '-Wdiagnostic-name' flags and can be upgraded to an error using '-Werror=diagnostic-name'. '-Werror' alone does not upgrade remarks. This patch is by intention minimal in terms of parameter handling. More experience and more discussions will most likely lead to further enhancements in the parameter handling. llvm-svn: 202475
* libclang: New functions clang_Type_getNumTemplateArguments,Dmitri Gribenko2014-02-271-3/+18
| | | | | | | | | | clang_Type_getTemplateArgument Note that these functions don't handle variadic templates -- see tests. Patch by Matthieu Nottale and Philippe Daouadi. llvm-svn: 202406
* Fix gcc warning about C++ style comments.Patrik Hagglund2014-02-171-1/+1
| | | | llvm-svn: 201512
* libclang: report error code for bad PCH filesDmitri Gribenko2014-02-121-86/+150
| | | | | | | | | | | | | | | | | | | 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
* Add an option to allow Clang verify source files for a module only once duringDmitri Gribenko2014-02-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the build When Clang loads the module, it verifies the user source files that the module was built from. If any file was changed, the module is rebuilt. There are two problems with this: 1. correctness: we don't verify system files (there are too many of them, and stat'ing all of them would take a lot of time); 2. performance: the same module file is verified again and again during a single build. This change allows the build system to optimize source file verification. The idea is based on the fact that while the project is being built, the source files don't change. This allows us to verify the module only once during a single build session. The build system passes a flag, -fbuild-session-timestamp=, to inform Clang of the time when the build started. The build system also requests to enable this feature by passing -fmodules-validate-once-per-build-session. If these flags are not passed, the behavior is not changed. When Clang verifies the module the first time, it writes out a timestamp file. Then, when Clang loads the module the second time, it finds a timestamp file, so it can compare the verification timestamp of the module with the time when the build started. If the verification timestamp is too old, the module is verified again, and the timestamp file is updated. llvm-svn: 201224
* Use -std=gnu89 in tools/c-index-test/CMakeLists.txtRafael Espindola2014-01-081-1/+1
| | | | | | | | | With the old use of -std=c89 off_t is not defined and the build fails. This seems to be another variation of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40278. llvm-svn: 198748
* [CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each ↵NAKAMURA Takumi2013-12-101-5/+0
| | | | | | CMakeLists.txt. llvm-svn: 196916
* [libclang] Rename CXSkippedRanges to CXSourceRangeList to make it more ↵Argyrios Kyrtzidis2013-12-061-2/+2
| | | | | | | | future-proof. Suggested by Alp Toker. llvm-svn: 196591
* [c-index-test] For the '-remap-file' option use a comma for separator which ↵Argyrios Kyrtzidis2013-12-051-7/+7
| | | | | | | | is more Windows friendly than the colon. llvm-svn: 196529
* [libclang] Record ranges skipped by the preprocessor and expose them with ↵Argyrios Kyrtzidis2013-12-051-0/+14
| | | | | | | | libclang. Patch by Erik Verbruggen! llvm-svn: 196487
* [c-index-test] Enhance perform_test_reparse_source() to allow remapping a fileArgyrios Kyrtzidis2013-12-051-12/+77
| | | | | | | | at a particular reparsing iteration. Passing '-remap-file-1=from:to' will remap the files in the second iteration. llvm-svn: 196486
* [c-index-test] For the '-remap-file=' option use ':' instead of ';' for ↵Argyrios Kyrtzidis2013-12-051-7/+7
| | | | | | | | separator. lldb does not like semicolon as part of an option. llvm-svn: 196485
* [libclang] Introduce clang_Type_getCXXRefQualifier whichexposes ↵Argyrios Kyrtzidis2013-10-111-0/+5
| | | | | | | | ref-qualifier information of function type. Patch by Che-Liang Chiou! llvm-svn: 192493
OpenPOWER on IntegriCloud