aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-03-27 20:12:55 +0000
committerMike Stump <mrs@apple.com>2009-03-27 20:12:55 +0000
commita1582f3e6f48e752b04075ce16bf052ba2ca169f (patch)
tree55c08ca57b204be649d859ed88f5786502c1e222 /include/llvm
parent465fac61a12feb29236581bb702cdb08c99431bf (diff)
downloadexternal_llvm-a1582f3e6f48e752b04075ce16bf052ba2ca169f.zip
external_llvm-a1582f3e6f48e752b04075ce16bf052ba2ca169f.tar.gz
external_llvm-a1582f3e6f48e752b04075ce16bf052ba2ca169f.tar.bz2
Allow invertable -xno- style optins as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Support/CommandLine.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h
index 1c6b333..52052e4 100644
--- a/include/llvm/Support/CommandLine.h
+++ b/include/llvm/Support/CommandLine.h
@@ -544,10 +544,14 @@ public:
if (IsInvertable) {
char *s = new char [strlen(ArgStr) + 3 + 1];
s[0] = ArgStr[0];
- s[1] = 'n';
- s[2] = 'o';
- s[3] = '-';
- strcpy(&s[4], ArgStr+1);
+ if (strncmp(ArgStr+1, "no-", 3) == 0)
+ strcpy(&s[1], &ArgStr[4]);
+ else {
+ s[1] = 'n';
+ s[2] = 'o';
+ s[3] = '-';
+ strcpy(&s[4], ArgStr+1);
+ }
OptionNames.push_back(s);
}
}