Skip to content

Instantly share code, notes, and snippets.

View jroelofs's full-sized avatar

Jon Roelofs jroelofs

View GitHub Profile
@jroelofs
jroelofs / gist:cc05549e8028c82ec252
Created August 26, 2014 23:45
locale_android.cpp
// -*- C++ -*-
//===-------------------- support/win32/locale_win32.cpp ------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//===--------------------------- Unwind-arm.c ----------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//
// Implements ARM zero-cost C++ exceptions
//
@jroelofs
jroelofs / test_wrapper.cc
Created December 9, 2014 21:11
Wrapper for semihosted QEMU tests
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
extern "C" {
int on_exit(void (*function)(int , void *), void *arg);
static void register_printers() __attribute__ ((constructor));
static void exit_status_printer(int i, void* a);
static void signal_printer(int sig);
@jroelofs
jroelofs / README.md
Last active October 20, 2019 11:11
Git commit message hook

Git Commit Message Hook

Installation

$ mv commit-msg* .git/hooks
$ chmod u+x .git/hooks/commit-msg*

Use

@jroelofs
jroelofs / README.md
Last active August 29, 2015 14:22
Diff program for JSON dictionaries

JSON Differ

Usage

$ jdiff.py from-file to-file
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 244611)
+++ CMakeLists.txt (working copy)
@@ -166,7 +166,7 @@
# Setup Compiler Flags
#===============================================================================
-include(HandleLibCXXABI) # Steup the ABI library flags
+include(HandleLibCXXABI) # Setup the ABI library flags
@jroelofs
jroelofs / gpg-git-smudge-clean.md
Created February 19, 2016 13:12 — forked from g-k/gpg-git-smudge-clean.md
test transparent git encryption with smudge clean filters using gpg

Generate a GPG Key and revocation cert per http://www.gnupg.org/gpg/en/manual.html:

gpg --key-gen
gpg --output revoke.asc --gen-revoke <my user ID or email>

Once gpg key in keyring we can encrypt and decrypt files.

@jroelofs
jroelofs / notty.cpp
Last active March 9, 2020 15:40
Inverted std::optional's
// Utility that makes it a little bit nicer to
// invert the condition on assignment from optional:
// if ((Not{foo} = maybeMakeFoo()) {
// std::cerr << "can't make foo\n";
// }
#include <optional>
template<typename T>
struct Not {
@jroelofs
jroelofs / has_feature_fuzzer.diff
Created March 25, 2020 15:52
__has_feature(fuzzer)
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index 4c7af39e93e..85eca5034fb 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -2823,8 +2823,8 @@ Extensions for Dynamic Analysis
Use ``__has_feature(address_sanitizer)`` to check if the code is being built
with :doc:`AddressSanitizer`.
-Use ``__has_feature(thread_sanitizer)`` to check if the code is being built
-with :doc:`ThreadSanitizer`.
diff --git a/llvm/include/llvm/Support/FileCheck.h b/llvm/include/llvm/Support/FileCheck.h
index 429e36cfcbb..5925fa811ca 100644
--- a/llvm/include/llvm/Support/FileCheck.h
+++ b/llvm/include/llvm/Support/FileCheck.h
@@ -61,7 +61,10 @@ enum FileCheckKind {
CheckBadNot,
/// Marks when parsing found a -COUNT directive with invalid count value.
- CheckBadCount
+ CheckBadCount,