1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/lib
Nico Weber 1254b69520 Let unaliased Args track which Alias they were created from, and use that in Arg::getAsString() for diagnostics
With this, `clang-cl /source-charset:utf-16 test.cc` now prints `invalid
value 'utf-16' in '/source-charset:utf-16'` instead of `invalid value
'utf-16' in '-finput-charset=utf-16'` before, and several other clang-cl
flags produce much less confusing output as well.

Fixes PR29106.

Since an arg and its alias can have different arg types (joined vs not)
and different values (because of AliasArgs<>), I chose to give the Alias
its own Arg object. For convenience, I just store the alias directly in
the unaliased arg – there aren't many arg objects at runtime, so that
seems ok.

Finally, I changed Arg::getAsString() to use the alias's representation
if it's present – that function was already documented as being the
suitable function for diagnostics, and most callers already used it for
diagnostics.

Implementation-wise, Arg::accept() previously used to parse things as
the unaliased option. The core of that switch is now extracted into a
new function acceptInternal() which parses as the _aliased_ option, and
the previously-intermingled unaliasing is now done as an explicit step
afterwards.

(This also changes one place in lld that didn't use getAsString() for
diagnostics, so that that one place now also prints the flag as the user
wrote it, not as it looks after it went through unaliasing.)

Differential Revision: https://reviews.llvm.org/D64253

llvm-svn: 365413
2019-07-09 00:34:08 +00:00
..
Analysis [SCEV] Fix for PR42397. SCEVExpander wrongly adds nsw to shl instruction. 2019-07-08 18:03:43 +00:00
AsmParser Add, and infer, a nofree function attribute 2019-07-08 15:57:56 +00:00
BinaryFormat [AMDGPU] Added a new metadata for multi grid sync implicit argument 2019-07-05 16:05:17 +00:00
Bitcode [Bitcode][NFC] Remove unused variable from BitcodeAnalyzer 2019-07-08 16:19:45 +00:00
Bitstream [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
CodeGen Standardize on MSVC behavior for triples with no environment 2019-07-08 21:05:20 +00:00
DebugInfo Teach the symbolizer lib symbolize objects directly. 2019-07-08 19:28:57 +00:00
Demangle
ExecutionEngine [JITLink][ORC] Add EHFrameRegistrar interface, use in EHFrameRegistrationPlugin. 2019-07-04 00:05:12 +00:00
Fuzzer
FuzzMutate
IR Standardize on MSVC behavior for triples with no environment 2019-07-08 21:05:20 +00:00
IRReader
LineEditor
Linker
LTO [ThinLTO] Attempt to recommit r365188 after alignment fix 2019-07-05 15:25:05 +00:00
MC Standardize on MSVC behavior for triples with no environment 2019-07-08 21:05:20 +00:00
MCA
Object [Object/ELF.h] - Improve error reporting. 2019-07-05 11:28:49 +00:00
ObjectYAML [yaml2obj] - Allow overriding sh_offset field from the YAML. 2019-07-02 10:20:12 +00:00
Option Let unaliased Args track which Alias they were created from, and use that in Arg::getAsString() for diagnostics 2019-07-09 00:34:08 +00:00
Passes
ProfileData Cleanup: llvm::bsearch -> llvm::partition_point after r364719 2019-06-30 11:19:56 +00:00
Remarks Fix MSVC "not all control paths return a value" warnings. NFCI. 2019-07-04 09:46:06 +00:00
Support Revert "[FileCheck] Simplify numeric variable interface" 2019-07-05 22:23:27 +00:00
TableGen
Target [AArch64][GlobalISel] Use TST for comparisons when possible 2019-07-08 22:58:36 +00:00
Testing
TextAPI Cleanup: llvm::bsearch -> llvm::partition_point after r364719 2019-06-30 11:19:56 +00:00
ToolDrivers lld, llvm-dlltool, llvm-lib: Use getAsString() instead of getSpelling() for printing unknown args 2019-07-05 12:31:32 +00:00
Transforms [Attributor] Deduce the "returned" argument attribute 2019-07-08 23:27:20 +00:00
WindowsManifest
XRay
CMakeLists.txt [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
LLVMBuild.txt [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00