Lines Matching refs:Opts
159 bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts, in CreateFromArgs() argument
188 Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple)); in CreateFromArgs()
189 Opts.CPU = Args.getLastArgValue(OPT_target_cpu); in CreateFromArgs()
190 Opts.Features = Args.getAllArgValues(OPT_target_feature); in CreateFromArgs()
193 if (Opts.Triple.empty()) in CreateFromArgs()
194 Opts.Triple = llvm::sys::getDefaultTargetTriple(); in CreateFromArgs()
197 Opts.IncludePaths = Args.getAllArgValues(OPT_I); in CreateFromArgs()
198 Opts.NoInitialTextSection = Args.hasArg(OPT_n); in CreateFromArgs()
199 Opts.SaveTemporaryLabels = Args.hasArg(OPT_msave_temp_labels); in CreateFromArgs()
201 Opts.GenDwarfForAssembly = Args.hasArg(OPT_debug_info_kind_EQ); in CreateFromArgs()
202 Opts.CompressDebugSections = Args.hasArg(OPT_compress_debug_sections); in CreateFromArgs()
203 Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags); in CreateFromArgs()
204 Opts.DwarfDebugFlags = Args.getLastArgValue(OPT_dwarf_debug_flags); in CreateFromArgs()
205 Opts.DwarfDebugProducer = Args.getLastArgValue(OPT_dwarf_debug_producer); in CreateFromArgs()
206 Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir); in CreateFromArgs()
207 Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name); in CreateFromArgs()
217 Opts.InputFile = A->getValue(); in CreateFromArgs()
224 Opts.LLVMArgs = Args.getAllArgValues(OPT_mllvm); in CreateFromArgs()
225 Opts.OutputPath = Args.getLastArgValue(OPT_o); in CreateFromArgs()
237 Opts.OutputType = FileType(OutputType); in CreateFromArgs()
239 Opts.ShowHelp = Args.hasArg(OPT_help); in CreateFromArgs()
240 Opts.ShowVersion = Args.hasArg(OPT_version); in CreateFromArgs()
243 Opts.OutputAsmVariant = in CreateFromArgs()
245 Opts.ShowEncoding = Args.hasArg(OPT_show_encoding); in CreateFromArgs()
246 Opts.ShowInst = Args.hasArg(OPT_show_inst); in CreateFromArgs()
249 Opts.RelaxAll = Args.hasArg(OPT_mrelax_all); in CreateFromArgs()
250 Opts.NoExecStack = Args.hasArg(OPT_mno_exec_stack); in CreateFromArgs()
251 Opts.FatalWarnings = Args.hasArg(OPT_massembler_fatal_warnings); in CreateFromArgs()
252 Opts.RelocationModel = Args.getLastArgValue(OPT_mrelocation_model, "pic"); in CreateFromArgs()
253 Opts.IncrementalLinkerCompatible = in CreateFromArgs()
260 getOutputStream(AssemblerInvocation &Opts, DiagnosticsEngine &Diags, in getOutputStream() argument
262 if (Opts.OutputPath.empty()) in getOutputStream()
263 Opts.OutputPath = "-"; in getOutputStream()
267 if (Opts.OutputPath != "-") in getOutputStream()
268 sys::RemoveFileOnSignal(Opts.OutputPath); in getOutputStream()
272 Opts.OutputPath, EC, (Binary ? sys::fs::F_None : sys::fs::F_Text)); in getOutputStream()
274 Diags.Report(diag::err_fe_unable_to_open_output) << Opts.OutputPath in getOutputStream()
282 static bool ExecuteAssembler(AssemblerInvocation &Opts, in ExecuteAssembler() argument
286 const Target *TheTarget = TargetRegistry::lookupTarget(Opts.Triple, Error); in ExecuteAssembler()
288 return Diags.Report(diag::err_target_unknown_triple) << Opts.Triple; in ExecuteAssembler()
291 MemoryBuffer::getFileOrSTDIN(Opts.InputFile); in ExecuteAssembler()
295 return Diags.Report(diag::err_fe_error_reading) << Opts.InputFile; in ExecuteAssembler()
305 SrcMgr.setIncludeDirs(Opts.IncludePaths); in ExecuteAssembler()
307 std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(Opts.Triple)); in ExecuteAssembler()
310 std::unique_ptr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, Opts.Triple)); in ExecuteAssembler()
315 if (Opts.CompressDebugSections) in ExecuteAssembler()
318 bool IsBinary = Opts.OutputType == AssemblerInvocation::FT_Obj; in ExecuteAssembler()
319 std::unique_ptr<raw_fd_ostream> FDOS = getOutputStream(Opts, Diags, IsBinary); in ExecuteAssembler()
330 if (Opts.RelocationModel == "static") { in ExecuteAssembler()
332 } else if (Opts.RelocationModel == "pic") { in ExecuteAssembler()
335 assert(Opts.RelocationModel == "dynamic-no-pic" && in ExecuteAssembler()
340 MOFI->InitMCObjectFileInfo(Triple(Opts.Triple), RM, in ExecuteAssembler()
342 if (Opts.SaveTemporaryLabels) in ExecuteAssembler()
344 if (Opts.GenDwarfForAssembly) in ExecuteAssembler()
346 if (!Opts.DwarfDebugFlags.empty()) in ExecuteAssembler()
347 Ctx.setDwarfDebugFlags(StringRef(Opts.DwarfDebugFlags)); in ExecuteAssembler()
348 if (!Opts.DwarfDebugProducer.empty()) in ExecuteAssembler()
349 Ctx.setDwarfDebugProducer(StringRef(Opts.DwarfDebugProducer)); in ExecuteAssembler()
350 if (!Opts.DebugCompilationDir.empty()) in ExecuteAssembler()
351 Ctx.setCompilationDir(Opts.DebugCompilationDir); in ExecuteAssembler()
352 if (!Opts.MainFileName.empty()) in ExecuteAssembler()
353 Ctx.setMainFileName(StringRef(Opts.MainFileName)); in ExecuteAssembler()
354 Ctx.setDwarfVersion(Opts.DwarfVersion); in ExecuteAssembler()
358 if (!Opts.Features.empty()) { in ExecuteAssembler()
359 FS = Opts.Features[0]; in ExecuteAssembler()
360 for (unsigned i = 1, e = Opts.Features.size(); i != e; ++i) in ExecuteAssembler()
361 FS += "," + Opts.Features[i]; in ExecuteAssembler()
368 TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS)); in ExecuteAssembler()
374 if (Opts.OutputType == AssemblerInvocation::FT_Asm) { in ExecuteAssembler()
376 llvm::Triple(Opts.Triple), Opts.OutputAsmVariant, *MAI, *MCII, *MRI); in ExecuteAssembler()
379 if (Opts.ShowEncoding) { in ExecuteAssembler()
381 MAB = TheTarget->createMCAsmBackend(*MRI, Opts.Triple, Opts.CPU); in ExecuteAssembler()
386 /*useDwarfDirectory*/ true, IP, CE, MAB, Opts.ShowInst)); in ExecuteAssembler()
387 } else if (Opts.OutputType == AssemblerInvocation::FT_Null) { in ExecuteAssembler()
390 assert(Opts.OutputType == AssemblerInvocation::FT_Obj && in ExecuteAssembler()
398 MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*MRI, Opts.Triple, in ExecuteAssembler()
399 Opts.CPU); in ExecuteAssembler()
400 Triple T(Opts.Triple); in ExecuteAssembler()
402 T, Ctx, *MAB, *Out, CE, *STI, Opts.RelaxAll, in ExecuteAssembler()
403 Opts.IncrementalLinkerCompatible, in ExecuteAssembler()
405 Str.get()->InitSections(Opts.NoExecStack); in ExecuteAssembler()
418 Failed = Diags.Report(diag::err_target_unknown_triple) << Opts.Triple; in ExecuteAssembler()
422 Failed = Parser->Run(Opts.NoInitialTextSection); in ExecuteAssembler()
433 if (Failed && Opts.OutputPath != "-") in ExecuteAssembler()
434 sys::fs::remove(Opts.OutputPath); in ExecuteAssembler()
479 std::unique_ptr<OptTable> Opts(driver::createDriverOptTable()); in cc1as_main() local
480 Opts->PrintHelp(llvm::outs(), "clang -cc1as", "Clang Integrated Assembler", in cc1as_main()