Lines Matching refs:llvm

22 #include <llvm/ADT/STLExtras.h>
23 #include <llvm/ADT/SmallString.h>
24 #include <llvm/Config/config.h>
25 #include <llvm/Support/CommandLine.h>
26 #include <llvm/Support/FileSystem.h>
27 #include <llvm/Support/Path.h>
28 #include <llvm/Support/raw_ostream.h>
44 llvm::cl::list<std::string>
45 OptInputFilenames(llvm::cl::Positional, llvm::cl::OneOrMore,
46 llvm::cl::desc("<input bitcode files>"));
48 llvm::cl::opt<std::string>
49 OptOutputFilename("o", llvm::cl::desc("Specify the output filename"),
50 llvm::cl::value_desc("filename"));
52 llvm::cl::opt<std::string>
53 OptRuntimePath("rt-path", llvm::cl::desc("Specify the runtime library path"),
54 llvm::cl::value_desc("path"));
56 llvm::cl::opt<std::string>
58 llvm::cl::desc("Specify the target triple (default: "
60 llvm::cl::init(DEFAULT_TARGET_TRIPLE_STRING),
61 llvm::cl::value_desc("triple"));
63 llvm::cl::alias OptTargetTripleC("C", llvm::cl::NotHidden,
64 llvm::cl::desc("Alias for -mtriple"),
65 llvm::cl::aliasopt(OptTargetTriple));
70 llvm::cl::opt<bool>
71 OptPIC("fPIC", llvm::cl::desc("Generate fully relocatable, position independent"
74 llvm::cl::opt<char>
75 OptOptLevel("O", llvm::cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
77 llvm::cl::Prefix, llvm::cl::ZeroOrMore, llvm::cl::init('2'));
79 llvm::cl::opt<bool>
80 OptC("c", llvm::cl::desc("Compile and assemble, but do not link."));
88 llvm::cl::opt<std::string>
89 OptImmObjectOutput("or", llvm::cl::desc("Specify the filename for output the "
92 "library"), llvm::cl::ValueRequired);
94 llvm::cl::opt<bool>
95 OptShared("shared", llvm::cl::desc("Create a shared library from input bitcode "
102 llvm::raw_ostream &os = llvm::outs();
105 << "LLVM (http://llvm.org/):\n"
113 const llvm::cl::list<std::string> &pBitcodeFiles) {
120 llvm::errs() << "Failed to load llvm module from file `" << input_bitcode
127 llvm::errs() << "Failed to merge the llvm module `" << input_bitcode
135 llvm::errs() << "Out of memory when create script for file `"
153 llvm::errs() << "Out of memory when create the compiler configuration!\n";
182 config->setRelocationModel(llvm::Reloc::PIC_);
186 config->setCodeModel(llvm::CodeModel::Small);
190 case '0': config->setOptimizationLevel(llvm::CodeGenOpt::None); break;
191 case '1': config->setOptimizationLevel(llvm::CodeGenOpt::Less); break;
192 case '3': config->setOptimizationLevel(llvm::CodeGenOpt::Aggressive); break;
195 config->setOptimizationLevel(llvm::CodeGenOpt::Default);
204 llvm::errs() << "Failed to configure the compiler! (detail: "
221 llvm::errs() << "Use " DEFAULT_OUTPUT_PATH " for output file!\n";
227 llvm::SmallString<200> output_path(input_path);
229 std::error_code err = llvm::sys::fs::make_absolute(output_path);
231 llvm::errs() << "Failed to determine the absolute path of `" << input_path
238 llvm::sys::path::replace_extension(output_path, "o");
242 llvm::sys::path::remove_filename(output_path);
243 llvm::sys::path::append(output_path, "a.out");
250 llvm::cl::SetVersionPrinter(BCCVersionPrinter);
251 llvm::cl::ParseCommandLineOptions(argc, argv);