diff options
author | Eric Fiselier <eric@efcs.ca> | 2018-02-07 18:36:51 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2018-02-07 18:36:51 +0000 |
commit | 123c749ee9973c20bbcb9ecfe6f9b0860b55bc51 (patch) | |
tree | 741a4029a14ff3cbb55afbad42ebe6cbe21ec415 /clang/docs/UsersManual.rst | |
parent | d18430018d7798494a117931735d236d726a91fc (diff) | |
download | bcm5719-llvm-123c749ee9973c20bbcb9ecfe6f9b0860b55bc51.tar.gz bcm5719-llvm-123c749ee9973c20bbcb9ecfe6f9b0860b55bc51.zip |
[Driver] Add option to manually control discarding value names in LLVM IR.
Summary:
Currently, assertion-disabled Clang builds emit value names when generating LLVM IR. This is controlled by the `NDEBUG` macro, and is not easily overridable. In order to get IR output containing names from a release build of Clang, the user must manually construct the CC1 invocation w/o the `-discard-value-names` option. This is less than ideal.
For example, Godbolt uses a release build of Clang, and so when asked to emit LLVM IR the result lacks names, making it harder to read. Manually invoking CC1 on Compiler Explorer is not feasible.
This patch adds the driver options `-fdiscard-value-names` and `-fno-discard-value-names` which allow the user to override the default behavior. If neither is specified, the old behavior remains.
Reviewers: erichkeane, aaron.ballman, lebedev.ri
Reviewed By: aaron.ballman
Subscribers: bogner, cfe-commits
Differential Revision: https://reviews.llvm.org/D42887
llvm-svn: 324498
Diffstat (limited to 'clang/docs/UsersManual.rst')
-rw-r--r-- | clang/docs/UsersManual.rst | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst index 84dfe9fc3d7..09e9f9e6609 100644 --- a/clang/docs/UsersManual.rst +++ b/clang/docs/UsersManual.rst @@ -1855,6 +1855,27 @@ features. You can "tune" the debug info for one of several different debuggers. must come first.) +Controlling LLVM IR Output +-------------------------- + +Controlling Value Names in LLVM IR +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Emitting value names in LLVM IR increases the size and verbosity of the IR. +By default, value names are only emitted in assertion-enabled builds of Clang. +However, when reading IR it can be useful to re-enable the emission of value +names to improve readability. + +.. option:: -fdiscard-value-names + + Discard value names when generating LLVM IR. + +.. option:: -fno-discard-value-names + + Do not discard value names when generating LLVM IR. This option can be used + to re-enable names for release builds of Clang. + + Comment Parsing Options ----------------------- |