aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ArgList.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-26 01:07:52 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-26 01:07:52 +0000
commit4df9a664b7a0bfbd065253349cc5ead88b50b9a2 (patch)
tree886e16b381a5adac8ae4681c8d40691e25974bfe /lib/Driver/ArgList.cpp
parent0389e6bd0159bfdd08f7c50a37543b6e3adf0c33 (diff)
Add option for AddAllArgsTranslated to control whether output argument
should be joined or separate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70101 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ArgList.cpp')
-rw-r--r--lib/Driver/ArgList.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp
index 7823673024..593694cfbb 100644
--- a/lib/Driver/ArgList.cpp
+++ b/lib/Driver/ArgList.cpp
@@ -124,14 +124,22 @@ void ArgList::AddAllArgValues(ArgStringList &Output, options::ID Id0,
}
void ArgList::AddAllArgsTranslated(ArgStringList &Output, options::ID Id0,
- const char *Translation) const {
+ const char *Translation,
+ bool Joined) const {
// FIXME: Make fast.
for (const_iterator it = begin(), ie = end(); it != ie; ++it) {
const Arg *A = *it;
if (A->getOption().matches(Id0)) {
A->claim();
- Output.push_back(Translation);
- Output.push_back(A->getValue(*this, 0));
+
+ if (Joined) {
+ std::string Value = Translation;
+ Value += A->getValue(*this, 0);
+ Output.push_back(MakeArgString(Value.c_str()));
+ } else {
+ Output.push_back(Translation);
+ Output.push_back(A->getValue(*this, 0));
+ }
}
}
}