Skip to content

Commit c72d01c

Browse files
committed
[clang][doc] Simplify Sampling-PGO use example
The -fprofile-sample-use implies codegenoptions::LocTrackingOnly. No need to explicitly specify -g if debug info is not required in final binary. Also fix -fuse-ld=lld.
1 parent c99259e commit c72d01c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/docs/UsersManual.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2778,7 +2778,7 @@ usual build cycle when using sample profilers for optimization:
27782778
27792779
> clang-cl /O2 -gdwarf -gline-tables-only ^
27802780
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
2781-
code.cc /Fe:code /fuse-ld=lld /link /debug:dwarf
2781+
code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
27822782
27832783
.. note::
27842784

@@ -2867,15 +2867,15 @@ usual build cycle when using sample profilers for optimization:
28672867

28682868
.. code-block:: console
28692869
2870-
$ clang++ -O2 -gline-tables-only \
2870+
$ clang++ -O2 \
28712871
-fdebug-info-for-profiling -funique-internal-linkage-names \
28722872
-fprofile-sample-use=code.prof code.cc -o code
28732873
28742874
On Windows:
28752875

28762876
.. code-block:: winbatch
28772877
2878-
> clang-cl /O2 -gdwarf -gline-tables-only ^
2878+
> clang-cl /O2 ^
28792879
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
28802880
-fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
28812881
@@ -2886,15 +2886,15 @@ usual build cycle when using sample profilers for optimization:
28862886

28872887
.. code-block:: console
28882888
2889-
$ clang++ -fsample-profile-use-profi -O2 -gline-tables-only \
2889+
$ clang++ -fsample-profile-use-profi -O2 \
28902890
-fdebug-info-for-profiling -funique-internal-linkage-names \
28912891
-fprofile-sample-use=code.prof code.cc -o code
28922892
28932893
On Windows:
28942894

28952895
.. code-block:: winbatch
28962896
2897-
> clang-cl /clang:-fsample-profile-use-profi /O2 -gdwarf -gline-tables-only ^
2897+
> clang-cl /clang:-fsample-profile-use-profi /O2 ^
28982898
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
28992899
-fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
29002900

0 commit comments

Comments
 (0)