Commit Graph

35 Commits

Author SHA1 Message Date
Erich Keane d2dd52d1df Revert 320391: Certain targets are failing, pulling back to diagnose.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320398 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 18:14:51 +00:00
Erich Keane 20a630420d For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is available
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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320391 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 17:36:42 +00:00
Cameron Desrochers 949ea4a67b Fixed more signed/unsigned mismatch warnings introduced in my change at r279076
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 20:56:48 +00:00
Cameron Desrochers c62bf7ad86 Removed use of 'emplace' on std::map, since not all buildbot slaves support it
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279114 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 18:41:41 +00:00
Cameron Desrochers 584ba6b576 [libclang] Fixed signed/unsigned comparison warning introduced in my revision r279076
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279085 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 16:25:42 +00:00
Cameron Desrochers 840ee0d062 [libclang] Add clang_getAllSkippedRanges function
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279076 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 15:43:55 +00:00
Jonas Hahnfeld 4773245d34 tests: Add explicit -stdlib=libstdc++ to tests that require it
This will be needed for the next commit that allows to switch the default
C++ library which would otherwise make these tests fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260661 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 07:48:28 +00:00
Benjamin Kramer e69c871190 Avoid picking up system headers in unittest by providing a fake libstdc++ 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254446 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:42:07 +00:00
Samuel Antao 34c87211f9 Add --gcc-toolchain= to one of the libclang unitests to fix issue related to
the gcc libraries clang picks for when it was configures with a user defined 
path.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254306 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 17:26:28 +00:00
Benjamin Kramer b1dfd66099 [libclang] Add entry points that take a full command line including argv[0].
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253466 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18 16:14:27 +00:00
Yaron Keren 78932e68d4 Add clang_free to libclang to free memory allocated in libclang.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241789 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 07:53:23 +00:00
Alexander Kornienko 8ca7705aa3 Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 23:07:51 +00:00
Alexander Kornienko ac58acc7f2 Fixed/added namespace ending comments using clang-tidy. NFC
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 09:47:44 +00:00
Alexander Kornienko dfa4cf3126 Use 'override/final' instead of 'virtual' for overridden methods
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234678 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11 02:00:23 +00:00
Chandler Carruth f3590b88bc [cleanup] Re-sort the #include lines using llvm/utils/sort_includes.py
No functionality changed, this is a purely mechanical cleanup to ensure
the #include order remains consistent across the project.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225975 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 11:23:58 +00:00
Justin Bogner 9e5a027d79 VirtualFileSystem: Correctly generate the mapping for an empty VFS
In r209332 I accidentally broke generation of empty VFS maps. This
fixes the issue and adds a test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213028 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15 01:24:35 +00:00
Ben Langmuir c12d3d358b Use temporary module cache in test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212467 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-07 17:34:37 +00:00
Ben Langmuir f4f9e50a67 Consider module depedencies when checking a preamble in libclang
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212060 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 20:04:14 +00:00
NAKAMURA Takumi 5179499bb3 LibclangTest.cpp: s/uint/unsigned/. I think 'uint' is not a standard type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211997 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-29 11:07:48 +00:00
Ben Langmuir 54d7831c3b Add reparse test for libclang
Adapted from a reproducer by Dan Schmidt, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211910 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-27 17:04:26 +00:00
Craig Topper b23b499237 [C++11] Use 'nullptr'. Unittests edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210423 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 08:38:12 +00:00
Justin Bogner 9fefd0267a VirtualFileSystem: Fix a few directory traversal bugs in VFSWriter
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209332 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 22:46:51 +00:00
Justin Bogner e4fee1f13c libclang: Give each VirtualFileOverlay unit test its own name
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-20 23:52:11 +00:00
Justin Bogner f1b460f9ea VirtualFileSystem: Fix false positives in YAMLVFSWriter::containedIn
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209250 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-20 22:12:58 +00:00
Ben Langmuir 74a4aaa5ce Switch another write_escaped to yaml::escape
I missed one in r206443.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208941 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 01:38:59 +00:00
Nico Weber b7ed4eee85 Fix a tiny test-only leak, found by LSan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207137 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-24 19:04:10 +00:00
Ben Langmuir f288c56a51 When writing YAML in libclang, use yaml::escape instead of write_escaped
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().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206443 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 03:31:02 +00:00
Argyrios Kyrtzidis ae3c93f93a [libclang] Introduce clang_VirtualFileOverlay_setCaseSensitivity that exposes the VFS option
to set the case-sensitivity for lookups.

rdar://16374696

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204303 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 04:51:48 +00:00
Argyrios Kyrtzidis 1d4cff185f [libclang] Introduce APIs that assist in constructing a simple module.map file for a user framework.
rdar://16092858

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202681 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 07:41:45 +00:00
Argyrios Kyrtzidis 28b7261a1a [libclang] Change clang_VirtualFileOverlay_writeToBuffer to return a malloc'ed buffer.
Returning CXString is not appropriate if we want to switch to a non-string format buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202675 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 06:38:52 +00:00
Argyrios Kyrtzidis 57fc288553 [libclang] Introduce libclang APIs for creating a buffer with a JSON virtual file overlay description.
The current API only supports adding 'virtual file path' -> 'real file path' mappings.

rdar://15986708

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202105 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 03:59:23 +00:00
Dmitri Gribenko 69ca344218 libclang: ensure clang_createTranslationUnit2 always initializes *TU
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201657 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 10:24:00 +00:00
Dmitri Gribenko 90801c62b7 Add files that I forgot to svn add in 201578.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201579 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18 15:29:17 +00:00
Juergen Ributzka b3c10777b9 Revert "libclang: fix a bug in processing invalid arguments, introduced in r201249,"
Reverting commit (201346) for now, because it is breaking our internal builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201373 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13 23:34:54 +00:00
Dmitri Gribenko cf7344d4ce libclang: fix a bug in processing invalid arguments, introduced in r201249,
pointed out by Daniel Jasper in r201329


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201346 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13 16:51:38 +00:00