Lines Matching +full:diag +full:- +full:version
1 //===-- cc1as_main.cpp - Clang Assembler ---------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This is the entry point to the clang -cc1as functionality, which implements
12 //===----------------------------------------------------------------------===//
80 /// The list of target specific features to enable or disable -- this should
81 /// be a list of strings starting with '+' or '-'.
164 // Whether to emit compact-unwind for non-canonical entries.
175 /// The ABI targeted by the backend. Specified using -target-abi. Empty
183 /// The version of the darwin target variant SDK which was used during the
195 InputFile = "-"; in AssemblerInvocation()
196 OutputPath = "-"; in AssemblerInvocation()
238 Diags.Report(diag::err_drv_missing_argument) in CreateFromArgs()
245 auto ArgString = A->getAsString(Args); in CreateFromArgs()
248 Diags.Report(diag::err_drv_unknown_argument) << ArgString; in CreateFromArgs()
250 Diags.Report(diag::err_drv_unknown_argument_with_suggestion) in CreateFromArgs()
260 Opts.DarwinTargetVariantTriple = llvm::Triple(A->getValue()); in CreateFromArgs()
262 VersionTuple Version; in CreateFromArgs() local
263 if (Version.tryParse(A->getValue())) in CreateFromArgs()
264 Diags.Report(diag::err_drv_invalid_value) in CreateFromArgs()
265 << A->getAsString(Args) << A->getValue(); in CreateFromArgs()
267 Opts.DarwinTargetVariantSDKVersion = Version; in CreateFromArgs()
286 llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue()) in CreateFromArgs()
296 Opts.Dwarf64 = DwarfFormatArg->getOption().matches(OPT_gdwarf64); in CreateFromArgs()
304 Opts.DebugCompilationDir = A->getValue(); in CreateFromArgs()
317 Opts.InputFile = A->getValue(); in CreateFromArgs()
320 Diags.Report(diag::err_drv_unknown_argument) << A->getAsString(Args); in CreateFromArgs()
330 StringRef Name = A->getValue(); in CreateFromArgs()
337 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name; in CreateFromArgs()
364 // EmbedBitcode Option. If -fembed-bitcode is enabled, set the flag. in CreateFromArgs()
367 Opts.EmbedBitcode = llvm::StringSwitch<unsigned>(A->getValue()) in CreateFromArgs()
376 llvm::StringSwitch<EmitDwarfUnwindType>(A->getValue()) in CreateFromArgs()
378 .Case("no-compact-unwind", EmitDwarfUnwindType::NoCompactUnwind) in CreateFromArgs()
395 if (Path != "-") in getOutputStream()
402 Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message(); in getOutputStream()
415 return Diags.Report(diag::err_target_unknown_triple) << Opts.Triple; in ExecuteAssemblerImpl()
421 return Diags.Report(diag::err_fe_error_reading) in ExecuteAssemblerImpl()
434 std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(Opts.Triple)); in ExecuteAssemblerImpl()
449 TheTarget->createMCAsmInfo(*MRI, Opts.Triple, MCOptions)); in ExecuteAssemblerImpl()
458 Opts.OutputPath = "-"; in ExecuteAssemblerImpl()
471 TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS)); in ExecuteAssemblerImpl()
483 assert(Opts.RelocationModel == "dynamic-no-pic" && in ExecuteAssemblerImpl()
491 TheTarget->createMCObjectFileInfo(Ctx, PIC)); in ExecuteAssemblerImpl()
493 MOFI->setDarwinTargetVariantTriple(*Opts.DarwinTargetVariantTriple); in ExecuteAssemblerImpl()
495 MOFI->setDarwinTargetVariantSDKVersion(Opts.DarwinTargetVariantSDKVersion); in ExecuteAssemblerImpl()
521 SrcMgr.getMemoryBuffer(BufferIndex)->getBuffer()); in ExecuteAssemblerImpl()
525 std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo()); in ExecuteAssemblerImpl()
541 MCInstPrinter *IP = TheTarget->createMCInstPrinter( in ExecuteAssemblerImpl()
546 CE.reset(TheTarget->createMCCodeEmitter(*MCII, Ctx)); in ExecuteAssemblerImpl()
548 TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); in ExecuteAssemblerImpl()
551 Str.reset(TheTarget->createAsmStreamer(Ctx, std::move(FOut), IP, in ExecuteAssemblerImpl()
558 if (!FDOS->supportsSeeking()) { in ExecuteAssemblerImpl()
564 TheTarget->createMCCodeEmitter(*MCII, Ctx)); in ExecuteAssemblerImpl()
566 TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); in ExecuteAssemblerImpl()
570 DwoOS ? MAB->createDwoObjectWriter(*Out, *DwoOS) in ExecuteAssemblerImpl()
571 : MAB->createObjectWriter(*Out); in ExecuteAssemblerImpl()
574 Str.reset(TheTarget->createMCObjectStreamer( in ExecuteAssemblerImpl()
576 Str.get()->initSections(Opts.NoExecStack, *STI); in ExecuteAssemblerImpl()
579 // When -fembed-bitcode is passed to clang_as, a 1-byte marker in ExecuteAssemblerImpl()
584 Str.get()->switchSection(AsmLabel); in ExecuteAssemblerImpl()
585 Str.get()->emitZeros(1); in ExecuteAssemblerImpl()
595 TheTarget->createMCAsmParser(*STI, *Parser, *MCII, MCOptions)); in ExecuteAssemblerImpl()
597 Failed = Diags.Report(diag::err_target_unknown_triple) << Opts.Triple; in ExecuteAssemblerImpl()
607 Ctx.setSymbolValue(Parser->getStreamer(), Sym, Value); in ExecuteAssemblerImpl()
611 Parser->setTargetParser(*TAP.get()); in ExecuteAssemblerImpl()
612 Failed = Parser->Run(Opts.NoInitialTextSection); in ExecuteAssemblerImpl()
624 if (Opts.OutputPath != "-") in ExecuteAssembler()
626 if (!Opts.SplitDwarfOutput.empty() && Opts.SplitDwarfOutput != "-") in ExecuteAssembler()
637 Diags.Report(diag::err_fe_error_backend) << Message; in LLVMErrorHandler()
653 DiagClient->setPrefix("clang -cc1as"); in cc1as_main()
669 llvm::outs(), "clang -cc1as [options] file...", in cc1as_main()
677 // Honor -version. in cc1as_main()
679 // FIXME: Use a better -version message? in cc1as_main()
685 // Honor -mllvm. in cc1as_main()