summaryrefslogtreecommitdiffstats
path: root/clang/unittests/libclang/LibclangTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libclang] Add PrintingPolicy for pretty printing declarationsJonathan Coe2018-01-161-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Introduce clang_getCursorPrettyPrinted() for pretty printing declarations. Expose also PrintingPolicy, so the user gets more fine-grained control of the entities being printed. The already existing clang_getCursorDisplayName() is pretty limited - for example, it does not handle return types, parameter names or default arguments for function declarations. Addressing these issues in clang_getCursorDisplayName() would mean to duplicate existing code (e.g. clang::DeclPrinter), so rather expose new API to access the existing functionality. Reviewed By: jbcoe Subscribers: cfe-commits Tags: #clang Patch by nik (Nikolai Kosjar) Differential Revision: https://reviews.llvm.org/D39903 llvm-svn: 322540
* Fixed memory leak in unit test introduced in my previous commit r322503Cameron Desrochers2018-01-151-0/+3
| | | | llvm-svn: 322513
* [PCH] Serialize skipped preprocessor rangesCameron Desrochers2018-01-151-0/+78
| | | | | | | | The skipped preprocessor ranges are now serialized in the AST PCH file. This fixes, for example, libclang's clang_getSkippedRanges() returning zero ranges after reparsing a translation unit. Differential Revision: https://reviews.llvm.org/D20124 llvm-svn: 322503
* Revert 320391: Certain targets are failing, pulling back to diagnose.Erich Keane2017-12-111-3/+1
| | | | llvm-svn: 320398
* For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is availableErich Keane2017-12-111-1/+3
| | | | | | | | | | | | | | | | | | | | As reported in llvm bugzilla 32377. Here’s a patch to add preinclude of stdc-predef.h. The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html; The preinclude is inhibited with –ffreestanding. Basically I fixed the failing test cases by adding –ffreestanding which inhibits this behavior. I fixed all the failing tests, including some in extra/test, there's a separate patch for that which is linked here Note: this is a recommit after a test failure took down the original (r318669) Patch By: mibintc Differential Revision: https://reviews.llvm.org/D34158 llvm-svn: 320391
* Fixed more signed/unsigned mismatch warnings introduced in my change at r279076Cameron Desrochers2016-08-181-5/+5
| | | | llvm-svn: 279145
* Removed use of 'emplace' on std::map, since not all buildbot slaves support itCameron Desrochers2016-08-181-2/+2
| | | | llvm-svn: 279114
* [libclang] Fixed signed/unsigned comparison warning introduced in my ↵Cameron Desrochers2016-08-181-1/+1
| | | | | | revision r279076 llvm-svn: 279085
* [libclang] Add clang_getAllSkippedRanges functionCameron Desrochers2016-08-181-2/+80
| | | | | | | | | | This complements the clang_getSkippedRanges function which returns skipped ranges filtered by a specific file. This function is useful when all the ranges are desired (and a lot more efficient than the equivalent of asking for the ranges file by file, since the implementation of clang_getSkippedRanges iterates over all ranges anyway). Differential Revision: https://reviews.llvm.org/D20132 llvm-svn: 279076
* tests: Add explicit -stdlib=libstdc++ to tests that require itJonas Hahnfeld2016-02-121-1/+1
| | | | | | | This will be needed for the next commit that allows to switch the default C++ library which would otherwise make these tests fail. llvm-svn: 260661
* Avoid picking up system headers in unittest by providing a fake libstdc++ ↵Benjamin Kramer2015-12-011-2/+4
| | | | | | | | | with a ridiculously high version number. The host libstdc++ may be horribly broken and we want the fake one to be picked up. This workaround is lame but I don't see a better way. llvm-svn: 254446
* Add --gcc-toolchain= to one of the libclang unitests to fix issue related to Samuel Antao2015-11-301-1/+2
| | | | | | | the gcc libraries clang picks for when it was configures with a user defined path. llvm-svn: 254306
* [libclang] Add entry points that take a full command line including argv[0].Benjamin Kramer2015-11-181-0/+26
| | | | | | | | | | | | 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
* Add clang_free to libclang to free memory allocated in libclang.Yaron Keren2015-07-091-2/+2
| | | | | | | | | | | | | | One of the problems libclang tests has running under Windows is memory allocated in libclang.dll but being freed in the test executable, possibly by a different memory manager. This patch exposes a new export function, clang_free(), used to free any allocated memory with the same libclang.dll memory manager that allocated the memory. http://reviews.llvm.org/D10949 Reviewed by Reid Kleckner, Douglas Gregor. llvm-svn: 241789
* 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
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
* [cleanup] Re-sort the #include lines using llvm/utils/sort_includes.pyChandler Carruth2015-01-141-1/+1
| | | | | | | No functionality changed, this is a purely mechanical cleanup to ensure the #include order remains consistent across the project. llvm-svn: 225975
* VirtualFileSystem: Correctly generate the mapping for an empty VFSJustin Bogner2014-07-151-0/+10
| | | | | | | In r209332 I accidentally broke generation of empty VFS maps. This fixes the issue and adds a test. llvm-svn: 213028
* Use temporary module cache in testBen Langmuir2014-07-071-1/+3
| | | | llvm-svn: 212467
* Consider module depedencies when checking a preamble in libclangBen Langmuir2014-06-301-1/+34
| | | | | | | | | | | | | Add module dependencies (header files, module map files) to the list of files to check when deciding whether to rebuild a preamble. That fixes using preambles with module imports so long as they are in non-overridden files. My intent is to use to unify the existing dependency collectors to the new “DependencyCollectory” interface from this commit, starting with the DependencyFileGenerator. llvm-svn: 212060
* LibclangTest.cpp: s/uint/unsigned/. I think 'uint' is not a standard type.NAKAMURA Takumi2014-06-291-3/+3
| | | | llvm-svn: 211997
* Add reparse test for libclangBen Langmuir2014-06-271-0/+89
| | | | | | Adapted from a reproducer by Dan Schmidt, thanks! llvm-svn: 211910
* [C++11] Use 'nullptr'. Unittests edition.Craig Topper2014-06-081-6/+7
| | | | llvm-svn: 210423
* VirtualFileSystem: Fix a few directory traversal bugs in VFSWriterJustin Bogner2014-05-211-0/+68
| | | | | | | | | | | There are a couple of issues with writing VFS maps that are awkward to fix within the current mutually recursive approach. Instead, replace the algorithm with an iterative version that uses an explicit stack of directories. Includes tests for cases the old approach was tripping on. llvm-svn: 209332
* libclang: Give each VirtualFileOverlay unit test its own nameJustin Bogner2014-05-201-173/+176
| | | | llvm-svn: 209257
* VirtualFileSystem: Fix false positives in YAMLVFSWriter::containedInJustin Bogner2014-05-201-0/+51
| | | | | | | | Checking if a path starts with another path isn't sufficient for determining if one is contained within the heirarchy of the other. We need to ensure that the substring ends at a directory boundary. llvm-svn: 209250
* Switch another write_escaped to yaml::escapeBen Langmuir2014-05-161-2/+2
| | | | | | I missed one in r206443. llvm-svn: 208941
* Fix a tiny test-only leak, found by LSan.Nico Weber2014-04-241-8/+8
| | | | llvm-svn: 207137
* When writing YAML in libclang, use yaml::escape instead of write_escapedBen Langmuir2014-04-171-0/+21
| | | | | | | | The YAMLParser has its own escaped string representation, and does not handle octal escape sequences. When writing the virtual file system to a YAML file, use yaml::escape(). llvm-svn: 206443
* [libclang] Introduce clang_VirtualFileOverlay_setCaseSensitivity that ↵Argyrios Kyrtzidis2014-03-201-0/+23
| | | | | | | | | | exposes the VFS option to set the case-sensitivity for lookups. rdar://16374696 llvm-svn: 204303
* [libclang] Introduce APIs that assist in constructing a simple module.map ↵Argyrios Kyrtzidis2014-03-031-0/+23
| | | | | | | | file for a user framework. rdar://16092858 llvm-svn: 202681
* [libclang] Change clang_VirtualFileOverlay_writeToBuffer to return a ↵Argyrios Kyrtzidis2014-03-031-4/+6
| | | | | | | | malloc'ed buffer. Returning CXString is not appropriate if we want to switch to a non-string format buffer. llvm-svn: 202675
* [libclang] Introduce libclang APIs for creating a buffer with a JSON virtual ↵Argyrios Kyrtzidis2014-02-251-0/+111
| | | | | | | | | | file overlay description. The current API only supports adding 'virtual file path' -> 'real file path' mappings. rdar://15986708 llvm-svn: 202105
* libclang: ensure clang_createTranslationUnit2 always initializes *TUDmitri Gribenko2014-02-191-1/+14
| | | | llvm-svn: 201657
* Add files that I forgot to svn add in 201578.Dmitri Gribenko2014-02-181-0/+17
| | | | llvm-svn: 201579
* Revert "libclang: fix a bug in processing invalid arguments, introduced in ↵Juergen Ributzka2014-02-131-17/+0
| | | | | | | | r201249," Reverting commit (201346) for now, because it is breaking our internal builds. llvm-svn: 201373
* libclang: fix a bug in processing invalid arguments, introduced in r201249,Dmitri Gribenko2014-02-131-0/+17
pointed out by Daniel Jasper in r201329 llvm-svn: 201346
OpenPOWER on IntegriCloud