Clang Compiler Stages

The Clang compiler is built on the basis of the LLVM infrastructure, the Clang interface uses C / C ++ source code and generates LLVM-IR, who does the work with the Optimizer and code generation?

Since optimizer pass libraries must be strategically placed and called in order to generate optimized code, where the order is specified, who generates the target code? Is this part of the Clang Fronted program, or is there any other program that does this optimization and creation?

+4
source share
1 answer

There are actually two clangs.

: , (AST) . . -cc1, : clang -cc1 -ast-dump

-, : front-end LLVM IR , , . , clang main.c .

, , clangs:

clang -help
clang -help-hidden
clang -cc1 -help
clang -cc1 -help-hidden
+2

Source: https://habr.com/ru/post/1648360/


All Articles