[llvm-commits] [llvm] r67862 - /llvm/trunk/include/llvm/Support/CommandLine.h
Mike Stump
mrs at apple.com
Fri Mar 27 13:12:55 PDT 2009
Author: mrs
Date: Fri Mar 27 15:12:55 2009
New Revision: 67862
URL: http://llvm.org/viewvc/llvm-project?rev=67862&view=rev
Log:
Allow invertable -xno- style optins as well.
Modified:
llvm/trunk/include/llvm/Support/CommandLine.h
Modified: llvm/trunk/include/llvm/Support/CommandLine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=67862&r1=67861&r2=67862&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/CommandLine.h (original)
+++ llvm/trunk/include/llvm/Support/CommandLine.h Fri Mar 27 15:12:55 2009
@@ -544,10 +544,14 @@
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);
}
}
More information about the llvm-commits
mailing list