forked from vgough/encfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed 'vendor/github.com/google/benchmark/' content from commit 16…
…3ce4af git-subtree-dir: vendor/github.com/google/benchmark git-subtree-split: 163ce4af68fd7d100e7e54ab65abd50971183009
- Loading branch information
0 parents
commit a98123a
Showing
83 changed files
with
11,703 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
Language: Cpp | ||
BasedOnStyle: Google | ||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
*.a | ||
*.so | ||
*.so.?* | ||
*.dll | ||
*.exe | ||
*.dylib | ||
*.cmake | ||
!/cmake/*.cmake | ||
*~ | ||
*.pyc | ||
__pycache__ | ||
|
||
# lcov | ||
*.lcov | ||
/lcov | ||
|
||
# cmake files. | ||
/Testing | ||
CMakeCache.txt | ||
CMakeFiles/ | ||
cmake_install.cmake | ||
|
||
# makefiles. | ||
Makefile | ||
|
||
# in-source build. | ||
bin/ | ||
lib/ | ||
/test/*_test | ||
|
||
# exuberant ctags. | ||
tags | ||
|
||
# YouCompleteMe configuration. | ||
.ycm_extra_conf.pyc | ||
|
||
# ninja generated files. | ||
.ninja_deps | ||
.ninja_log | ||
build.ninja | ||
install_manifest.txt | ||
rules.ninja | ||
|
||
# out-of-source build top-level folders. | ||
build/ | ||
_build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install a newer CMake version | ||
curl -sSL https://cmake.org/files/v3.6/cmake-3.6.1-Linux-x86_64.sh -o install-cmake.sh | ||
chmod +x install-cmake.sh | ||
sudo ./install-cmake.sh --prefix=/usr/local --skip-license | ||
|
||
# Checkout LLVM sources | ||
git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source | ||
git clone --depth=1 https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx | ||
git clone --depth=1 https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi | ||
|
||
# Setup libc++ options | ||
if [ -z "$BUILD_32_BITS" ]; then | ||
export BUILD_32_BITS=OFF && echo disabling 32 bit build | ||
fi | ||
|
||
# Build and install libc++ (Use unstable ABI for better sanitizer coverage) | ||
mkdir llvm-build && cd llvm-build | ||
cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \ | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr \ | ||
-DLIBCXX_ABI_UNSTABLE=ON \ | ||
-DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \ | ||
-DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \ | ||
../llvm-source | ||
make cxx -j2 | ||
sudo make install-cxxabi install-cxx | ||
cd ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
sudo: required | ||
dist: trusty | ||
language: cpp | ||
|
||
env: | ||
global: | ||
- /usr/local/bin:$PATH | ||
|
||
matrix: | ||
include: | ||
- compiler: gcc | ||
addons: | ||
apt: | ||
packages: | ||
- lcov | ||
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Coverage | ||
- compiler: gcc | ||
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Debug | ||
- compiler: gcc | ||
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Release | ||
- compiler: gcc | ||
addons: | ||
apt: | ||
packages: | ||
- g++-multilib | ||
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Debug BUILD_32_BITS=ON | ||
- compiler: gcc | ||
addons: | ||
apt: | ||
packages: | ||
- g++-multilib | ||
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Release BUILD_32_BITS=ON | ||
- compiler: gcc | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-6 | ||
env: | ||
- COMPILER=g++-6 C_COMPILER=gcc-6 BUILD_TYPE=Debug | ||
- EXTRA_FLAGS="-fno-omit-frame-pointer -g -O2 -fsanitize=undefined,address -fuse-ld=gold" | ||
- compiler: clang | ||
env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Debug | ||
- compiler: clang | ||
env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Release | ||
# Clang w/ libc++ | ||
- compiler: clang | ||
addons: | ||
apt: | ||
packages: | ||
clang-3.8 | ||
env: | ||
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug | ||
- LIBCXX_BUILD=1 | ||
- EXTRA_FLAGS="-stdlib=libc++" | ||
- compiler: clang | ||
addons: | ||
apt: | ||
packages: | ||
clang-3.8 | ||
env: | ||
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release | ||
- LIBCXX_BUILD=1 | ||
- EXTRA_FLAGS="-stdlib=libc++" | ||
# Clang w/ 32bit libc++ | ||
- compiler: clang | ||
addons: | ||
apt: | ||
packages: | ||
- clang-3.8 | ||
- g++-multilib | ||
env: | ||
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug | ||
- LIBCXX_BUILD=1 | ||
- BUILD_32_BITS=ON | ||
- EXTRA_FLAGS="-stdlib=libc++ -m32" | ||
# Clang w/ 32bit libc++ | ||
- compiler: clang | ||
addons: | ||
apt: | ||
packages: | ||
- clang-3.8 | ||
- g++-multilib | ||
env: | ||
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release | ||
- LIBCXX_BUILD=1 | ||
- BUILD_32_BITS=ON | ||
- EXTRA_FLAGS="-stdlib=libc++ -m32" | ||
# Clang w/ libc++, ASAN, UBSAN | ||
- compiler: clang | ||
addons: | ||
apt: | ||
packages: | ||
clang-3.8 | ||
env: | ||
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug | ||
- LIBCXX_BUILD=1 LIBCXX_SANITIZER="Undefined;Address" | ||
- EXTRA_FLAGS="-stdlib=libc++ -g -O2 -fno-omit-frame-pointer -fsanitize=undefined,address -fno-sanitize-recover=all" | ||
- UBSAN_OPTIONS=print_stacktrace=1 | ||
# Clang w/ libc++ and MSAN | ||
- compiler: clang | ||
addons: | ||
apt: | ||
packages: | ||
clang-3.8 | ||
env: | ||
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug | ||
- LIBCXX_BUILD=1 LIBCXX_SANITIZER=MemoryWithOrigins | ||
- EXTRA_FLAGS="-stdlib=libc++ -g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins" | ||
# Clang w/ libc++ and MSAN | ||
- compiler: clang | ||
addons: | ||
apt: | ||
packages: | ||
clang-3.8 | ||
env: | ||
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=RelWithDebInfo | ||
- LIBCXX_BUILD=1 LIBCXX_SANITIZER=Thread | ||
- EXTRA_FLAGS="-stdlib=libc++ -g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all" | ||
|
||
- os: osx | ||
osx_image: xcode8.3 | ||
compiler: clang | ||
env: | ||
- COMPILER=clang++ BUILD_TYPE=Debug | ||
- os: osx | ||
osx_image: xcode8.3 | ||
compiler: clang | ||
env: | ||
- COMPILER=clang++ BUILD_TYPE=Release | ||
|
||
before_script: | ||
- if [ -z "$BUILD_32_BITS" ]; then | ||
export BUILD_32_BITS=OFF && echo disabling 32 bit build; | ||
fi | ||
- if [ -n "${LIBCXX_BUILD}" ]; then | ||
source .travis-libcxx-setup.sh; | ||
fi | ||
- mkdir build && cd build | ||
|
||
install: | ||
- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then | ||
PATH=~/.local/bin:${PATH}; | ||
pip install --user --upgrade pip; | ||
pip install --user cpp-coveralls; | ||
fi | ||
|
||
script: | ||
- cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS="${EXTRA_FLAGS}" -DBENCHMARK_BUILD_32_BITS=${BUILD_32_BITS} .. | ||
- make | ||
- ctest -C ${BUILD_TYPE} --output-on-failure | ||
|
||
after_success: | ||
- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then | ||
coveralls --include src --include include --gcov-options '\-lp' --root .. --build-root .; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import os | ||
import ycm_core | ||
|
||
# These are the compilation flags that will be used in case there's no | ||
# compilation database set (by default, one is not set). | ||
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. | ||
flags = [ | ||
'-Wall', | ||
'-Werror', | ||
'-pendantic-errors', | ||
'-std=c++0x', | ||
'-fno-strict-aliasing', | ||
'-O3', | ||
'-DNDEBUG', | ||
# ...and the same thing goes for the magic -x option which specifies the | ||
# language that the files to be compiled are written in. This is mostly | ||
# relevant for c++ headers. | ||
# For a C project, you would set this to 'c' instead of 'c++'. | ||
'-x', 'c++', | ||
'-I', 'include', | ||
'-isystem', '/usr/include', | ||
'-isystem', '/usr/local/include', | ||
] | ||
|
||
|
||
# Set this to the absolute path to the folder (NOT the file!) containing the | ||
# compile_commands.json file to use that instead of 'flags'. See here for | ||
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html | ||
# | ||
# Most projects will NOT need to set this to anything; you can just change the | ||
# 'flags' list of compilation flags. Notice that YCM itself uses that approach. | ||
compilation_database_folder = '' | ||
|
||
if os.path.exists( compilation_database_folder ): | ||
database = ycm_core.CompilationDatabase( compilation_database_folder ) | ||
else: | ||
database = None | ||
|
||
SOURCE_EXTENSIONS = [ '.cc' ] | ||
|
||
def DirectoryOfThisScript(): | ||
return os.path.dirname( os.path.abspath( __file__ ) ) | ||
|
||
|
||
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): | ||
if not working_directory: | ||
return list( flags ) | ||
new_flags = [] | ||
make_next_absolute = False | ||
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] | ||
for flag in flags: | ||
new_flag = flag | ||
|
||
if make_next_absolute: | ||
make_next_absolute = False | ||
if not flag.startswith( '/' ): | ||
new_flag = os.path.join( working_directory, flag ) | ||
|
||
for path_flag in path_flags: | ||
if flag == path_flag: | ||
make_next_absolute = True | ||
break | ||
|
||
if flag.startswith( path_flag ): | ||
path = flag[ len( path_flag ): ] | ||
new_flag = path_flag + os.path.join( working_directory, path ) | ||
break | ||
|
||
if new_flag: | ||
new_flags.append( new_flag ) | ||
return new_flags | ||
|
||
|
||
def IsHeaderFile( filename ): | ||
extension = os.path.splitext( filename )[ 1 ] | ||
return extension in [ '.h', '.hxx', '.hpp', '.hh' ] | ||
|
||
|
||
def GetCompilationInfoForFile( filename ): | ||
# The compilation_commands.json file generated by CMake does not have entries | ||
# for header files. So we do our best by asking the db for flags for a | ||
# corresponding source file, if any. If one exists, the flags for that file | ||
# should be good enough. | ||
if IsHeaderFile( filename ): | ||
basename = os.path.splitext( filename )[ 0 ] | ||
for extension in SOURCE_EXTENSIONS: | ||
replacement_file = basename + extension | ||
if os.path.exists( replacement_file ): | ||
compilation_info = database.GetCompilationInfoForFile( | ||
replacement_file ) | ||
if compilation_info.compiler_flags_: | ||
return compilation_info | ||
return None | ||
return database.GetCompilationInfoForFile( filename ) | ||
|
||
|
||
def FlagsForFile( filename, **kwargs ): | ||
if database: | ||
# Bear in mind that compilation_info.compiler_flags_ does NOT return a | ||
# python list, but a "list-like" StringVec object | ||
compilation_info = GetCompilationInfoForFile( filename ) | ||
if not compilation_info: | ||
return None | ||
|
||
final_flags = MakeRelativePathsInFlagsAbsolute( | ||
compilation_info.compiler_flags_, | ||
compilation_info.compiler_working_dir_ ) | ||
else: | ||
relative_to = DirectoryOfThisScript() | ||
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) | ||
|
||
return { | ||
'flags': final_flags, | ||
'do_cache': True | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This is the official list of benchmark authors for copyright purposes. | ||
# This file is distinct from the CONTRIBUTORS files. | ||
# See the latter for an explanation. | ||
# | ||
# Names should be added to this file as: | ||
# Name or Organization <email address> | ||
# The email address is not required for organizations. | ||
# | ||
# Please keep the list sorted. | ||
|
||
Albert Pretorius <[email protected]> | ||
Arne Beer <[email protected]> | ||
Christopher Seymour <[email protected]> | ||
David Coeurjolly <[email protected]> | ||
Dominic Hamon <[email protected]> | ||
Eric Fiselier <[email protected]> | ||
Eugene Zhuk <[email protected]> | ||
Evgeny Safronov <[email protected]> | ||
Felix Homann <[email protected]> | ||
Google Inc. | ||
International Business Machines Corporation | ||
Ismael Jimenez Martinez <[email protected]> | ||
Jern-Kuan Leong <[email protected]> | ||
Joao Paulo Magalhaes <[email protected]> | ||
JianXiong Zhou <[email protected]> | ||
Jussi Knuuttila <[email protected]> | ||
Kaito Udagawa <[email protected]> | ||
Lei Xu <[email protected]> | ||
Matt Clarkson <[email protected]> | ||
Maxim Vafin <[email protected]> | ||
Nick Hutchinson <[email protected]> | ||
Oleksandr Sochka <[email protected]> | ||
Paul Redmond <[email protected]> | ||
Radoslav Yovchev <[email protected]> | ||
Shuo Chen <[email protected]> | ||
Yixuan Qiu <[email protected]> | ||
Yusuke Suzuki <[email protected]> | ||
Dirac Research | ||
Zbigniew Skowron <[email protected]> | ||
Dominik Czarnota <[email protected]> |
Oops, something went wrong.