← 返回命令列表

Linux command

llvm-g++ 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Compile C++ program

llvm-g++ -o [program] [source.cpp]

Compile with optimization

llvm-g++ -O2 -o [program] [source.cpp]

Generate LLVM bitcode

llvm-g++ -emit-llvm -c [source.cpp]

说明

llvm-g++ is a G++ frontend for the LLVM compiler infrastructure. Provides GCC-compatible C++ 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.
-std= _standard_
C++ standard version.
-g
Include debug information.

FAQ

What is the llvm-g++ command used for?

llvm-g++ is a G++ frontend for the LLVM compiler infrastructure. Provides GCC-compatible C++ interface that generates LLVM intermediate representation. Deprecated in favor of clang++.

How do I run a basic llvm-g++ example?

Run `llvm-g++ -o [program] [source.cpp]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o _file_ do in llvm-g++?

Output file name.