LLVM 17.0.0git
Typedefs | Enumerations | Functions
llvm::CodeGenOpt Namespace Reference

Typedefs

using IDType = int
 Type for the unique integer IDs of code generation optimization levels.
 

Enumerations

enum  Level : IDType { None = 0 , Less = 1 , Default = 2 , Aggressive = 3 }
 Code generation optimization level. More...
 

Functions

std::optional< LevelgetLevel (IDType ID)
 Get the Level identified by the integer ID.
 
std::optional< LevelparseLevel (char C)
 Parse C as a single digit integer ID and get matching Level.
 

Typedef Documentation

◆ IDType

using llvm::CodeGenOpt::IDType = typedef int

Type for the unique integer IDs of code generation optimization levels.

Definition at line 55 of file CodeGen.h.

Enumeration Type Documentation

◆ Level

Code generation optimization level.

Enumerator
None 

-O0

Less 

-O1

Default 

-O2, -Os

Aggressive 

-O3

Definition at line 57 of file CodeGen.h.

Function Documentation

◆ getLevel()

std::optional< Level > llvm::CodeGenOpt::getLevel ( IDType  ID)
inline

Get the Level identified by the integer ID.

Returns std::nullopt if ID is invalid.

Definition at line 66 of file CodeGen.h.

Referenced by parseLevel(), and llvm::LTOCodeGenerator::setOptLevel().

◆ parseLevel()

std::optional< Level > llvm::CodeGenOpt::parseLevel ( char  C)
inline

Parse C as a single digit integer ID and get matching Level.

Returns std::nullopt if the input is not a valid digit or not a valid ID.

Definition at line 74 of file CodeGen.h.

References llvm::CallingConv::C, and getLevel().