mirror of https://github.com/CrimsonTome/tldr.git
clang, clang++, gcc, g++: edit page (#11629)
parent
1b8d89e38d
commit
ee1478533d
|
@ -23,3 +23,7 @@
|
||||||
- Compile source code into LLVM Intermediate Representation (IR):
|
- Compile source code into LLVM Intermediate Representation (IR):
|
||||||
|
|
||||||
`clang++ -S -emit-llvm {{path/to/source.cpp}} -o {{path/to/output.ll}}`
|
`clang++ -S -emit-llvm {{path/to/source.cpp}} -o {{path/to/output.ll}}`
|
||||||
|
|
||||||
|
- Optimize the compiled program for performance:
|
||||||
|
|
||||||
|
`clang++ {{path/to/source.cpp}} -O{{1|2|3|fast}} -o {{path/to/output_executable}}`
|
||||||
|
|
|
@ -22,3 +22,7 @@
|
||||||
- Compile source code without linking:
|
- Compile source code without linking:
|
||||||
|
|
||||||
`clang -c {{input_source.c}}`
|
`clang -c {{input_source.c}}`
|
||||||
|
|
||||||
|
- Optimize the compiled program for performance:
|
||||||
|
|
||||||
|
`clang {{path/to/source.c}} -O{{1|2|3|fast}}`
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
|
|
||||||
`g++ -c {{path/to/source_1.cpp path/to/source_2.cpp ...}} && g++ -o {{path/to/output_executable}} {{path/to/source_1.o path/to/source_2.o ...}}`
|
`g++ -c {{path/to/source_1.cpp path/to/source_2.cpp ...}} && g++ -o {{path/to/output_executable}} {{path/to/source_1.o path/to/source_2.o ...}}`
|
||||||
|
|
||||||
|
- Optimize the compiled program for performance:
|
||||||
|
|
||||||
|
`g++ {{path/to/source.cpp}} -O{{1|2|3|fast}} -o {{path/to/output_executable}}`
|
||||||
|
|
||||||
- Display version:
|
- Display version:
|
||||||
|
|
||||||
`g++ --version`
|
`g++ --version`
|
||||||
|
|
|
@ -22,3 +22,7 @@
|
||||||
- Compile source code into an object file without linking:
|
- Compile source code into an object file without linking:
|
||||||
|
|
||||||
`gcc -c {{path/to/source.c}}`
|
`gcc -c {{path/to/source.c}}`
|
||||||
|
|
||||||
|
- Optimize the compiled program for performance:
|
||||||
|
|
||||||
|
`gcc {{path/to/source.c}} -O{{1|2|3|fast}}`
|
||||||
|
|
Loading…
Reference in New Issue