Linux command
llvm-gcc 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Compile C program
llvm-gcc -o [program] [source.c]
Compile with optimization
llvm-gcc -O2 -o [program] [source.c]
Generate LLVM bitcode
llvm-gcc -emit-llvm -c [source.c]
说明
llvm-gcc is a GCC frontend for the LLVM compiler infrastructure. Provides GCC-compatible interface that generates LLVM intermediate representation. Deprecated in favor of clang.
参数
- -o _file_
- Output file name.
- -O _level_
- Optimization level (0-3).
- -emit-llvm
- Generate LLVM bitcode.
- -c
- Compile only, no linking.
- -S
- Generate assembly output.
- -g
- Include debug information.
FAQ
What is the llvm-gcc command used for?
llvm-gcc is a GCC frontend for the LLVM compiler infrastructure. Provides GCC-compatible interface that generates LLVM intermediate representation. Deprecated in favor of clang.
How do I run a basic llvm-gcc example?
Run `llvm-gcc -o [program] [source.c]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o _file_ do in llvm-gcc?
Output file name.