mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 15:51:54 +00:00
[Option] Introduce Arg::print(raw_ostream&) and use llvm::dbgs
llvm-svn: 255977
This commit is contained in:
parent
359dea2a6b
commit
5d48dc63b5
@ -18,6 +18,7 @@
|
|||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/ADT/StringRef.h"
|
#include "llvm/ADT/StringRef.h"
|
||||||
#include "llvm/Option/Option.h"
|
#include "llvm/Option/Option.h"
|
||||||
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
@ -113,6 +114,8 @@ public:
|
|||||||
/// when rendered as a input (e.g., Xlinker).
|
/// when rendered as a input (e.g., Xlinker).
|
||||||
void renderAsInput(const ArgList &Args, ArgStringList &Output) const;
|
void renderAsInput(const ArgList &Args, ArgStringList &Output) const;
|
||||||
|
|
||||||
|
void print(raw_ostream &OS) const;
|
||||||
|
|
||||||
void dump() const;
|
void dump() const;
|
||||||
|
|
||||||
/// \brief Return a formatted version of the argument and
|
/// \brief Return a formatted version of the argument and
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "llvm/ADT/Twine.h"
|
#include "llvm/ADT/Twine.h"
|
||||||
#include "llvm/Option/ArgList.h"
|
#include "llvm/Option/ArgList.h"
|
||||||
#include "llvm/Option/Option.h"
|
#include "llvm/Option/Option.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/Debug.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace llvm::opt;
|
using namespace llvm::opt;
|
||||||
@ -43,21 +43,24 @@ Arg::~Arg() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arg::dump() const {
|
void Arg::print(raw_ostream &OS) const {
|
||||||
llvm::errs() << "<";
|
OS << "<";
|
||||||
|
|
||||||
llvm::errs() << " Opt:";
|
OS << " Opt:";
|
||||||
Opt.dump();
|
Opt.dump();
|
||||||
|
|
||||||
llvm::errs() << " Index:" << Index;
|
OS << " Index:" << Index;
|
||||||
|
|
||||||
llvm::errs() << " Values: [";
|
OS << " Values: [";
|
||||||
for (unsigned i = 0, e = Values.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Values.size(); i != e; ++i) {
|
||||||
if (i) llvm::errs() << ", ";
|
OS << "'" << Values[i] << "'";
|
||||||
llvm::errs() << "'" << Values[i] << "'";
|
if (i != e - 1) llvm::errs() << ", ";
|
||||||
}
|
}
|
||||||
|
OS << "]>\n";
|
||||||
|
}
|
||||||
|
|
||||||
llvm::errs() << "]>\n";
|
void Arg::dump() const {
|
||||||
|
print(llvm::dbgs());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Arg::getAsString(const ArgList &Args) const {
|
std::string Arg::getAsString(const ArgList &Args) const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user