Lines Matching refs:llvm

20 #include <llvm/ADT/SmallString.h>
21 #include <llvm/Support/CommandLine.h>
22 #include <llvm/Support/FileSystem.h>
23 #include <llvm/Support/Path.h>
24 #include <llvm/Support/raw_ostream.h>
25 #include <llvm/Support/system_error.h>
43 static llvm::cl::opt<std::string>
45 llvm::cl::desc("Specify the target triple (default: "
47 llvm::cl::init(DEFAULT_TARGET_TRIPLE_STRING),
48 llvm::cl::value_desc("triple"));
50 static llvm::cl::alias OptTargetTripleC("C", llvm::cl::NotHidden,
51 llvm::cl::desc("Alias for -mtriple"),
52 llvm::cl::aliasopt(OptTargetTriple));
65 static llvm::cl::opt<std::string>
67 llvm::cl::desc("Output filename"),
68 llvm::cl::value_desc("filename"));
70 static llvm::cl::opt<std::string>
71 OptSysRoot("sysroot", llvm::cl::desc("Use directory as the location of the "
74 llvm::cl::value_desc("directory"),
75 llvm::cl::ValueRequired);
77 static llvm::cl::list<std::string>
79 llvm::cl::ZeroOrMore,
80 llvm::cl::desc("Add path searchdir to the list of paths that "
83 llvm::cl::value_desc("searchdir"),
84 llvm::cl::Prefix);
86 static llvm::cl::opt<std::string>
88 llvm::cl::desc("Set internal name of shared library"),
89 llvm::cl::value_desc("name"));
92 static llvm::cl::opt<bool>
94 llvm::cl::desc("Create a shared library."),
95 llvm::cl::init(false));
97 static llvm::cl::opt<bool>
99 llvm::cl::desc("Bind references within the shared library."),
100 llvm::cl::init(true));
102 static llvm::cl::opt<std::string>
104 llvm::cl::desc("Set the name of the dynamic linker."),
105 llvm::cl::value_desc("Program"));
107 static llvm::cl::opt<bool>
109 llvm::cl::desc("Generate relocatable output"),
110 llvm::cl::init(false));
112 static llvm::cl::alias
114 llvm::cl::desc("alias for --relocatable"),
115 llvm::cl::aliasopt(OptRelocatable));
117 static llvm::cl::opt<bool>
119 llvm::cl::ZeroOrMore,
120 llvm::cl::desc("Define common symbol"),
121 llvm::cl::init(false));
123 static llvm::cl::alias
125 llvm::cl::desc("alias for -d"),
126 llvm::cl::aliasopt(OptDefineCommon));
128 static llvm::cl::alias
130 llvm::cl::desc("alias for -d"),
131 llvm::cl::aliasopt(OptDefineCommon));
137 static llvm::cl::list<std::string>
138 OptInputObjectFiles(llvm::cl::Positional,
139 llvm::cl::desc("[input object files]"),
140 llvm::cl::OneOrMore);
142 static llvm::cl::list<std::string>
144 llvm::cl::ZeroOrMore,
145 llvm::cl::desc("Add the archive or object file specified by "
147 llvm::cl::value_desc("namespec"),
148 llvm::cl::Prefix);
153 static llvm::cl::list<std::string>
155 llvm::cl::ZeroOrMore,
156 llvm::cl::desc("Use a wrap function fo symbol."),
157 llvm::cl::value_desc("symbol"));
159 static llvm::cl::list<std::string>
161 llvm::cl::ZeroOrMore,
162 llvm::cl::desc("Use a portable function to symbol."),
163 llvm::cl::value_desc("symbol"));
170 llvm::raw_ostream &os = llvm::outs();
177 os << "LLVM (http://llvm.org/):\n";
191 llvm::errs() << "Use " DEFAULT_OUTPUT_PATH " for output file!\n";
197 llvm::SmallString<200> output_path(input_path);
199 llvm::error_code err = llvm::sys::fs::make_absolute(output_path);
200 if (llvm::errc::success != err) {
201 llvm::errs() << "Failed to determine the absolute path of `" << input_path
206 llvm::sys::path::remove_filename(output_path);
207 llvm::sys::path::append(output_path, "a.out");
222 llvm::errs() << "Out of memory when create the linker configuration!\n";
246 llvm::cl::list<std::string>::iterator wrap, wrap_end = OptWrapList.end();
252 llvm::cl::list<std::string>::iterator portable, portable_end = OptPortableList.end();
258 llvm::cl::list<std::string>::iterator sdir, sdir_end = OptSearchDirList.end();
278 llvm::errs() << "Failed to configure the linker! (detail: "
295 llvm::errs() << "Failed to open the output file! (detail: "
302 llvm::cl::list<std::string>::iterator file_it = OptInputObjectFiles.begin();
303 llvm::cl::list<std::string>::iterator lib_it = OptNameSpecList.begin();
305 llvm::cl::list<std::string>::iterator file_begin = OptInputObjectFiles.begin();
306 llvm::cl::list<std::string>::iterator lib_begin = OptNameSpecList.begin();
307 llvm::cl::list<std::string>::iterator file_end = OptInputObjectFiles.end();
308 llvm::cl::list<std::string>::iterator lib_end = OptNameSpecList.end();
327 llvm::errs() << "Failed to open the input file! (detail: " << *file_it
335 llvm::errs() << "Failed to open the namespec! (detail: " << *lib_it
351 llvm::errs() << "Failed to linking! (detail: "
359 llvm::cl::SetVersionPrinter(MCLDVersionPrinter);
360 llvm::cl::ParseCommandLineOptions(argc, argv);