diff options
Diffstat (limited to 'lib/Driver/Arg.cpp')
-rw-r--r-- | lib/Driver/Arg.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Driver/Arg.cpp b/lib/Driver/Arg.cpp index eba39dd4f4..c43c9fbe4b 100644 --- a/lib/Driver/Arg.cpp +++ b/lib/Driver/Arg.cpp @@ -50,6 +50,22 @@ void Arg::dump() const { llvm::errs() << ">\n"; } +std::string Arg::getAsString(const ArgList &Args) const { + std::string Res; + llvm::raw_string_ostream OS(Res); + + ArgStringList ASL; + render(Args, ASL); + for (ArgStringList::iterator + it = ASL.begin(), ie = ASL.end(); it != ie; ++it) { + if (it != ASL.begin()) + OS << ' '; + OS << *it; + } + + return OS.str(); +} + void Arg::renderAsInput(const ArgList &Args, ArgStringList &Output) const { if (!getOption().hasNoOptAsInput()) { render(Args, Output); |