Skip to content

Instantly share code, notes, and snippets.

View ilya-biryukov's full-sized avatar

Ilya Biryukov ilya-biryukov

View GitHub Profile
@ilya-biryukov
ilya-biryukov / llvm-deps.yaml
Last active January 27, 2020 15:00
Lists rough dependencies inside top-level LLVM projects. Used to reduce CI build and test times.
// This mapping is only used to determine which projects need to be rebuild.
// E.g. all builds are still in-tree, so 'llvm' will always be included in the
// built projects.
{
"llvm": [],
"clang": ["llvm"],
"clang-tools-extra": ["clang", "llvm"],
// FIXME: "compiler-rt" depends on "llvm" only for configuration, right?
// it means we can miss breakages in configuration changes.
// Same for libcxx, libc and other projects that don't have 'llvm'
@ilya-biryukov
ilya-biryukov / symbols.sh
Created April 21, 2018 20:14
Build and use global index in clangd
# First, build the index builder.
ninja global-symbol-builder
# $LLVM_PATH is source directory of LLVM.
# compile_commands.json (or a symlink to it) should be there.
# Running this takes considerable time (> 30 mins).
./bin/global-symbol-builder -executor=all-TUs $LLVM_PATH > $HOME/llvm_clangd.symbols
# Run clangd with the following arg to make it pick up the built index:
# -yaml-symbol-file=$HOME/llvm_clangd.symbols
template <class T>
int foo(T*);
template<>
int foo(int);
@ilya-biryukov
ilya-biryukov / test.cpp
Last active August 29, 2015 14:19
C++ trait to check if class has a member 'type' or not
template <class T>
class has_member_type {
struct One { char a[1]; };
struct Two { char a[2]; };
template <class U>
static One foo(typename U::type*);
template <class U>
static Two foo(...);