Skip to content

Instantly share code, notes, and snippets.

Avatar

Louis Dionne ldionne

View GitHub Profile
@ldionne
ldionne / README.md
Last active Sep 1, 2020
From-scratch Lit configuration for Wakely
View README.md

Put the libstdcxx.cfg.in file in libcxx/test/configs/libstdcxx.cfg.in. Then, configure the LLVM tree with -DLIBCXX_TEST_CONFIG=<path-to-libstdcxx.cfg.in>.

Then, you should be able to use ./build/bin/llvm-lit -sv <whatever>.

View failure.log
(view as text)
******************** TEST 'libc++ :: std/re/re.const/re.matchflag/match_prev_avail.pass.cpp' FAILED ********************
Script:
--
: 'COMPILED WITH'; /usr/local/bin/clang++ /b/b3/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/llvm/libcxx/test/std/re/re.const/re.matchflag/match_prev_avail.pass.cpp -Werror -v -g -fno-omit-frame-pointer -fsanitize=address -Werror=thread-safety -std=c++2a -include /b/b3/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/llvm/libcxx/test/support/nasty_macros.h -nostdinc++ -I/b/b3/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/llvm/libcxx/include -I/b/b3/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/build/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/b/b3/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/llvm/libcxx/test/support -ftemplate-depth=270 -O1 -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wuser-defined-warnings -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-u
@ldionne
ldionne / pre-push
Created Nov 9, 2018
Pre-push hook for LLVM monorepo
View pre-push
#!/bin/sh
# Pre-push hook making sure there is no merge commit in the set of commits
# being pushed upstream. This hooks works by walking the set of commits being
# pushed and making sure that none of them has two parents or more (which is
# the definition of a merge commit).
#
# This hook is called with the following parameters:
#
# ${1} -- Name of the remote to which the push is being done
@ldionne
ldionne / static_map.cpp
Last active May 28, 2018
Toy implementation of a static constexpr map
View static_map.cpp
#include <algorithm>
#include <array>
#include <cassert>
#include <experimental/string_view>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <utility>
@ldionne
ldionne / codegen.cpp
Created May 23, 2018
example of bad codegen with Hana
View codegen.cpp
#include <cstddef>
#include <type_traits>
#include <utility>
//////////////////////////////////////////////////////////////////////////////
// Utilities required to make the bug report self-contained.
//
// Basically, this defines a very minimal tuple<> structure along with a
// function (operator+) which allows appending an element to a tuple. We
View minimal-handwritten-config-header-only.cmake
# Compute the installation prefix relative to this file. This file is expected
# to be located at ${PREFIX}/lib/cmake/Hana/HanaConfig.cmake, so this simply
# computes the installation's ${PREFIX}.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
@ldionne
ldionne / constexpr_control_flow.cpp
Created Mar 3, 2017
Scratchpad for compile-time control flow
View constexpr_control_flow.cpp
void foo() {
for (auto x : tuple) {
if (runtime-bool) // ill formed
constexpr break;
}
}
void foo() {
for (auto x : tuple) {
if constexpr (compile-time-bool) // yes!
@ldionne
ldionne / issaquah_2016_reflection.cpp
Created Mar 2, 2017
Library-based value-syntax for reflection as shown in Issaquah
View issaquah_2016_reflection.cpp
//
// A demo of value-syntax reflection built on top of the current reflection proposal,
// as shown to the Reflection SG at the Issaquah meeting in 2016.
//
// Author: Louis Dionne
//
// ~/code/llvm/build/prefix/bin/clang++ -I ~/code/hana/include -isystem ~/code/llvm/build/prefix/lib/clang/4.0.0/include -I ~/code/llvm/tools/clang/reflection -Xclang -freflection -std=c++1z code/worksheet.cpp
@ldionne
ldionne / CMakeLists.txt
Created Nov 8, 2016
Benchmark of hana::string w/ c_str() method
View CMakeLists.txt
# Copyright Louis Dionne 2016
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
set(datasets)
add_dataset(datasets hetero make hana string1 hana.string.cpp.erb 4 "(0..50).step(10).to_a + (100..300).step(50).to_a" "which\;1")
add_dataset(datasets hetero make hana string2 hana.string.cpp.erb 4 "(0..50).step(10).to_a + (100..300).step(50).to_a" "which\;2")
add_chart(hetero make DATASETS ${datasets})
@ldionne
ldionne / P0107.diff
Created Jun 8, 2016
Patch to implement P0107 in libc++
View P0107.diff
commit 4d6f53adf9ddb41ae6b477a39b8b609159c74cf2
Author: Louis Dionne <ldionne.2@gmail.com>
Date: Tue May 24 15:36:02 2016 -0700
[array] Implement P0107 improving the support for constexpr in std::array
diff --git a/include/array b/include/array
index 719286d..28d093d 100644
--- a/include/array
+++ b/include/array