Skip to content

Commit a1d52fc

Browse files
authored
Clarify documentation for -funique-source-file-names.
Reviewers: efriedma-quic, teresajohnson Reviewed By: teresajohnson, efriedma-quic Pull Request: #135832
1 parent a3283a9 commit a1d52fc

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

clang/docs/UsersManual.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,11 +2301,31 @@ are listed below.
23012301

23022302
When enabled, allows the compiler to assume that each object file
23032303
passed to the linker has been compiled using a unique source file
2304-
name. This is useful for reducing link times when doing ThinLTO
2304+
path. This is useful for reducing link times when doing ThinLTO
23052305
in combination with whole-program devirtualization or CFI.
23062306

2307-
A misuse of this flag will generally result in a duplicate symbol
2308-
error at link time.
2307+
The full source path passed to the compiler must be unique. This
2308+
means that, for example, the following is a usage error:
2309+
2310+
.. code-block:: console
2311+
2312+
$ cd foo
2313+
$ clang -funique-source-file-names -c foo.c
2314+
$ cd ../bar
2315+
$ clang -funique-source-file-names -c foo.c
2316+
$ cd ..
2317+
$ clang foo/foo.o bar/foo.o
2318+
2319+
but this is not:
2320+
2321+
.. code-block:: console
2322+
2323+
$ clang -funique-source-file-names -c foo/foo.c
2324+
$ clang -funique-source-file-names -c bar/foo.c
2325+
$ clang foo/foo.o bar/foo.o
2326+
2327+
A misuse of this flag may result in a duplicate symbol error at
2328+
link time.
23092329

23102330
.. option:: -fforce-emit-vtables
23112331

0 commit comments

Comments
 (0)