Lines Matching +full:pic +full:- +full:no +full:- +full:reset
1 //===-- llvm-mc.cpp - Machine Code Hacking Driver ---------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
50 cl::init("-"), cl::cat(MCCategory));
58 cl::init("-"), cl::cat(MCCategory));
60 static cl::opt<std::string> SplitDwarfFile("split-dwarf-file",
65 static cl::opt<bool> ShowEncoding("show-encoding",
70 "compress-debug-sections", cl::ValueOptional,
73 cl::values(clEnumValN(DebugCompressionType::None, "none", "No compression"),
79 ShowInst("show-inst", cl::desc("Show internal instruction representation"),
83 ShowInstOperands("show-inst-operands",
88 OutputAsmVariant("output-asm-variant",
93 PrintImmHex("print-imm-hex", cl::init(false),
103 PreserveComments("preserve-comments",
131 "see -version for available targets"),
137 "see -version for available targets"),
142 cl::desc("Target a specific cpu type (-mcpu=help for details)"),
143 cl::value_desc("cpu-name"), cl::init(""), cl::cat(MCCategory));
147 cl::desc("Target specific attributes (-mattr=help for details)"),
148 cl::value_desc("a1,+a2,-a3,..."), cl::cat(MCCategory));
150 static cl::opt<bool> PIC("position-independent", variable
155 LargeCodeModel("large-code-model",
173 DebugCompilationDir("fdebug-compilation-dir",
178 "fdebug-prefix-map", cl::desc("Map file source paths in debug info"),
179 cl::value_desc("= separated key-value pairs"), cl::cat(MCCategory));
182 "main-file-name",
187 "masm-integers",
192 "masm-hexfloats",
193 cl::desc("Enable MASM-style hex float initializers (3F800000r)"),
197 "motorola-integers",
201 static cl::opt<bool> NoExecStack("no-exec-stack",
215 cl::values(clEnumValN(AC_AsLex, "as-lex", "Lex tokens from a .s file"),
280 Lexer.setBuffer(SrcMgr.getMemoryBuffer(SrcMgr.getMainFileID())->getBuffer()); in AsLexInput()
321 TheTarget->createMCAsmParser(STI, *Parser, MCII, MCOptions)); in AssembleInput()
332 Parser->setShowParsedOperands(ShowInstOperands); in AssembleInput()
333 Parser->setTargetParser(*TAP); in AssembleInput()
334 Parser->getLexer().setLexMasmIntegers(LexMasmIntegers); in AssembleInput()
335 Parser->getLexer().setLexMasmHexFloats(LexMasmHexFloats); in AssembleInput()
336 Parser->getLexer().setLexMotorolaIntegers(LexMotorolaIntegers); in AssembleInput()
338 int Res = Parser->Run(NoInitialTextSection); in AssembleInput()
352 // Register the target printer for --version. in main()
381 MemoryBuffer *Buffer = BufferPtr->get(); in main()
392 std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName)); in main()
396 TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions)); in main()
403 << "--compress-debug-sections: " << Reason; in main()
407 MAI->setPreserveAsmComments(PreserveComments); in main()
419 TheTarget->createMCSubtargetInfo(TripleName, MCPU, FeaturesStr)); in main()
427 TheTarget->createMCObjectFileInfo(Ctx, PIC, LargeCodeModel)); in main()
440 // The 64-bit DWARF format was introduced in DWARFv3. in main()
443 << ": the 64-bit DWARF format is not supported for DWARF versions " in main()
447 // 32-bit targets don't support DWARF64, which requires 64-bit relocations. in main()
448 if (MAI->getCodePointerSize() < 8) { in main()
450 << ": the 64-bit DWARF format is only supported for 64-bit " in main()
456 // is supported only for 4-byte long references. in main()
457 if (MAI->needsDwarfSectionOffsetDirective()) { in main()
458 errs() << ProgName << ": the 64-bit DWARF format is not supported for " in main()
471 // If no compilation dir is set, try to use the current directory. in main()
483 Ctx.setGenDwarfRootFile(InputFilename, Buffer->getBuffer()); in main()
504 raw_pwrite_stream *OS = &Out->os(); in main()
507 std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo()); in main()
512 IP = TheTarget->createMCInstPrinter(Triple(TripleName), OutputAsmVariant, in main()
524 if (!IP->applyTargetSpecificCLOption(Opt)) { in main()
530 IP->setPrintImmHex(PrintImmHex); in main()
535 CE.reset(TheTarget->createMCCodeEmitter(*MCII, Ctx)); in main()
538 TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); in main()
540 Str.reset(TheTarget->createAsmStreamer(Ctx, std::move(FOut), IP, in main()
544 Str.reset(TheTarget->createNullStreamer(Ctx)); in main()
548 if (!Out->os().supportsSeeking()) { in main()
549 BOS = std::make_unique<buffer_ostream>(Out->os()); in main()
553 MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, Ctx); in main()
554 MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions); in main()
555 Str.reset(TheTarget->createMCObjectStreamer( in main()
557 DwoOut ? MAB->createDwoObjectWriter(*OS, DwoOut->os()) in main()
558 : MAB->createObjectWriter(*OS), in main()
561 Str->initSections(true, *STI); in main()
568 Res = AsLexInput(SrcMgr, *MAI, Out->os()); in main()
575 IP->setUseMarkup(true); in main()
579 IP->setUseColor(true); in main()
590 // Keep output if no errors. in main()
592 Out->keep(); in main()
594 DwoOut->keep(); in main()