Перейти к содержимому

How Clang compiles your C code

Bare Metal Studio

0:00 / 0:00

How Clang compiles your C code

9 244 просмотра · 1 месяц назад
Bare Metal Studio
5,23 тыс. подписчиков
9 244 просмотра · 1 месяц назад
In this video, I break down exactly what happens when Clang compiles a C program - from the original .c file all the way down to machine code. We look at the different stages of the compilation process, including preprocessing, the AST, LLVM IR, optimisation, assembly, object files, linking, and finally the executable that your CPU can run. Along the way, I also show how Clang transforms your code, why object files aren’t executable on their own, and how the linker resolves functions across multiple files. If you’re learning C, compilers, assembly, or low-level programming, this should give you a much clearer picture of what’s actually happening when you run: clang main.c -o main Let me know if you’d like to see a deeper dive into LLVM IR or the linker next. Timestamps 0:00 - Introduction 2:30 - main.c 4:47 - Compiling 6:36 - Preprocessor 10:41 - Book Recommendations 12:32 - AST 18:29 - Intermediate Representation 25:46 - Assembly 28:25 - Test 30:00 - Object Files 34:57 - Linker 38:14 - Conclusion #CProgramming #Clang #LLVM #Compilers #LowLevelProgramming