SuccessChanges

Summary

  1. 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
Revision 365413 by nico:
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
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/test/Driver/arm-execute-only.cN/A
The file was modified/cfe/trunk/test/Driver/cl-options.cN/A
The file was modified/cfe/trunk/test/Driver/darwin-version.cN/A
The file was modified/lld/trunk/Common/Reproduce.cppN/A
The file was modified/lld/trunk/ELF/Driver.cppN/A
The file was modified/lld/trunk/test/ELF/sectionstart.sN/A
The file was modified/llvm/trunk/include/llvm/Option/Arg.htrunk/include/llvm/Option/Arg.h
The file was modified/llvm/trunk/include/llvm/Option/Option.htrunk/include/llvm/Option/Option.h
The file was modified/llvm/trunk/lib/Option/Arg.cpptrunk/lib/Option/Arg.cpp
The file was modified/llvm/trunk/lib/Option/Option.cpptrunk/lib/Option/Option.cpp

Summary

  1. 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
  2. [X86][PPC] Support -mlong-double-64 -mlong-double-64 is supported on some ports of gcc (i386, x86_64, and ppc{32,64}). On many other targets, there will be an error: error: unrecognized command line option '-mlong-double-64' This patch makes the driver option -mlong-double-64 available for x86 and ppc. The CC1 option -mlong-double-64 is available on all targets for users to test on unsupported targets. LongDoubleSize is added as a VALUE_LANGOPT so that the option can be shared with -mlong-double-128 when we support it in clang. Also, make powerpc*-linux-musl default to use 64-bit long double. It is currently the only supported ABI on musl and is also how people configure powerpc*-linux-musl-gcc. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D64067
  3. clang-cl: Port cl.exe's C4659 to clang-cl Differential Revision: https://reviews.llvm.org/D64349
  4. [analyzer] exploded-graph-rewriter: Implement a topology-only mode. In this mode the rewriter will only rewrite program points and omit program states. Useful for understanding the rough topology of the graph. Differential Revision: https://reviews.llvm.org/D64264
  5. [analyzer] exploded-graph-rewriter: Implement a single-path mode. Instead of rewriting the whole graph, rewrite the leftmost path in the graph. Useful for trimmed graphs that are still too large to display due to multiple equivalent reports mixed into them. Differential Revision: https://reviews.llvm.org/D64263
  6. [ObjC] Add a -Wtautological-compare warning for BOOL On macOS, BOOL is a typedef for signed char, but it should never hold a value that isn't 1 or 0. Any code that expects a different value in their BOOL should be fixed. rdar://51954400 Differential revision: https://reviews.llvm.org/D63856
Revision 365413 by nico:
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
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/test/Driver/arm-execute-only.ctrunk/test/Driver/arm-execute-only.c
The file was modified/cfe/trunk/test/Driver/cl-options.ctrunk/test/Driver/cl-options.c
The file was modified/cfe/trunk/test/Driver/darwin-version.ctrunk/test/Driver/darwin-version.c
The file was modified/lld/trunk/Common/Reproduce.cppN/A
The file was modified/lld/trunk/ELF/Driver.cppN/A
The file was modified/lld/trunk/test/ELF/sectionstart.sN/A
The file was modified/llvm/trunk/include/llvm/Option/Arg.hN/A
The file was modified/llvm/trunk/include/llvm/Option/Option.hN/A
The file was modified/llvm/trunk/lib/Option/Arg.cppN/A
The file was modified/llvm/trunk/lib/Option/Option.cppN/A
Revision 365412 by maskray:
[X86][PPC] Support -mlong-double-64

-mlong-double-64 is supported on some ports of gcc (i386, x86_64, and ppc{32,64}).
On many other targets, there will be an error:

    error: unrecognized command line option '-mlong-double-64'

This patch makes the driver option -mlong-double-64 available for x86
and ppc. The CC1 option -mlong-double-64 is available on all targets for
users to test on unsupported targets.

LongDoubleSize is added as a VALUE_LANGOPT so that the option can be
shared with -mlong-double-128 when we support it in clang.

Also, make powerpc*-linux-musl default to use 64-bit long double. It is
currently the only supported ABI on musl and is also how people
configure powerpc*-linux-musl-gcc.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D64067
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/include/clang/Basic/LangOptions.deftrunk/include/clang/Basic/LangOptions.def
The file was modified/cfe/trunk/include/clang/Driver/Options.tdtrunk/include/clang/Driver/Options.td
The file was modified/cfe/trunk/lib/Basic/TargetInfo.cpptrunk/lib/Basic/TargetInfo.cpp
The file was modified/cfe/trunk/lib/Basic/Targets/PPC.htrunk/lib/Basic/Targets/PPC.h
The file was modified/cfe/trunk/lib/Driver/ToolChains/Clang.cpptrunk/lib/Driver/ToolChains/Clang.cpp
The file was modified/cfe/trunk/lib/Frontend/CompilerInvocation.cpptrunk/lib/Frontend/CompilerInvocation.cpp
The file was removed/cfe/trunk/test/CodeGen/long-double-x86.ctrunk/test/CodeGen/long-double-x86.c
The file was removed/cfe/trunk/test/CodeGen/ppc64-align-long-double.ctrunk/test/CodeGen/ppc64-align-long-double.c
The file was added/cfe/trunk/test/CodeGen/ppc64-long-double.cpptrunk/test/CodeGen/ppc64-long-double.cpp
The file was added/cfe/trunk/test/CodeGen/x86-long-double.cpptrunk/test/CodeGen/x86-long-double.cpp
The file was added/cfe/trunk/test/Driver/mlong-double-64.ctrunk/test/Driver/mlong-double-64.c
Revision 365411 by nico:
clang-cl: Port cl.exe's C4659 to clang-cl

Differential Revision: https://reviews.llvm.org/D64349
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/include/clang/Basic/Attr.tdtrunk/include/clang/Basic/Attr.td
The file was modified/cfe/trunk/include/clang/Basic/DiagnosticGroups.tdtrunk/include/clang/Basic/DiagnosticGroups.td
The file was modified/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.tdtrunk/include/clang/Basic/DiagnosticSemaKinds.td
The file was modified/cfe/trunk/lib/Sema/SemaAttr.cpptrunk/lib/Sema/SemaAttr.cpp
The file was modified/cfe/trunk/lib/Sema/SemaDeclAttr.cpptrunk/lib/Sema/SemaDeclAttr.cpp
The file was modified/cfe/trunk/test/Sema/pragma-section.ctrunk/test/Sema/pragma-section.c
Revision 365410 by dergachev:
[analyzer] exploded-graph-rewriter: Implement a topology-only mode.

In this mode the rewriter will only rewrite program points
and omit program states. Useful for understanding
the rough topology of the graph.

Differential Revision: https://reviews.llvm.org/D64264
Change TypePath in RepositoryPath in Workspace
The file was added/cfe/trunk/test/Analysis/exploded-graph-rewriter/topology.dottrunk/test/Analysis/exploded-graph-rewriter/topology.dot
The file was modified/cfe/trunk/utils/analyzer/exploded-graph-rewriter.pytrunk/utils/analyzer/exploded-graph-rewriter.py
Revision 365409 by dergachev:
[analyzer] exploded-graph-rewriter: Implement a single-path mode.

Instead of rewriting the whole graph, rewrite the leftmost path in the
graph. Useful for trimmed graphs that are still too large to display due
to multiple equivalent reports mixed into them.

Differential Revision: https://reviews.llvm.org/D64263
Change TypePath in RepositoryPath in Workspace
The file was added/cfe/trunk/test/Analysis/exploded-graph-rewriter/explorers.dottrunk/test/Analysis/exploded-graph-rewriter/explorers.dot
The file was modified/cfe/trunk/utils/analyzer/exploded-graph-rewriter.pytrunk/utils/analyzer/exploded-graph-rewriter.py
Revision 365408 by epilk:
[ObjC] Add a -Wtautological-compare warning for BOOL

On macOS, BOOL is a typedef for signed char, but it should never hold a value
that isn't 1 or 0. Any code that expects a different value in their BOOL should
be fixed.

rdar://51954400

Differential revision: https://reviews.llvm.org/D63856
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/include/clang/Basic/DiagnosticGroups.tdtrunk/include/clang/Basic/DiagnosticGroups.td
The file was modified/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.tdtrunk/include/clang/Basic/DiagnosticSemaKinds.td
The file was modified/cfe/trunk/lib/Sema/SemaChecking.cpptrunk/lib/Sema/SemaChecking.cpp
The file was added/cfe/trunk/test/Sema/tautological-objc-bool-compare.mtrunk/test/Sema/tautological-objc-bool-compare.m