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.