Commit Graph

9 Commits

Author SHA1 Message Date
Eric Fiselier
d9b9ef75a8 [libcxx] Add support for benchmark tests using Google Benchmark.
Summary:
This patch does the following:

1. Checks in a copy of the Google Benchmark library into the libc++ repo under `utils/google-benchmark`.
2. Teaches libc++ how to build Google Benchmark against both (A) in-tree libc++ and (B) the platforms native STL.
3. Allows performance benchmarks to be built as part of the libc++ build.

Building the benchmarks (and Google Benchmark) is off by default. It must be enabled using the CMake option `-DLIBCXX_INCLUDE_BENCHMARKS=ON`. When this option is enabled the tests under `libcxx/benchmarks`  can be built using the `libcxx-benchmarks` target.

On Linux platforms where libstdc++ is the default STL the CMake option `-DLIBCXX_BUILD_BENCHMARKS_NATIVE_STDLIB=ON` can be used to build each benchmark test against libstdc++ as well. This is useful for comparing performance between standard libraries.

Support for benchmarks is currently very minimal. They must be manually run by the user and there is no mechanism for detecting performance regressions.

Known Issues:

* `-DLIBCXX_INCLUDE_BENCHMARKS=ON` is only supported for Clang, and not GCC, since the `-stdlib=libc++` option is needed to build Google Benchmark.








Reviewers: danalbert, dberlin, chandlerc, mclow.lists, jroelofs

Subscribers: chandlerc, dberlin, tberghammer, danalbert, srhines, hfinkel

Differential Revision: https://reviews.llvm.org/D22240

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:07:03 +00:00
Eric Fiselier
a9e91f30ee Add more missing license headers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:58:49 +00:00
Eric Fiselier
8cbf020fdc [libcxx] Make it drastically simpler to link libc++.
Summary:
Currently on most platforms you have to manually link the c++ abi library used with libc++ whenever you use libc++. So your typical libc++ command like invocation might look like:

```
clang++ -stdlib=libc++ foo.cpp -lc++abi
```

Having to manually link `libc++abi.so` makes it harder for libc++ to be used generically. This patch fixes that by generating a linker script for `libc++.so` that correctly links the ABI library. On linux the linker script for libc++abi would look like:

```
# libc++.so
INPUT(libc++.so.1 -lc++abi)
```

With the linker script you can now use libc++ using only `-stdlib=libc++`. This is the technique that is used on FreeBSD in ordered to link cxxrt and I think it's the best approach to make our users lives simpler.

The CMake option used to enable this is `LIBCXX_ENABLE_ABI_LINKER_SCRIPT`. In future I would like to enable this by default on all platforms except for Darwin.

Reviewers: mclow.lists, danalbert, rsmith, jroelofs, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D12508

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@250319 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 19:54:03 +00:00
Eric Fiselier
28cf403441 cleanup comments in sym_check
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-27 06:04:37 +00:00
Eric Fiselier
faa65e99a8 Add readelf support to abi_check. Prefer readelf over nm
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233360 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-27 05:44:59 +00:00
Eric Fiselier
e199924809 Improve automatic detection of filetype for sym_check
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232858 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-20 23:07:38 +00:00
Eric Fiselier
efdefb2cef Fix use of incorrect package name in sym_check
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232856 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-20 22:13:37 +00:00
Eric Fiselier
2d9feb59f0 Add symbol checking script to libc++ to help manage exported symbols.
Summary:
Add symbol checking scripts for extracting a list of symbols from shared libraries and for comparing symbol lists for differences.



Reviewers: mclow.lists, danalbert, EricWF

Reviewed By: EricWF

Subscribers: majnemer, emaste, cfe-commits

Differential Revision: http://reviews.llvm.org/D4946

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232855 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-20 22:09:29 +00:00
Eric Fiselier
dd7a4836e3 [libcxx] Allow use of ShTest in libc++ tests along with other changes.
Summary:
This patch allows the use of LIT's ShTest format in the libc++ test suite. ShTests have the suffix '.sh.cpp'. It also introduces a series of other changes. These changes are:

- More functionality including parsing test metadata has been moved into LIT.
- LibcxxTestFormat now supports multi-part suffixes.
- the `CXXCompiler` functionality has been used to shrink the size of LibcxxTestFormat. 
- The recursive loading of the site config has been turned into `libcxx.test.config.loadSiteConfig` so it can be used with libc++abi.
- Temporary files are now created in the build directory of libc++. This follows how it is down in ShTest.
- `not.py` was added as a utility executable that mirrors the functionality of LLVM's `not` executable. 
- The first ShTest test was added under test/libcxx/double_include.sh.cpp


Reviewers: jroelofs, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7073

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226844 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-22 18:05:58 +00:00