-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Clarify documentation for -funique-source-file-names. #135832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify documentation for -funique-source-file-names. #135832
Conversation
Created using spr 1.3.6-beta.1
@llvm/pr-subscribers-clang Author: Peter Collingbourne (pcc) ChangesFull diff: https://github.com/llvm/llvm-project/pull/135832.diff 1 Files Affected:
diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index d4656a7e63c99..c75e409dde55e 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -2301,11 +2301,31 @@ are listed below.
When enabled, allows the compiler to assume that each object file
passed to the linker has been compiled using a unique source file
- name. This is useful for reducing link times when doing ThinLTO
+ path. This is useful for reducing link times when doing ThinLTO
in combination with whole-program devirtualization or CFI.
- A misuse of this flag will generally result in a duplicate symbol
- error at link time.
+ The full source path passed to the compiler must be unique. This
+ means that, for example, the following is a usage error:
+
+ .. code-block:: console
+
+ $ cd foo
+ $ clang -funique-source-file-names -c foo.c
+ $ cd ../bar
+ $ clang -funique-source-file-names -c foo.c
+ $ cd ..
+ $ clang foo/foo.o bar/foo.o
+
+ but this is not:
+
+ .. code-block:: console
+
+ $ clang -funique-source-file-names -c foo/foo.c
+ $ clang -funique-source-file-names -c bar/foo.c
+ $ clang foo/foo.o bar/foo.o
+
+ A misuse of this flag will generally either be harmless or result
+ in a duplicate symbol error at link time.
.. option:: -fforce-emit-vtables
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with one suggestion below
clang/docs/UsersManual.rst
Outdated
$ clang -funique-source-file-names -c bar/foo.c | ||
$ clang foo/foo.o bar/foo.o | ||
|
||
A misuse of this flag will generally either be harmless or result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to remove the harmless comment as it would be good to discourage uses that violate the intent. So maybe just "may result in a duplicate ..." ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Created using spr 1.3.6-beta.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will leave this for a bit in case @efriedma-quic has any comments
clang/docs/UsersManual.rst
Outdated
$ clang -funique-source-file-names -c bar/foo.c | ||
$ clang foo/foo.o bar/foo.o | ||
|
||
A misuse of this flag will generally either be harmless or result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Reviewers: efriedma-quic, teresajohnson Reviewed By: teresajohnson, efriedma-quic Pull Request: llvm/llvm-project#135832
Reviewers: efriedma-quic, teresajohnson Reviewed By: teresajohnson, efriedma-quic Pull Request: llvm#135832
No description provided.