Home | History | Annotate | Download | only in bcc

Lines Matching full:llvm

23 #include <llvm/ADT/STLExtras.h>
24 #include <llvm/ADT/SmallString.h>
25 #include <llvm/Config/config.h>
26 #include <llvm/Support/CommandLine.h>
27 #include <llvm/Support/FileSystem.h>
28 #include <llvm/Support/MemoryBuffer.h>
29 #include <llvm/Support/PluginLoader.h>
30 #include <llvm/Support/raw_ostream.h>
57 llvm::cl::opt<std::string>
58 OptInputFilename(llvm::cl::Positional, llvm::cl::ValueRequired,
59 llvm::cl::desc("<input bitcode file>"));
61 llvm::cl::opt<std::string>
62 OptOutputFilename("o", llvm::cl::desc("Specify the output filename"),
63 llvm::cl::value_desc("filename"),
64 llvm::cl::init("bcc_output"));
66 llvm::cl::opt<std::string>
67 OptBCLibFilename("bclib", llvm::cl::desc("Specify the bclib filename"),
68 llvm::cl::value_desc("bclib"));
70 llvm::cl::opt<std::string>
71 OptOutputPath("output_path", llvm::cl::desc("Specify the output path"),
72 llvm::cl::value_desc("output path"),
73 llvm::cl::init("."));
75 llvm::cl::opt<bool>
76 OptEmitLLVM("emit-llvm",
77 llvm::cl::desc("Emit an LLVM-IR version of the generated program"));
79 llvm::cl::opt<std::string>
81 llvm::cl::desc("Specify the target triple (default: "
83 llvm::cl::init(DEFAULT_TARGET_TRIPLE_STRING),
84 llvm::cl::value_desc("triple"));
86 llvm::cl::alias OptTargetTripleC("C", llvm::cl::NotHidden,
87 llvm::cl::desc("Alias for -mtriple"),
88 llvm::cl::aliasopt(OptTargetTriple));
90 llvm::cl::opt<bool>
92 llvm::cl::desc("Enable build to work with a RenderScript debug context"));
99 llvm::cl::opt<char>
100 OptOptLevel("O", llvm::cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
102 llvm::cl::Prefix, llvm::cl::ZeroOrMore, llvm::cl::init('3'));
104 // Override "bcc -version" since the LLVM version information is not correct on
107 llvm::raw_ostream &os = llvm::outs();
110 << "LLVM (http://llvm.org/):\n"
124 llvm::errs() << "Out of memory when create the compiler configuration!\n";
153 case '0': config->setOptimizationLevel(llvm::CodeGenOpt::None); break;
154 case '1': config->setOptimizationLevel(llvm::CodeGenOpt::Less); break;
155 case '2': config->setOptimizationLevel(llvm::CodeGenOpt::Default); break;
158 config->setOptimizationLevel(llvm::CodeGenOpt::Aggressive);
171 llvm::errs() << "Failed to configure the compiler! (detail: "
180 llvm::cl::SetVersionPrinter(BCCVersionPrinter);
181 llvm::cl::ParseCommandLineOptions(argc, argv);
193 llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> mb_or_error =
194 llvm::MemoryBuffer::getFile(OptInputFilename.c_str());
200 std::unique_ptr<llvm::MemoryBuffer> input_data = std::move(mb_or_error.get());