diff options
author | Don Hinton <hintonda@gmail.com> | 2019-05-03 18:56:25 +0000 |
---|---|---|
committer | Don Hinton <hintonda@gmail.com> | 2019-05-03 18:56:25 +0000 |
commit | f6eac2dd3b3adec4ea9f31316282d11354cf2f4a (patch) | |
tree | 76d51b1ce597405e2c2a4215e84bb65962996789 /llvm/lib/Support/CommandLine.cpp | |
parent | 83c95b1ec80df675d40b302fbd21e3c9da83f086 (diff) | |
download | bcm5719-llvm-f6eac2dd3b3adec4ea9f31316282d11354cf2f4a.tar.gz bcm5719-llvm-f6eac2dd3b3adec4ea9f31316282d11354cf2f4a.zip |
[CommandLine] Enable Grouping for short options by default. Part 4 of 5
Summary:
This change enables `cl::Grouping` for short options --
options with names of a single character. This is consistent with GNU
getopt behavior.
Reviewers: rnk, MaskRay
Reviewed By: MaskRay
Subscribers: thopre, cfe-commits, MaskRay, rupprecht, hiraditya, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D61270
llvm-svn: 359917
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 1ca31b69c78..ff53fefefea 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -421,6 +421,8 @@ void Option::setArgStr(StringRef S) { GlobalParser->updateArgStr(this, S); assert((S.empty() || S[0] != '-') && "Option can't start with '-"); ArgStr = S; + if (ArgStr.size() == 1) + setMiscFlag(Grouping); } void Option::reset() { |