Custom made language with LLVM 13 which destructs any variable (removes from memory) after a single use in code if prepended with ~
. Based on C++.
The following are unimplemented:
- One-liner else if
- do... while
Only one "destructive" (DC) variable must remain in memory, multiple DC variables at the same time are not supported.
TO-DO: linker errors out with the .rodata
ELF section (-fPIE
/ -no-pie
does not make a difference).
Download precompiled binaries for LLVM and Clang 13.0.1-3 from the following link: https://repo.msys2.org/mingw/mingw64/
pacman -S cmake make git
git clone https://github.com/GDhex12/DestructiveC.git
pacman -U mingw-w64-x86_64-clang-13.0.1-3-any.pkg.tar.zst
pacman -U mingw-w64-x86_64-llvm-13.0.1-3-any.pkg.tar.zst
cd DestructiveC && mkdir build && cd build
cmake -DCMAKE_C_COMPILER=/mingw64/bin/clang.exe -DCMAKE_CXX_COMPILER=/mingw64/bin/clang++.exe ..
Copy over the stdlib.h
and math.h
headers from /mingw64/include
to /mingw64/x86_64-w64-mingw32/include
to bypass a CMake bug.
make -j<THREAD_COUNT>
DC "path/to/langfile.dc"
clang++ bin/start.cpp "path/to/langfile.o" -o path/to/outexec