aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-20 06:21:43 +0000
committerChris Lattner <sabre@nondot.org>2009-09-20 06:21:43 +0000
commit1908aea3a64fa89a907317849cbff73789cdb89a (patch)
treef63494595a5cdd3ea4062dfca29258c8b4e9bea1
parentf00a7d91c04db14cb0fd180c57482fe121eccfad (diff)
downloadexternal_llvm-1908aea3a64fa89a907317849cbff73789cdb89a.zip
external_llvm-1908aea3a64fa89a907317849cbff73789cdb89a.tar.gz
external_llvm-1908aea3a64fa89a907317849cbff73789cdb89a.tar.bz2
smallvectorize getExtraOptionNames
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82377 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/CommandLine.h12
-rw-r--r--lib/Support/CommandLine.cpp3
2 files changed, 7 insertions, 8 deletions
diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h
index cccc696..4fcca1d 100644
--- a/include/llvm/Support/CommandLine.h
+++ b/include/llvm/Support/CommandLine.h
@@ -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);
}
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp
index 08c80c1..61b6cfe 100644
--- a/lib/Support/CommandLine.cpp
+++ b/lib/Support/CommandLine.cpp
@@ -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.