smallvectorize getExtraOptionNames

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-09-20 06:21:43 +00:00
parent f00a7d91c0
commit 1908aea3a6
2 changed files with 7 additions and 8 deletions

View File

@ -230,7 +230,7 @@ public:
//
virtual void printOptionInfo(size_t GlobalWidth) const = 0;
virtual void getExtraOptionNames(std::vector<const char*> &) {}
virtual void getExtraOptionNames(SmallVectorImpl<const char*> &) {}
// addOccurrence - Wrapper around handleOccurrence that enforces Flags.
//
@ -397,7 +397,7 @@ struct generic_parser_base {
hasArgStr = O.hasArgStr();
}
void getExtraOptionNames(std::vector<const char*> &OptionNames) {
void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) {
// If there has been no argstr specified, that means that we need to add an
// argument for every possible option. This ensures that our options are
// vectored to us.
@ -502,7 +502,7 @@ struct basic_parser_impl { // non-template implementation of basic_parser<t>
return ValueRequired;
}
void getExtraOptionNames(std::vector<const char*> &) {}
void getExtraOptionNames(SmallVectorImpl<const char*> &) {}
void initialize(Option &) {}
@ -841,7 +841,7 @@ class opt : public Option,
virtual enum ValueExpected getValueExpectedFlagDefault() const {
return Parser.getValueExpectedFlagDefault();
}
virtual void getExtraOptionNames(std::vector<const char*> &OptionNames) {
virtual void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) {
return Parser.getExtraOptionNames(OptionNames);
}
@ -996,7 +996,7 @@ class list : public Option, public list_storage<DataType, Storage> {
virtual enum ValueExpected getValueExpectedFlagDefault() const {
return Parser.getValueExpectedFlagDefault();
}
virtual void getExtraOptionNames(std::vector<const char*> &OptionNames) {
virtual void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) {
return Parser.getExtraOptionNames(OptionNames);
}
@ -1195,7 +1195,7 @@ class bits : public Option, public bits_storage<DataType, Storage> {
virtual enum ValueExpected getValueExpectedFlagDefault() const {
return Parser.getValueExpectedFlagDefault();
}
virtual void getExtraOptionNames(std::vector<const char*> &OptionNames) {
virtual void getExtraOptionNames(SmallVectorImpl<const char*> &OptionNames) {
return Parser.getExtraOptionNames(OptionNames);
}

View File

@ -108,8 +108,7 @@ void Option::addArgument() {
static void GetOptionInfo(SmallVectorImpl<Option*> &PositionalOpts,
SmallVectorImpl<Option*> &SinkOpts,
StringMap<Option*> &OptionsMap) {
// FIXME: SmallVectorize.
std::vector<const char*> OptionNames;
SmallVector<const char*, 16> OptionNames;
Option *CAOpt = 0; // The ConsumeAfter option if it exists.
for (Option *O = RegisteredOptionList; O; O = O->getNextRegisteredOption()) {
// If this option wants to handle multiple option names, get the full set.