Skip to content

Instantly share code, notes, and snippets.

View d0k's full-sized avatar

Benjamin Kramer d0k

View GitHub Profile
@d0k
d0k / test_lint.py
Created February 11, 2014 17:28
LLVM test linter
#!/usr/bin/env python
import os
import re
import sys
comments = [";", "//", "#"]
fileendings = re.compile("\.(ll|cpp|c)$")
prefixcheck = re.compile("-check-prefix[ =]([A-Za-z0-9_.\-]*)")
placeholders = re.compile("%[sStTp]")
#include <stdlib.h>
enum E { A, B };
int foo(enum E x) {
switch (x) {
case A:
return 42;
case B:
return 23;
}
diff --git a/lib/Format/ContinuationIndenter.h b/lib/Format/ContinuationIndenter.h
index 2b33f5b..1d88d05 100644
--- a/lib/Format/ContinuationIndenter.h
+++ b/lib/Format/ContinuationIndenter.h
@@ -228,37 +228,22 @@ struct ParenState {
bool ObjCSelectorNameFound;
bool operator<(const ParenState &Other) const {
- if (Indent != Other.Indent)
- return Indent < Other.Indent;
@d0k
d0k / log.txt
Created June 25, 2015 13:57
Single bit flip in system header.
make[1]: Entering directory `/home/buildslave/slave_as-bldslv2/clang-native-arm-cortex-a9/llvm.obj/lib/Support'
llvm[1]: Compiling APFloat.cpp for Release+Asserts build
llvm[1]: Compiling APInt.cpp for Release+Asserts build
In file included from /usr/include/c++/4.8/ios:42:0,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iterator:64,
from /home/buildslave/slave_as-bldslv2/clang-native-arm-cortex-a9/llvm.src/include/llvm/ADT/SmallVector.h:28,
from /home/buildslave/slave_as-bldslv2/clang-native-arm-cortex-a9/llvm.src/include/llvm/ADT/ArrayRef.h:14,
from /home/buildslave/slave_as-bldslv2/clang-native-arm-cortex-a9/llvm.src/include/llvm/ADT/APInt.h:19,
from /home/buildslave/slave_as-bldslv2/clang-native-arm-cortex-a9/llvm.src/include/llvm/ADT/APFloat.h:20,
@d0k
d0k / crash.cpp
Created November 23, 2022 18:35
cf624b23bc5d5a6161706d1663def49380ff816a reproducer
// RUN: clang -target aarch64-linux-gnu -O2 crash.cpp
template <class d> struct g { using e = d; };
template <bool, class f, class> using aa = g<f>::e;
enum { ab };
struct i {
enum { ac, h };
};
struct m {
enum { j };
};