summaryrefslogtreecommitdiffstats
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
commitced6a2be0438b1a77bf46e57f41bf683f8bf1315 (patch)
tree36e2fb0400c240756c54ffae3310f8bc726c8811
parent17a1bfa9d84d0298207f8d7631085534316d7c43 (diff)
downloadbcm5719-llvm-ced6a2be0438b1a77bf46e57f41bf683f8bf1315.tar.gz
bcm5719-llvm-ced6a2be0438b1a77bf46e57f41bf683f8bf1315.zip
Allow invertable -xno- style optins as well.
llvm-svn: 67862
-rw-r--r--llvm/include/llvm/Support/CommandLine.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h
index 1c6b3337dfd..52052e44654 100644
--- a/llvm/include/llvm/Support/CommandLine.h
+++ b/llvm/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);
}
}
OpenPOWER on IntegriCloud