LLVM: lib/CodeGen/CommandFlags.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

35#include

36#include

37#include

38#include <system_error>

39

40using namespace llvm;

41

42#define CGOPT(TY, NAME) \

43 static cl::opt *NAME##View; \

44 TY codegen::get##NAME() { \

45 assert(NAME##View && "Flag not registered."); \

46 return *NAME##View; \

47 }

48

49#define CGLIST(TY, NAME) \

50 static cl::list *NAME##View; \

51 std::vector codegen::get##NAME() { \

52 assert(NAME##View && "Flag not registered."); \

53 return *NAME##View; \

54 }

55

56

57#define CGOPT_EXP(TY, NAME) \

58 CGOPT(TY, NAME) \

59 std::optional codegen::getExplicit##NAME() { \

60 if (NAME##View->getNumOccurrences()) { \

61 TY res = *NAME##View; \

62 return res; \

63 } \

64 return std::nullopt; \

65 }

66

67CGOPT(std::string, MArch)

68CGOPT(std::string, MCPU)

69CGLIST(std::string, MAttrs)

77CGOPT(bool, EnableNoInfsFPMath)

78CGOPT(bool, EnableNoNaNsFPMath)

79CGOPT(bool, EnableNoSignedZerosFPMath)

80CGOPT(bool, EnableNoTrappingFPMath)

81CGOPT(bool, EnableAIXExtendedAltivecABI)

84CGOPT(bool, EnableHonorSignDependentRoundingFPMath)

88CGOPT(bool, DontPlaceZerosInBSS)

89CGOPT(bool, EnableGuaranteedTailCallOpt)

90CGOPT(bool, DisableTailCalls)

91CGOPT(bool, StackSymbolOrdering)

92CGOPT(bool, StackRealign)

93CGOPT(std::string, TrapFuncName)

94CGOPT(bool, UseCtors)

95CGOPT(bool, DisableIntegratedAS)

98CGOPT(bool, IgnoreXCOFFVisibility)

99CGOPT(bool, XCOFFTracebackTable)

100CGOPT(bool, EnableBBAddrMap)

101CGOPT(std::string, BBSections)

102CGOPT(unsigned, TLSSize)

105CGOPT(bool, UniqueSectionNames)

106CGOPT(bool, UniqueBasicBlockSectionNames)

107CGOPT(bool, SeparateNamedSections)

111CGOPT(bool, EnableStackSizeSection)

112CGOPT(bool, EnableAddrsig)

113CGOPT(bool, EnableCallGraphSection)

114CGOPT(bool, EmitCallSiteInfo)

116CGOPT(bool, EnableStaticDataPartitioning)

117CGOPT(bool, EnableDebugEntryValues)

118CGOPT(bool, ForceDwarfFrameSection)

119CGOPT(bool, XRayFunctionIndex)

120CGOPT(bool, DebugStrictDwarf)

121CGOPT(unsigned, AlignLoops)

122CGOPT(bool, JMCInstrument)

123CGOPT(bool, XCOFFReadOnlyPointers)

125

126#define CGBINDOPT(NAME) \

127 do { \

128 NAME##View = std::addressof(NAME); \

129 } while (0)

130

133 "march", cl::desc("Architecture to generate code for (see --version)"));

135

137 "mcpu", cl::desc("Target a specific cpu type (-mcpu=help for details)"),

140

143 cl::desc("Target specific attributes (-mattr=help for details)"),

146

148 "relocation-model", cl::desc("Choose relocation model"),

152 "Fully relocatable, position independent code"),

154 "Relocatable external references, non-relocatable code"),

157 "Code and read-only data relocatable, accessed PC-relative"),

160 "Read-write data relocatable, accessed relative to static base"),

162 "Combination of ropi and rwpi")));

164

166 "thread-model", cl::desc("Choose threading model"),

172

174 "code-model", cl::desc("Choose code model"),

181

183 "large-data-threshold",

184 cl::desc("Choose large data threshold for x86_64 medium code model"),

187

189 "exception-model", cl::desc("exception model"),

193 "default exception handling model"),

195 "DWARF-like CFI based exception handling"),

197 "SjLj exception handling"),

200 "Windows exception model"),

202 "WebAssembly exception handling")));

204

208 "Choose a file type (not all types are supported by all targets):"),

210 "Emit an assembly ('.s') file"),

212 "Emit a native object ('.o') file"),

214 "Emit nothing, for performance testing")));

216

218 "frame-pointer",

219 cl::desc("Specify frame pointer elimination optimization"),

223 "Disable frame pointer elimination"),

225 "Disable frame pointer elimination for non-leaf frame but "

226 "reserve the register in leaf functions"),

228 "Disable frame pointer elimination for non-leaf frame"),

230 "Enable frame pointer elimination, but reserve the frame "

231 "pointer register"),

233 "Enable frame pointer elimination")));

235

237 "enable-no-infs-fp-math",

238 cl::desc("Enable FP math optimizations that assume no +-Infs"),

241

243 "enable-no-nans-fp-math",

244 cl::desc("Enable FP math optimizations that assume no NaNs"),

247

249 "enable-no-signed-zeros-fp-math",

250 cl::desc("Enable FP math optimizations that assume "

251 "the sign of 0 is insignificant"),

253 CGBINDOPT(EnableNoSignedZerosFPMath);

254

256 "enable-no-trapping-fp-math",

257 cl::desc("Enable setting the FP exceptions build "

258 "attribute not to use exceptions"),

260 CGBINDOPT(EnableNoTrappingFPMath);

261

262 static const auto DenormFlagEnumOptions = cl::values(

265 "the sign of a flushed-to-zero number is preserved "

266 "in the sign of 0"),

268 "denormals are flushed to positive zero"),

270 "denormals have unknown treatment"));

271

272

274 "denormal-fp-math",

275 cl::desc("Select which denormal numbers the code is permitted to require"),

277 DenormFlagEnumOptions);

279

281 "denormal-fp-math-f32",

282 cl::desc("Select which denormal numbers the code is permitted to require for float"),

284 DenormFlagEnumOptions);

286

287 static cl::opt EnableHonorSignDependentRoundingFPMath(

288 "enable-sign-dependent-rounding-fp-math", cl::Hidden,

289 cl::desc("Force codegen to assume rounding mode can change dynamically"),

291 CGBINDOPT(EnableHonorSignDependentRoundingFPMath);

292

294 "float-abi", cl::desc("Choose float ABI type"),

297 "Target default float ABI type"),

299 "Soft float ABI (implied by -soft-float)"),

301 "Hard float ABI (uses FP registers)")));

303

305 "fp-contract", cl::desc("Enable aggressive formation of fused FP ops"),

309 "Fuse FP ops whenever profitable"),

312 "Only fuse FP ops when the result won't be affected.")));

314

316 "swift-async-fp",

317 cl::desc("Determine when the Swift async frame pointer should be set"),

320 "Determine based on deployment target"),

322 "Always set the bit"),

324 "Never set the bit")));

325 CGBINDOPT(SwiftAsyncFramePointer);

326

328 "nozero-initialized-in-bss",

329 cl::desc("Don't place zero-initialized symbols into bss section"),

332

333 static cl::opt EnableAIXExtendedAltivecABI(

334 "vec-extabi", cl::desc("Enable the AIX Extended Altivec ABI."),

336 CGBINDOPT(EnableAIXExtendedAltivecABI);

337

338 static cl::opt EnableGuaranteedTailCallOpt(

339 "tailcallopt",

341 "Turn fastcc calls into tail calls by (potentially) changing ABI."),

343 CGBINDOPT(EnableGuaranteedTailCallOpt);

344

346 "disable-tail-calls", cl::desc("Never emit tail calls"), cl::init(false));

348

350 "stack-symbol-ordering", cl::desc("Order local stack symbols."),

353

355 "stackrealign",

356 cl::desc("Force align the stack to the minimum alignment"),

359

362 cl::desc("Emit a call to trap function rather than a trap instruction"),

365

367 cl::desc("Use .ctors instead of .init_array."),

370

372 "data-sections", cl::desc("Emit data into separate sections"),

375

377 "function-sections", cl::desc("Emit functions into separate sections"),

380

382 "ignore-xcoff-visibility",

383 cl::desc("Not emit the visibility attribute for asm in AIX OS or give "

384 "all symbols 'unspecified' visibility in XCOFF object file"),

386 CGBINDOPT(IgnoreXCOFFVisibility);

387

389 "xcoff-traceback-table", cl::desc("Emit the XCOFF traceback table"),

392

394 "basic-block-address-map",

395 cl::desc("Emit the basic block address map section"), cl::init(false));

397

399 "basic-block-sections",

400 cl::desc("Emit basic blocks into separate sections"),

401 cl::value_desc("all | <function list (file)> | labels | none"),

404

406 "tls-size", cl::desc("Bit size of immediate TLS offsets"), cl::init(0));

408

410 "emulated-tls", cl::desc("Use emulated TLS model"), cl::init(false));

412

414 "enable-tlsdesc", cl::desc("Enable the use of TLS Descriptors"),

417

419 "unique-section-names", cl::desc("Give unique names to every section"),

422

423 static cl::opt UniqueBasicBlockSectionNames(

424 "unique-basic-block-section-names",

425 cl::desc("Give unique names to every basic block section"),

427 CGBINDOPT(UniqueBasicBlockSectionNames);

428

430 "separate-named-sections",

431 cl::desc("Use separate unique sections for named sections"),

433 CGBINDOPT(SeparateNamedSections);

434

436 "meabi", cl::desc("Set EABI type (default depends on triple):"),

444

446 "debugger-tune", cl::desc("Tune debug info for a particular debugger"),

454

460 "No vector functions library"),

462 "Accelerate framework"),

464 "Darwin libsystem_m"),

466 "GLIBC Vector Math library"),

470 "SIMD Library for Evaluating Elementary Functions"),

472 "Arm Performance Libraries"),

474 "AMD vector math library")));

476

478 "stack-size-section",

479 cl::desc("Emit a section containing stack size metadata"),

481 CGBINDOPT(EnableStackSizeSection);

482

484 "addrsig", cl::desc("Emit an address-significance table"),

487

489 "call-graph-section", cl::desc("Emit a call graph section"),

491 CGBINDOPT(EnableCallGraphSection);

492

494 "emit-call-site-info",

496 "Emit call site debug information, if debug information is enabled."),

499

501 "debug-entry-values",

502 cl::desc("Enable debug info for the debug entry values."),

504 CGBINDOPT(EnableDebugEntryValues);

505

507 "split-machine-functions",

508 cl::desc("Split out cold basic blocks from machine functions based on "

509 "profile information"),

512

513 static cl::opt EnableStaticDataPartitioning(

514 "partition-static-data-sections",

515 cl::desc("Partition data sections using profile information."),

517 CGBINDOPT(EnableStaticDataPartitioning);

518

520 "force-dwarf-frame-section",

521 cl::desc("Always emit a debug frame section."), cl::init(false));

522 CGBINDOPT(ForceDwarfFrameSection);

523

524 static cl::opt XRayFunctionIndex("xray-function-index",

525 cl::desc("Emit xray_fn_idx section"),

528

530 "strict-dwarf", cl::desc("use strict dwarf"), cl::init(false));

532

534 cl::desc("Default alignment for loops"));

536

538 "enable-jmc-instrument",

539 cl::desc("Instrument functions with a call to __CheckForDebuggerJustMyCode"),

542

544 "mxcoff-roptr",

545 cl::desc("When set to true, const objects with relocatable address "

546 "values are put into the RO data section."),

548 CGBINDOPT(XCOFFReadOnlyPointers);

549

551 "no-integrated-as", cl::desc("Disable integrated assembler"),

554

556}

557

560 "save-stats",

562 "Save LLVM statistics to a file in the current directory"

563 "(`-save-stats`/`-save-stats=cwd`) or the directory of the output"

564 "file (`-save-stats=obj`). (default: cwd)"),

566 "Save to the current working directory"),

569 "Save to the output file directory")),

572}

573

580 else {

583 if (!MBOrErr) {

584 errs() << "Error loading basic block sections function list file: "

585 << MBOrErr.getError().message() << "\n";

586 } else {

587 Options.BBSectionsFuncListBuf = std::move(*MBOrErr);

588 }

590 }

591}

592

593

594

603

605

606

608

609 Options.HonorSignDependentRoundingFPMathOption =

649

651

657}

658

660

661

662

663 if (getMCPU() == "native")

665

667}

668

671

672

673

674

675

676 if (getMCPU() == "native")

678 Features.AddFeature(Feature, IsEnabled);

679

680 for (auto const &MAttr : getMAttrs())

682

684}

685

688

689

690

691

692

693 if (getMCPU() == "native")

695 Features.AddFeature(Feature, IsEnabled);

696

697 for (auto const &MAttr : getMAttrs())

699

701}

702

704 B.addAttribute(Name, Val ? "true" : "false");

705}

706

707#define HANDLE_BOOL_ATTR(CL, AttrName) \

708 do { \

709 if (CL->getNumOccurrences() > 0 && !F.hasFnAttribute(AttrName)) \

710 renderBoolStringAttr(NewAttrs, AttrName, *CL); \

711 } while (0)

712

713

714

717 auto &Ctx = F.getContext();

718 AttributeList Attrs = F.getAttributes();

719 AttrBuilder NewAttrs(Ctx);

720

721 if (!CPU.empty() && F.hasFnAttribute("target-cpu"))

722 NewAttrs.addAttribute("target-cpu", CPU);

723 if (!Features.empty()) {

724

726 F.getFnAttribute("target-features").getValueAsString();

727 if (OldFeatures.empty())

728 NewAttrs.addAttribute("target-features", Features);

729 else {

732 Appended.append(Features);

733 NewAttrs.addAttribute("target-features", Appended);

734 }

735 }

736 if (FramePointerUsageView->getNumOccurrences() > 0 &&

737 F.hasFnAttribute("frame-pointer")) {

739 NewAttrs.addAttribute("frame-pointer", "all");

741 NewAttrs.addAttribute("frame-pointer", "non-leaf");

743 NewAttrs.addAttribute("frame-pointer", "non-leaf-no-reserve");

745 NewAttrs.addAttribute("frame-pointer", "reserved");

747 NewAttrs.addAttribute("frame-pointer", "none");

748 }

749 if (DisableTailCallsView->getNumOccurrences() > 0)

750 NewAttrs.addAttribute("disable-tail-calls",

753 NewAttrs.addAttribute("stackrealign");

754

757 HANDLE_BOOL_ATTR(EnableNoSignedZerosFPMathView, "no-signed-zeros-fp-math");

758

759 if (DenormalFPMathView->getNumOccurrences() > 0 &&

760 F.hasFnAttribute("denormal-fp-math")) {

762

763

764 NewAttrs.addAttribute("denormal-fp-math",

766 }

767

768 if (DenormalFP32MathView->getNumOccurrences() > 0 &&

769 F.hasFnAttribute("denormal-fp-math-f32")) {

770

772

773 NewAttrs.addAttribute(

774 "denormal-fp-math-f32",

776 }

777

778 if (TrapFuncNameView->getNumOccurrences() > 0)

779 for (auto &B : F)

780 for (auto &I : B)

782 if (const auto *F = Call->getCalledFunction())

783 if (F->getIntrinsicID() == Intrinsic::debugtrap ||

784 F->getIntrinsicID() == Intrinsic::trap)

785 Call->addFnAttr(

787

788

789 F.setAttributes(Attrs.addFnAttributes(Ctx, NewAttrs));

790}

791

792

793

799

803 Triple TheTriple(TargetTriple);

804 std::string Error;

805 const auto *TheTarget =

807 if (!TheTarget)

813 OptLevel);

816 Twine("could not allocate target machine for ") +

817 TargetTriple);

818 return std::unique_ptr(Target);

819}

820

827

831 return 0;

832

837 } else {

839 "Should have been a valid --save-stats value");

840 }

841

845

847 std::error_code EC;

848 auto StatsOS =

849 std::make_uniquellvm::raw\_fd\_ostream(StatsFilename, EC, FileFlags);

850 if (EC) {

852 << "Unable to open statistics file: " << EC.message() << "\n";

853 return 1;

854 }

855

857 return 0;

858}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")

#define CGLIST(TY, NAME)

Definition CommandFlags.cpp:49

#define CGOPT_EXP(TY, NAME)

Definition CommandFlags.cpp:57

#define CGBINDOPT(NAME)

Definition CommandFlags.cpp:126

#define CGOPT(TY, NAME)

Definition CommandFlags.cpp:42

#define HANDLE_BOOL_ATTR(CL, AttrName)

Definition CommandFlags.cpp:707

#define clEnumValN(ENUMVAL, FLAGNAME, DESC)

Module.h This file contains the declarations for the Module class.

static cl::opt< std::string > OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), cl::init("-"))

This file defines the SmallString class.

This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...

static cl::opt< bool > EnableMachineFunctionSplitter("enable-split-machine-functions", cl::Hidden, cl::desc("Split out cold blocks from machine functions based on profile " "information."))

Enable the machine function splitter pass.

static LLVM_ABI Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val=0)

Return a uniquified Attribute object.

Represents either an error or a value T.

std::error_code getError() const

Lightweight error class with error context and mandatory checking.

Tagged union holding either a T or a Error.

static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt)

Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...

A Module instance is used to store all the information related to an LLVM module.

SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...

void append(StringRef RHS)

Append from a StringRef.

void push_back(const T &Elt)

StringRef - Represent a constant reference to a string, i.e.

constexpr bool empty() const

empty - Check if the string is empty.

Manages the enabling and disabling of subtarget specific features.

const std::vector< std::string > & getFeatures() const

Returns the vector of individual subtarget features.

LLVM_ABI std::string getString() const

Returns features as a string.

LLVM_ABI void AddFeature(StringRef String, bool Enable=true)

Adds Features.

Target - Wrapper for Target specific information.

TargetMachine * createTargetMachine(const Triple &TT, StringRef CPU, StringRef Features, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM=std::nullopt, CodeGenOptLevel OL=CodeGenOptLevel::Default, bool JIT=false) const

createTargetMachine - Create a target specific machine implementation for the specified Triple.

Triple - Helper class for working with autoconf configuration names.

bool hasDefaultTLSDESC() const

True if the target uses TLSDESC by default.

bool hasDefaultDataSections() const

Tests whether the target uses -data-sections as default.

bool hasDefaultEmulatedTLS() const

Tests whether the target uses emulated TLS as default.

Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...

static LLVM_ABI raw_ostream & error()

Convenience method for printing "error: " to stderr.

ValuesClass values(OptsTy... Options)

Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...

initializer< Ty > init(const Ty &Val)

LLVM_ABI bool getEnableMachineFunctionSplitter()

LLVM_ABI bool getEnableHonorSignDependentRoundingFPMath()

LLVM_ABI std::string getTrapFuncName()

LLVM_ABI bool getEnableDebugEntryValues()

LLVM_ABI unsigned getTLSSize()

LLVM_ABI bool getEnableGuaranteedTailCallOpt()

LLVM_ABI llvm::FPOpFusion::FPOpFusionMode getFuseFPOps()

LLVM_ABI std::optional< CodeModel::Model > getExplicitCodeModel()

LLVM_ABI bool getFunctionSections()

LLVM_ABI bool getDisableTailCalls()

LLVM_ABI std::string getCPUStr()

Definition CommandFlags.cpp:659

LLVM_ABI llvm::VectorLibrary getVectorLibrary()

LLVM_ABI bool getXCOFFReadOnlyPointers()

LLVM_ABI std::string getFeaturesStr()

Definition CommandFlags.cpp:669

LLVM_ABI bool getUniqueSectionNames()

LLVM_ABI DenormalMode::DenormalModeKind getDenormalFPMath()

LLVM_ABI llvm::FloatABI::ABIType getFloatABIForCalls()

LLVM_ABI void renderBoolStringAttr(AttrBuilder &B, StringRef Name, bool Val)

Definition CommandFlags.cpp:703

LLVM_ABI bool getDebugStrictDwarf()

LLVM_ABI bool getForceDwarfFrameSection()

LLVM_ABI bool getStackRealign()

LLVM_ABI std::string getMCPU()

LLVM_ABI bool getJMCInstrument()

LLVM_ABI bool getEnableAddrsig()

LLVM_ABI bool getStackSymbolOrdering()

LLVM_ABI void MaybeEnableStatistics()

Conditionally enables the collection of LLVM statistics during the tool run, based on the value of th...

Definition CommandFlags.cpp:821

LLVM_ABI SwiftAsyncFramePointerMode getSwiftAsyncFramePointer()

LLVM_ABI bool getEnableBBAddrMap()

LLVM_ABI std::vector< std::string > getFeatureList()

Definition CommandFlags.cpp:686

LLVM_ABI bool getEnableStaticDataPartitioning()

LLVM_ABI std::string getMArch()

LLVM_ABI DenormalMode::DenormalModeKind getDenormalFP32Math()

LLVM_ABI bool getEnableNoSignedZerosFPMath()

LLVM_ABI bool getEnableStackSizeSection()

LLVM_ABI llvm::EABI getEABIVersion()

LLVM_ABI bool getEnableCallGraphSection()

LLVM_ABI bool getEnableNoTrappingFPMath()

LLVM_ABI Expected< std::unique_ptr< TargetMachine > > createTargetMachineForTriple(StringRef TargetTriple, CodeGenOptLevel OptLevel=CodeGenOptLevel::Default)

Creates a TargetMachine instance with the options defined on the command line.

Definition CommandFlags.cpp:801

LLVM_ABI SaveStatsMode getSaveStats()

LLVM_ABI bool getUniqueBasicBlockSectionNames()

LLVM_ABI FramePointerKind getFramePointerUsage()

LLVM_ABI bool getDontPlaceZerosInBSS()

LLVM_ABI bool getSeparateNamedSections()

LLVM_ABI bool getEnableNoInfsFPMath()

LLVM_ABI bool getEnableNoNaNsFPMath()

LLVM_ABI std::optional< bool > getExplicitDataSections()

LLVM_ABI ThreadModel::Model getThreadModel()

LLVM_ABI bool getXCOFFTracebackTable()

LLVM_ABI bool getIgnoreXCOFFVisibility()

LLVM_ABI bool getDisableIntegratedAS()

LLVM_ABI bool getUseCtors()

LLVM_ABI llvm::DebuggerKind getDebuggerTuningOpt()

LLVM_ABI std::vector< std::string > getMAttrs()

LLVM_ABI void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F)

Set function attributes of function F based on CPU, Features, and command line flags.

Definition CommandFlags.cpp:715

LLVM_ABI llvm::BasicBlockSection getBBSectionsMode(llvm::TargetOptions &Options)

Definition CommandFlags.cpp:575

LLVM_ABI TargetOptions InitTargetOptionsFromCodeGenFlags(const llvm::Triple &TheTriple)

Common utility function tightly tied to the options listed here.

Definition CommandFlags.cpp:596

LLVM_ABI std::string getBBSections()

LLVM_ABI std::optional< bool > getExplicitEnableTLSDESC()

LLVM_ABI unsigned getAlignLoops()

LLVM_ABI std::optional< Reloc::Model > getExplicitRelocModel()

LLVM_ABI int MaybeSaveStatistics(StringRef OutputFilename, StringRef ToolName)

Conditionally saves the collected LLVM statistics to the received output file, based on the value of ...

Definition CommandFlags.cpp:828

LLVM_ABI bool getEnableAIXExtendedAltivecABI()

LLVM_ABI bool getXRayFunctionIndex()

LLVM_ABI llvm::ExceptionHandling getExceptionModel()

LLVM_ABI bool getEmitCallSiteInfo()

LLVM_ABI std::optional< bool > getExplicitEmulatedTLS()

LLVM_ABI MCTargetOptions InitMCTargetOptionsFromFlags()

@ OF_TextWithCRLF

The file should be opened in text mode and use a carriage linefeed '\r '.

LLVM_ABI void remove_filename(SmallVectorImpl< char > &path, Style style=Style::native)

Remove the last component from path unless it is the root dir.

LLVM_ABI void replace_extension(SmallVectorImpl< char > &path, const Twine &extension, Style style=Style::native)

Replace the file extension of path with extension.

LLVM_ABI StringRef filename(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)

Get filename.

LLVM_ABI void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")

Append to path.

LLVM_ABI StringMap< bool, MallocAllocator > getHostCPUFeatures()

getHostCPUFeatures - Get the LLVM names for the host CPU features.

LLVM_ABI StringRef getHostCPUName()

getHostCPUName - Get the LLVM name for the host CPU.

This is an optimization pass for GlobalISel generic memory operations.

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.

LLVM_ABI std::error_code inconvertibleErrorCode()

The value returned by this function can be returned from convertToErrorCode for Error values where no...

@ SjLj

setjmp/longjmp based exceptions

@ None

No exception support.

@ DwarfCFI

DWARF-like instruction based exceptions.

@ WinEH

Windows Exception Handling.

@ Wasm

WebAssembly Exception Handling.

Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)

Create formatted StringError object.

LLVM_ABI void EnableStatistics(bool DoPrintOnExit=true)

Enable the collection and printing of statistics.

CodeGenFileType

These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...

SwiftAsyncFramePointerMode

Indicates when and how the Swift async frame pointer bit should be set.

@ Always

Always set the bit.

@ Never

Never set the bit.

@ DeploymentBased

Determine whether to set the bit statically or dynamically based on the deployment target.

CodeGenOptLevel

Code generation optimization level.

LLVM_ABI raw_fd_ostream & errs()

This returns a reference to a raw_ostream for standard error.

VectorLibrary

List of known vector-functions libraries.

DebuggerKind

Identify a debugger for "tuning" the debug info.

@ SCE

Tune debug info for SCE targets (e.g. PS4).

@ DBX

Tune debug info for dbx.

@ Default

No specific tuning requested.

@ GDB

Tune debug info for gdb.

@ LLDB

Tune debug info for lldb.

LLVM_ABI void PrintStatisticsJSON(raw_ostream &OS)

Print statistics in JSON format.

StringRef toStringRef(bool B)

Construct a string ref from a boolean.

Represent subnormal handling kind for floating point instruction inputs and outputs.

DenormalModeKind

Represent handled modes for denormal (aka subnormal) modes in the floating point environment.

@ PreserveSign

The sign of a flushed-to-zero number is preserved in the sign of 0.

@ PositiveZero

Denormals are flushed to positive zero.

@ Dynamic

Denormals have unknown treatment.

@ IEEE

IEEE-754 denormal numbers preserved.

static const Target * lookupTarget(StringRef TripleStr, std::string &Error)

lookupTarget - Lookup a target based on a target triple.

LLVM_ABI RegisterCodeGenFlags()

Definition CommandFlags.cpp:131

LLVM_ABI RegisterSaveStatsFlag()

Definition CommandFlags.cpp:558

Create this object with static storage to register mc-related command line options.