diff options
Diffstat (limited to 'lib/Option')
-rw-r--r-- | lib/Option/Arg.cpp | 12 | ||||
-rw-r--r-- | lib/Option/ArgList.cpp | 6 | ||||
-rw-r--r-- | lib/Option/CMakeLists.txt | 3 |
3 files changed, 10 insertions, 11 deletions
diff --git a/lib/Option/Arg.cpp b/lib/Option/Arg.cpp index 4c8da58..af632d6 100644 --- a/lib/Option/Arg.cpp +++ b/lib/Option/Arg.cpp @@ -83,15 +83,13 @@ void Arg::renderAsInput(const ArgList &Args, ArgStringList &Output) const { return; } - for (unsigned i = 0, e = getNumValues(); i != e; ++i) - Output.push_back(getValue(i)); + Output.append(Values.begin(), Values.end()); } void Arg::render(const ArgList &Args, ArgStringList &Output) const { switch (getOption().getRenderStyle()) { case Option::RenderValuesStyle: - for (unsigned i = 0, e = getNumValues(); i != e; ++i) - Output.push_back(getValue(i)); + Output.append(Values.begin(), Values.end()); break; case Option::RenderCommaJoinedStyle: { @@ -109,14 +107,12 @@ void Arg::render(const ArgList &Args, ArgStringList &Output) const { case Option::RenderJoinedStyle: Output.push_back(Args.GetOrMakeJoinedArgString( getIndex(), getSpelling(), getValue(0))); - for (unsigned i = 1, e = getNumValues(); i != e; ++i) - Output.push_back(getValue(i)); + Output.append(Values.begin() + 1, Values.end()); break; case Option::RenderSeparateStyle: Output.push_back(Args.MakeArgString(getSpelling())); - for (unsigned i = 0, e = getNumValues(); i != e; ++i) - Output.push_back(getValue(i)); + Output.append(Values.begin(), Values.end()); break; } } diff --git a/lib/Option/ArgList.cpp b/lib/Option/ArgList.cpp index 041e552..85e956f 100644 --- a/lib/Option/ArgList.cpp +++ b/lib/Option/ArgList.cpp @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// #include "llvm/Option/ArgList.h" -#include "llvm/ADT/SmallString.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" #include "llvm/Option/Arg.h" #include "llvm/Option/Option.h" @@ -253,8 +253,8 @@ void ArgList::AddAllArgValues(ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const { for (auto Arg : filtered(Id0, Id1, Id2)) { Arg->claim(); - for (unsigned i = 0, e = Arg->getNumValues(); i != e; ++i) - Output.push_back(Arg->getValue(i)); + const auto &Values = Arg->getValues(); + Output.append(Values.begin(), Values.end()); } } diff --git a/lib/Option/CMakeLists.txt b/lib/Option/CMakeLists.txt index 1cd7d3a..8eb0860 100644 --- a/lib/Option/CMakeLists.txt +++ b/lib/Option/CMakeLists.txt @@ -3,4 +3,7 @@ add_llvm_library(LLVMOption ArgList.cpp Option.cpp OptTable.cpp + + ADDITIONAL_HEADER_DIRS + ${LLVM_MAIN_INCLUDE_DIR}/llvm/Option ) |