How is clang able to steer C/C++ code optimization?

后端 未结 2 595
囚心锁ツ
囚心锁ツ 2021-02-05 19:24

I was told that clang is a driver that works like gcc to do preprocessing, compilation and linkage work. During the compilation and linkage, as far as I know, it\'s actually llv

2条回答
  •  盖世英雄少女心
    2021-02-05 19:48

    It's not exactly like GCC, so don't spend too much time trying to match the two precisely.

    The LLVM compiler is a compiler for one specific language, LLVM. What Clang does is compile C++ code to LLVM, without optimizations. Clang can then invoke the LLVM compiler to compile that LLVM code to optimized assembly.

提交回复
热议问题