Remove AllowInverse: it leaks memory and is not the right

abstraction for CommandLine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-04-08 03:43:51 +00:00
parent 4da69c77cf
commit 00a7b52385
3 changed files with 2 additions and 42 deletions

View File

@@ -127,8 +127,7 @@ enum MiscFlags { // Miscellaneous flags to adjust argument
CommaSeparated = 0x200, // Should this cl::list split between commas?
PositionalEatsArgs = 0x400, // Should this positional cl::list eat -args?
Sink = 0x800, // Should this cl::list eat all unknown options?
AllowInverse = 0x1000, // Can this option take a -Xno- form?
MiscMask = 0x1E00 // Union of the above flags.
MiscMask = 0xE00 // Union of the above flags.
};
@@ -538,17 +537,14 @@ struct basic_parser : public basic_parser_impl {
//
template<>
class parser<bool> : public basic_parser<bool> {
bool IsInvertible; // Should we synthesize a -xno- style option?
const char *ArgStr;
public:
void getExtraOptionNames(std::vector<const char*> &OptionNames);
// parse - Return true on error.
bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
template <class Opt>
void initialize(Opt &O) {
IsInvertible = (O.getMiscFlags() & llvm::cl::AllowInverse);
ArgStr = O.ArgStr;
}