-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclang
More file actions
52 lines (38 loc) · 1.8 KB
/
clang
File metadata and controls
52 lines (38 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// use -Xclang to load shared library and pass argument to "clang -cc1"
~/git/1/llvm-project/build/bin/clang++ -Xclang -load -Xclang ~/git/1/llvm-project/build/lib/PrintFunctionNames.so -Xclang -add-plugin -Xclang print-fns -Xclang -plugin-arg-print-fns -Xclang help -Xclang -emit-llvm -S hello.c -o -
// use -v to see full clang -cc1 options
clang++ -v hello.c
//
// http://clang-developers.42468.n3.nabble.com/AST-modifications-that-apply-to-the-binary-td4054289.html
BirenTensorAction::ActionType BirenTensorAction::getActionType() {
return AddBeforeMainAction;
}
bool BirenTensorAction::usesPreprocessorOnly() const { return false; }
// rewrite ast nodes
https://blog.csdn.net/sfdazsdf/article/details/46975169
ARC(Automatic Reference Count) Migrate
example:
https://github.com/eliben/llvm-clang-samples
commit c9abc99560f201e98fc3892a6be79237bd505efb
Author: Eli Bendersky <eliben@google.com>
Date: Tue Sep 18 09:21:57 2018 -0700
Make stop image smaller
llvm-clang-samples.patch
build with llvm-6.0.0
// clang doc
https://clang.llvm.org/docs/index.html
// clang-query
https://static.linaro.org/connect/yvr18/presentations/yvr18-223.pdf
// build clang-tools-extra on llvm 14.x
cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_PARALLEL_COMPILE_JOBS=4 -DLLVM_PARALLEL_LINK_JOBS=1 -G "Ninja" ../llvm -DCLANG_BUILD_EXAMPLES=ON -DLLVM_BUILD_TESTS=ON
// clang AST structure
http://swtv.kaist.ac.kr/courses/cs453-fall13/Clang%20tutorial%20v4.pdf
https://clang.llvm.org/docs/RAVFrontendAction.html
// clang build cross compiler
https://clang.llvm.org/docs/CrossCompilation.html
// Auto Vectorizer
https://llvm.org/docs/Vectorizers.html
// build test-suite
ref. note/llvm-test-suite
// turn off slp vectorize
https://github.com/Jonathan2251/ex/clang/vectorize/Godbolt.cpp