Skip to content

Instantly share code, notes, and snippets.

View EricWF's full-sized avatar

Eric EricWF

View GitHub Profile
@EricWF
EricWF / sample.diff
Last active August 29, 2015 14:20
Misc additions to sample patch
diff --git a/include/experimental/algorithm b/include/experimental/algorithm
new file mode 100644
index 0000000..a2e956f
--- /dev/null
+++ b/include/experimental/algorithm
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+//===-------------------------- algorithm ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
@EricWF
EricWF / libc++abi_patches.txt
Last active August 29, 2015 14:20
3.6.1 Patches
These two commits clean up undefined behavior in readEncodedPointer.
- r231839: Fix PR21580 - Undefined behavior in readEncodedPointer()
https://llvm.org/bugs/show_bug.cgi?id=21580
https://github.com/llvm-mirror/libcxxabi/commit/89ea9ad0b0a48a9b9fccf6de81bdca1861960855
- r231852: Remove unneeded const_cast in readPointerHelper. Pointed out by jroelofs
https://github.com/llvm-mirror/libcxxabi/commit/fdd39fd838828bba84c4f7ad620207ae0d734ad5
@EricWF
EricWF / test-suite.diff
Created May 13, 2015 18:44
libc++ 3.6 test suite fix
diff --git a/test/libcxx/test/config.py b/test/libcxx/test/config.py
index 55916f0..4342a79 100644
--- a/test/libcxx/test/config.py
+++ b/test/libcxx/test/config.py
@@ -269,8 +269,8 @@ class Configuration(object):
# Configure include paths
self.compile_flags += ['-nostdinc++']
support_path = os.path.join(self.src_root, 'test/support')
- self.cxx.compile_flags += ['-I' + support_path]
- self.cxx.compile_flags += ['-include', os.path.join(support_path, 'nasty_macros.hpp')]
template <class Tp>
struct PrintType;
typedef void MyFunc();
int main() {
PrintType<MyFunc const> p;
}
@EricWF
EricWF / Problem.md
Last active August 29, 2015 14:22
Proble

The Use for Value Benchmarks

This document describes the rational and benefits of Value benchmarks.

###Real world Example:

Libc++ has been offered a new implementation of std::sort that is supposed to be faster.

Goal

Determine which implementation is better.

@EricWF
EricWF / test.cpp
Created July 10, 2015 23:14
Tuple Bug
#include <type_traits>
#include <tuple>
#include <cassert>
template <bool Pred, class Then = bool>
using EnableIf = typename std::enable_if<Pred, Then>::type;
template <bool Pred>
using BoolT = std::integral_constant<bool, Pred>;
@EricWF
EricWF / test.py
Last active August 29, 2015 14:25
available_
import ast
import decimal
class FeatureTransformer(ast.NodeTransformer):
ALLOWED_NAMES = set(['True', 'False', 'None'])
ALLOWED_NODE_TYPES = set([
'Num', # allow numbers too
'Name', # an identifier...
'Load', # loads a value of a variable with given identifier
@EricWF
EricWF / README.md
Last active August 29, 2015 14:25
<functional> cleanup
  1. <__functional_base>
    • unary_function and binary_function detection.
    • __weak_result_type.
    • __invoke definition (C++11 Only)
    • reference_wrapper
    • __is_transparent
    • uses_allocator metaprogramming
  2. <__functional_base_03>
  • (EXACT DUPLICATE) unary_function and binary_function detection.
@EricWF
EricWF / function.patch
Last active August 26, 2015 18:08
Function Fix
diff --git a/include/functional b/include/functional
index 3c9f5a7..539a708 100644
--- a/include/functional
+++ b/include/functional
@@ -1475,13 +1475,25 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
} // __function
+typedef typename aligned_storage<3*sizeof(void*)>::type _SmallFuncBuf;
+
@EricWF
EricWF / 32bit_test.cpp
Created October 2, 2015 09:34
results in 32 bit mode
#include "benchmark/benchmark.h"
#include <cstdint>
#include <limits>
using namespace benchmark;
typedef std::uint32_t UInt32;
typedef std::uint64_t UInt64;
template <class IntType>