| theme | class | highlighter | fonts | ||||||
|---|---|---|---|---|---|---|---|---|---|
default |
text-center |
MaskRay |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.14) | |
| project(cminify LANGUAGES C CXX) | |
| add_executable(cminify "") | |
| set(DEFAULT_CMAKE_BUILD_TYPE Release) | |
| set_property(TARGET cminify PROPERTY CXX_STANDARD 17) | |
| set_property(TARGET cminify PROPERTY CXX_STANDARD_REQUIRED ON) | |
| set_property(TARGET cminify PROPERTY CXX_EXTENSIONS OFF) | |
| find_package(Clang REQUIRED) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //__attribute__((gnu_inline)) | |
| EXTERN inline int foo(int a) { return a * a; } | |
| int bar(int a) { return foo(a+1); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Build malloc implementations. | |
| mkdir -p /tmp/p | |
| pushd /tmp/p | |
| if [[ ! -d jemalloc ]]; then | |
| git clone https://github.com/jemalloc/jemalloc | |
| (cd jemalloc | |
| ./autogen.sh | |
| mkdir -p out/release && cd out/release | |
| ../../configure && make -j $(nproc)) | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 7592fc59796cb41a4e7fe0d171b11d4198718a5b Mon Sep 17 00:00:00 2001 | |
| From: Fangrui Song | |
| Date: Sat, 5 Feb 2022 16:48:23 -0800 | |
| Subject: [PATCH] [ELF] Symbol::replace: copy fewer members | |
| Symbol::replace copies the whole struct and then restores some members. | |
| This patch changes it to copy the needed members. | |
| --- | |
| lld/ELF/InputFiles.cpp | 2 + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 7a28e9d1cc99e997ca8e2d463776aaa7e8c1d6da Mon Sep 17 00:00:00 2001 | |
| From: Fangrui Song <> | |
| Date: Mon, 17 Jan 2022 11:25:51 -0800 | |
| Subject: [PATCH] [Support] Add parallelForEach with fixed TaskSize and use it | |
| in lld/ELF's Writer | |
| --- | |
| lld/ELF/OutputSections.cpp | 2 +- | |
| llvm/include/llvm/Support/Parallel.h | 21 +++++++++++++++++++++ | |
| 2 files changed, 22 insertions(+), 1 deletion(-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 088ff7744ff15adc524f21431a5206d6f82f493b Mon Sep 17 00:00:00 2001 | |
| From: Fangrui Song | |
| Date: Thu, 13 Jan 2022 17:05:28 -0800 | |
| Subject: [PATCH] DO NOT SUBMIT! Poor man's concurrent hash map | |
| --- | |
| lld/ELF/SyntheticSections.cpp | 25 +++++++++---------------- | |
| lld/ELF/SyntheticSections.h | 2 +- | |
| lld/include/lld/Common/SpinMutex.h | 28 ++++++++++++++++++++++++++++ | |
| 3 files changed, 38 insertions(+), 17 deletions(-) |
It is by no means accurate and is comparing apples and oranges in many dimensions, e.g.
- Targeting LLVM IR, C, assembly have varying difficulty.
- Some may include runtime while some may not.
- Different compilers are written in different languages. Languages have different expressiveness. Different paradigms have varying expressiveness.
- LLVM has many non-default passes which are not used by regular compilation. I try to use fine-grained directories but still some unneeded files are included.
Nevertheless, here is the result (auxiliary files like shell/Makefile/documentation are ignored):
- gcc (2207000+):
tokei gcc libcpp -e ada -e d -e go -e objc -e objcp -e '*test*'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git i/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp w/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp | |
| index 7ce9e25da342..37ff9af84679 100644 | |
| --- i/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp | |
| +++ w/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp | |
| @@ -458,2 +458,3 @@ static void GetTls(uptr *addr, uptr *size) { | |
| *addr += ThreadDescriptorSize(); | |
| + Printf("+++GetTls: %p %zd\n", *addr, *size); | |
| #elif SANITIZER_GLIBC && defined(__aarch64__) | |
| @@ -462,2 +463,3 @@ static void GetTls(uptr *addr, uptr *size) { | |
| *size = g_tls_size + ThreadDescriptorSize(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __attribute__((visibility("protected"))) | |
| void *func_addr() { return (void *)func_addr; } | |
| __attribute__((visibility("protected"))) void undef_func(); | |
| void *undef_func_addr() { return (void *)undef_func; } | |
| __attribute__((visibility("protected"))) int var; | |
| int load() { return var; } | |
| __attribute__((visibility("protected"))) int inlinable(int x) { return x + x; } |