Skip to content

Instantly share code, notes, and snippets.

View chapuni's full-sized avatar

NAKAMURA Takumi chapuni

View GitHub Profile
@chapuni
chapuni / simple-var-capture.txt
Created July 31, 2013 10:10
Testscases for llvm/test/FileCheck/simple-var-capture.txt, about variables with backslashes
// Variable should be matched to backslashes.
posix: /path/to/posix/file
dos: c:\path\to\dos\file
dosx: d:\\path\\to\\escaped\\file
CHECK: posix: [[POSIX:.*]]/file
CHECK: dos: [[DOS:.*]]/file
CHECK: posix: [[DOSX:.*]]/file
POSIX should be matched to /path/to/posix/file(/path/to/posix)
DOS should be matched to c:\path\to\dos\file(c:\path\to\dos)
@chapuni
chapuni / gist:6723657
Created September 27, 2013 03:06
To appease msc16
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp
index e2ff6d6..648ed4f 100644
--- a/clang/lib/Lex/LiteralSupport.cpp
+++ b/clang/lib/Lex/LiteralSupport.cpp
@@ -20,6 +20,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/ErrorHandling.h"
+#include <cstdio>
@chapuni
chapuni / gist:7426919
Created November 12, 2013 07:23
dependencies to msvcrt.dll in mingw's clang.exe
024a303c 024a3210 00000000 00000000 024a4404 024a3558
DLL Name: msvcrt.dll
vma: Hint/Ord Member-Name Bound-To
24a3dea 6 _close
24a3df4 23 _fdopen
24a3dfe 32 _fstat
24a3e08 51 _lseek
24a3e12 64 _read
24a3e1a 68 _setmode
@chapuni
chapuni / gist:8171944
Created December 29, 2013 16:12
Fix broken cmake build
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -134,13 +134,13 @@ ${name} ignored.")
set(libkind SHARED)
endif()
+ add_library( ${name} ${libkind} ${ALL_FILES} )
+ set_target_properties( ${name} PROPERTIES PREFIX "" )
+
if (LLVM_EXPORTED_SYMBOL_FILE)
@chapuni
chapuni / a-sroa.ll
Created January 29, 2014 10:26
-sroa inducts undef... {i8,i8,i8} to i32
; ModuleID = '<stdin>'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-redhat-linux"
module asm "\09.ident\09\22GCC: (GNU) 4.7.2 20121015 (Red Hat 4.7.2-5) LLVM: \22"
%struct.SourceRange = type { %struct.SourceLocation, %struct.SourceLocation }
%struct.SourceLocation = type { i32 }
%struct.CharSourceRange = type { %struct.SourceRange, i8, [3 x i8] }
%struct.RewriteOptions = type { i8, i8, i8 }
File: <stdin>
Format: ELF32-arm
Arch: arm
AddressSize: 32bit
LoadName:
BuildAttributes {
FormatVersion: 0x41
Section 1 {
SectionLength: 124
@chapuni
chapuni / libclang.so
Created January 31, 2014 00:14
Mature link order of libclang.so
lib/libclangARCMigrate.a
lib/libclangIndex.a
lib/libclangStaticAnalyzerCheckers.a
lib/libclangStaticAnalyzerCore.a
lib/libclangFormat.a
lib/libclangTooling.a
lib/libclangFrontend.a
lib/libclangSerialization.a
lib/libLLVMBitReader.a
lib/libclangParse.a
@chapuni
chapuni / gist:8981318
Created February 13, 2014 18:49
awful log...
21:28 (bb-chapuni) build #222 of clang-3stage-i686-cygwin is complete: Failure [failed configure compile] Build details are at http://bb.pgr.jp/builders/clang-3stage-i686-cygwin/builds/222 blamelist: Owen Anderson <resistor@mac.com>, Akira Hatanaka <ahatanaka@mips.com>, Yunzhong Gao <Yunzhong_Gao@playstation.sony.com>, Adrian Prantl <aprantl@apple.com>, Craig Topper
21:28 (bb-chapuni) <craig.topper@gmail.com>, Alexander Kornienko <alexfh@google.com>, Alexey Bataev <a.bataev@hotmail.com>, Benjamin Kramer <benny.kra@googlemail.com>, Dmitri Gribenko <gribozavr@gmail.com>, David Blaikie <dblaikie@gmail.com>, Rafael Espindola <rafael.espindola@gmail.com>, David Fang <fang@csl.cornell.edu>, Amara Emerson <amara.emerson@arm.com>, Andrea Di Biagio
21:28 (bb-chapuni) <Andrea_DiBiagio@sn.scee.net>, Sylvestre Ledru <sylvestre@debian.org>, Evan Cheng <evan.cheng@apple.com>, Eric Christopher <echristo@gmail.com>, John McCall <rjmccall@apple.com>, Hans Wennborg <hans@hanshq.net>, Juergen Ributzka <juergen@apple.com>, NAK
index f3481c1..37a5c8e 100644
--- a/clang/include/clang/AST/DataRecursiveASTVisitor.h
+++ b/clang/include/clang/AST/DataRecursiveASTVisitor.h
@@ -598,8 +598,8 @@ bool DataRecursiveASTVisitor<Derived>::TraverseDecl(Decl *D) {
}
// Visit any attributes attached to this declaration.
- for (Decl::attr_iterator I=D->attr_begin(), E=D->attr_end(); I != E; ++I) {
- if (!getDerived().TraverseAttr(*I))
+ for (auto I : D->attrs()) {
@chapuni
chapuni / gist:9482736
Created March 11, 2014 10:00
Clang :: CodeGen/builtins-arm-exclusive.c
; ModuleID = '/home/chapuni/llvm-project/clang/test/CodeGen/builtins-arm-exclusive.c'
target datalayout = "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv7--linux-gnueabi"
%struct.Simple = type { i8, i8 }
; Function Attrs: nounwind
define i32 @atomic_inc(i32* %addr) #0 {
br label %1