#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/YAMLParser.h"
#include "llvm/Support/raw_ostream.h"
#include <system_error>
usingnamespacellvm;
static cl::opt<bool>
DumpTokens( "tokens"
, cl::desc("Print the tokenization of the file.")
, cl::init(false)
);
static cl::opt<bool>
DumpCanonical( "canonical"
, cl::desc("Print the canonical YAML for this file.")
, cl::init(false)
);
static cl::opt<std::string>
Input(cl::Positional, cl::desc("<input>"));
static cl::opt<bool>
Verify( "verify"
, cl::desc(
"Run a quick verification useful for regression testing")
, cl::init(false)
);
static cl::opt<unsigned>
MemoryLimitMB("memory-limit", cl::desc(
"Do not use more megabytes of memory"),
cl::init(1000));
cl::opt<cl::boolOrDefault>
UseColor("use-color", cl::desc("Emit colored output (default=autodetect)"),
cl::init(cl::BOU_UNSET));
struct indent { … };
static raw_ostream &operator <<(raw_ostream &os, const indent &in) { … }
static std::string prettyTag(yaml::Node *N) { … }
static void dumpNode( yaml::Node *n
, unsigned Indent = 0
, bool SuppressFirstIndent = false) { … }
static void dumpStream(yaml::Stream &stream) { … }
static void benchmark(llvm::TimerGroup &Group, llvm::StringRef Name,
llvm::StringRef Description, llvm::StringRef JSONText) { … }
static std::string createJSONText(size_t MemoryMB, unsigned ValueSize) { … }
int main(int argc, char **argv) { … }