Skip to content

Instantly share code, notes, and snippets.

Avatar

Jyun-Yan You crabtw

  • Taiwan
View GitHub Profile
@crabtw
crabtw / anonymous.td
Created Nov 20, 2019
llvm tablegen bugs
View anonymous.td
class AAA {
AAA a = !cast<AAA>(NAME);
}
foreach _ = [1, 2] in
def : AAA;
multiclass BBB {
def : AAA;
}
View Indent-blocks-immediately-follow-label.patch
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp
index e5afa1264a..a5691e7c91 100644
--- a/lib/Format/UnwrappedLineParser.cpp
+++ b/lib/Format/UnwrappedLineParser.cpp
@@ -1883,6 +1883,7 @@ void UnwrappedLineParser::parseLabel() {
--Line->Level;
if (CommentsBeforeNextToken.empty() && FormatTok->Tok.is(tok::l_brace)) {
CompoundStatementIndenter Indenter(this, Style, Line->Level);
+ ++Line->Level;
parseBlock(/*MustBeDeclaration=*/false);
View err.cpp
#include <cstdlib>
#include <iostream>
static void err() {
std::cerr << std::endl;
exit(1);
}
template <typename First, typename... Rest>
static void err(First&& first, Rest&&... rest) {
View fmt.cpp
#include <cstdio>
#include <string>
struct Fmt {
operator const char *() {
return fmt.c_str();
}
std::string fmt;
};
@crabtw
crabtw / fix-select-coin.patch
Created Jan 1, 2016
Fix COIN key of gngeo 0.8
View fix-select-coin.patch
--- src/event.c.orig 2016-01-01 15:55:03.995071650 +0800
+++ src/event.c 2016-01-01 15:56:36.584921148 +0800
@@ -385,6 +385,11 @@
if (joy_state[1][GN_START])
memory.intern_start &= 0xFB;
+ if (joy_state[0][GN_SELECT_COIN])
+ memory.intern_start &= 0xFD;
+ if (joy_state[1][GN_SELECT_COIN])
+ memory.intern_start &= 0xF7;
View cef3-gen.sh
LD_PRELOAD=/usr/lib/libclang.so ./bindgen -I/usr/lib/clang/3.5.0/include -Icef3 cef3/include/capi/cef_base_capi.h -match cef_base_capi -lcef3
@crabtw
crabtw / glib2.supp
Last active Jan 8, 2018
valgrind suppression file for glib2
View glib2.supp
# gobject
{
constructor
Memcheck:Leak
...
fun:gobject_init_ctor
}
# glib
View Makefile
RUSTC = rustc
CC = gcc
AR = ar
test: test.rs ffi.o
$(RUSTC) $< -L . -o $@
ffi.o: ffi.c
$(CC) -fPIC -c $< -o $@
View Makefile
CC = gcc
RUSTC = rustc
BINDGEN = bindgen
test: test.rs hello.rs libhello.so
$(RUSTC) $< -L . -o $@
hello.rs: hello.h
$(BINDGEN) -l hello $< -o $@
@crabtw
crabtw / Makefile
Last active Dec 17, 2015
clang arm cross compiler
View Makefile
BIN = arm-linux-gnueabihf-clang
SRC = arm_linux_gnueabihf.ml
LIB = unix.cmxa
all: $(BIN)
$(BIN): $(SRC)
ocamlopt -o $@ $(LIB) $<
You can’t perform that action at this time.