Home | History | Annotate | Download | only in driver

Lines Matching full:opts

146 bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
176 Opts.Triple = llvm::Triple::normalize(Args->getLastArgValue(OPT_triple));
177 Opts.CPU = Args->getLastArgValue(OPT_target_cpu);
178 Opts.Features = Args->getAllArgValues(OPT_target_feature);
181 if (Opts.Triple.empty())
182 Opts.Triple = llvm::sys::getDefaultTargetTriple();
185 Opts.IncludePaths = Args->getAllArgValues(OPT_I);
186 Opts.NoInitialTextSection = Args->hasArg(OPT_n);
187 Opts.SaveTemporaryLabels = Args->hasArg(OPT_L);
188 Opts.GenDwarfForAssembly = Args->hasArg(OPT_g);
189 Opts.DwarfDebugFlags = Args->getLastArgValue(OPT_dwarf_debug_flags);
190 Opts.DwarfDebugProducer = Args->getLastArgValue(OPT_dwarf_debug_producer);
191 Opts.DebugCompilationDir = Args->getLastArgValue(OPT_fdebug_compilation_dir);
192 Opts.MainFileName = Args->getLastArgValue(OPT_main_file_name);
201 Opts.InputFile = A->getValue();
208 Opts.LLVMArgs = Args->getAllArgValues(OPT_mllvm);
209 Opts.OutputPath = Args->getLastArgValue(OPT_o);
222 Opts.OutputType = FileType(OutputType);
224 Opts.ShowHelp = Args->hasArg(OPT_help);
225 Opts.ShowVersion = Args->hasArg(OPT_version);
228 Opts.OutputAsmVariant =
230 Opts.ShowEncoding = Args->hasArg(OPT_show_encoding);
231 Opts.ShowInst = Args->hasArg(OPT_show_inst);
234 Opts.RelaxAll = Args->hasArg(OPT_mrelax_all);
235 Opts.NoExecStack = Args->hasArg(OPT_mno_exec_stack);
240 static formatted_raw_ostream *GetOutputStream(AssemblerInvocation &Opts,
243 if (Opts.OutputPath.empty())
244 Opts.OutputPath = "-";
248 if (Opts.OutputPath != "-")
249 sys::RemoveFileOnSignal(Opts.OutputPath);
253 new raw_fd_ostream(Opts.OutputPath.c_str(), Error,
257 << Opts.OutputPath << Error;
264 static bool ExecuteAssembler(AssemblerInvocation &Opts,
268 const Target *TheTarget(TargetRegistry::lookupTarget(Opts.Triple, Error));
270 Diags.Report(diag::err_target_unknown_triple) << Opts.Triple;
275 if (error_code ec = MemoryBuffer::getFileOrSTDIN(Opts.InputFile, BufferPtr)) {
277 Diags.Report(diag::err_fe_error_reading) << Opts.InputFile;
289 SrcMgr.setIncludeDirs(Opts.IncludePaths);
291 OwningPtr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(Opts.Triple));
294 OwningPtr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, Opts.Triple));
297 bool IsBinary = Opts.OutputType == AssemblerInvocation::FT_Obj;
298 formatted_raw_ostream *Out = GetOutputStream(Opts, Diags, IsBinary);
307 MOFI->InitMCObjectFileInfo(Opts.Triple,
309 if (Opts.SaveTemporaryLabels)
311 if (Opts.GenDwarfForAssembly)
313 if (!Opts.DwarfDebugFlags.empty())
314 Ctx.setDwarfDebugFlags(StringRef(Opts.DwarfDebugFlags));
315 if (!Opts.DwarfDebugProducer.empty())
316 Ctx.setDwarfDebugProducer(StringRef(Opts.DwarfDebugProducer));
317 if (!Opts.DebugCompilationDir.empty())
318 Ctx.setCompilationDir(Opts.DebugCompilationDir);
319 if (!Opts.MainFileName.empty())
320 Ctx.setMainFileName(StringRef(Opts.MainFileName));
324 if (!Opts.Features.empty()) {
325 FS = Opts.Features[0];
326 for (unsigned i = 1, e = Opts.Features.size(); i != e; ++i)
327 FS += "," + Opts.Features[i];
334 STI(TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS));
337 if (Opts.OutputType == AssemblerInvocation::FT_Asm) {
339 TheTarget->createMCInstPrinter(Opts.OutputAsmVariant, *MAI, *MCII, *MRI,
343 if (Opts.ShowEncoding) {
345 MAB = TheTarget->createMCAsmBackend(Opts.Triple, Opts.CPU);
352 Opts.ShowInst));
353 } else if (Opts.OutputType == AssemblerInvocation::FT_Null) {
356 assert(Opts.OutputType == AssemblerInvocation::FT_Obj &&
359 MCAsmBackend *MAB = TheTarget->createMCAsmBackend(Opts.Triple, Opts.CPU);
360 Str.reset(TheTarget->createMCObjectStreamer(Opts.Triple, Ctx, *MAB, *Out,
361 CE, Opts.RelaxAll,
362 Opts.NoExecStack));
370 Diags.Report(diag::err_target_unknown_triple) << Opts.Triple;
376 bool Success = !Parser->Run(Opts.NoInitialTextSection);
382 if (!Success && Opts.OutputPath != "-")
383 sys::fs::remove(Opts.OutputPath);
430 OwningPtr<OptTable> Opts(driver::createCC1AsOptTable());
431 Opts->PrintHelp(llvm::outs(), "clang -cc1as", "Clang Integrated Assembler");