FLANG
|
#include <flang/Frontend/CompilerInstance.h>
Public Member Functions | |
Compiler Invocation | |
{ | |
CompilerInvocation & | getInvocation () |
void | setInvocation (std::shared_ptr< CompilerInvocation > value) |
Replace the current invocation. | |
File manager | |
} { | |
Fortran::parser::AllSources & | getAllSources () const |
Return the current allSources. | |
bool | hasAllSources () const |
parser::AllCookedSources & | getAllCookedSources () |
Parser Operations | |
} { | |
Fortran::parser::Parsing & | getParsing () const |
Return parsing to be used by Actions. | |
Semantic analysis | |
} { | |
Fortran::semantics::SemanticsContext & | getSemanticsContext () |
const Fortran::semantics::SemanticsContext & | getSemanticsContext () const |
void | setSemaOutputStream (llvm::raw_ostream &value) |
Replace the current stream for verbose output. | |
void | setSemaOutputStream (std::unique_ptr< llvm::raw_ostream > value) |
Replace the current stream for verbose output. | |
llvm::raw_ostream & | getSemaOutputStream () |
Get the current stream for verbose output. | |
Fortran::semantics::Semantics & | getSemantics () |
const Fortran::semantics::Semantics & | getSemantics () const |
void | setSemantics (std::unique_ptr< Fortran::semantics::Semantics > sema) |
void | setRtTyTables (std::unique_ptr< Fortran::semantics::RuntimeDerivedTypeTables > tables) |
Fortran::semantics::RuntimeDerivedTypeTables & | getRtTyTables () |
High-Level Operations | |
} { | |
bool | executeAction (FrontendAction &act) |
Forwarding Methods | |
} { | |
clang::DiagnosticOptions & | getDiagnosticOpts () |
const clang::DiagnosticOptions & | getDiagnosticOpts () const |
FrontendOptions & | getFrontendOpts () |
const FrontendOptions & | getFrontendOpts () const |
PreprocessorOptions & | preprocessorOpts () |
const PreprocessorOptions & | preprocessorOpts () const |
Diagnostics Engine | |
} { | |
bool | hasDiagnostics () const |
clang::DiagnosticsEngine & | getDiagnostics () const |
Get the current diagnostics engine. | |
clang::DiagnosticConsumer & | getDiagnosticClient () const |
Output Files | |
{ { | |
void | clearOutputFiles (bool eraseFiles) |
Clear the output file list. | |
std::unique_ptr< llvm::raw_pwrite_stream > | createDefaultOutputFile (bool binary=true, llvm::StringRef baseInput="", llvm::StringRef extension="") |
Target Machine | |
{ { | |
const llvm::TargetMachine & | getTargetMachine () const |
Get the target machine. | |
llvm::TargetMachine & | getTargetMachine () |
bool | setUpTargetMachine () |
Sets up LLVM's TargetMachine. | |
std::string | getTargetFeatures () |
Produces the string which represents target feature. | |
Output Stream Methods | |
} { | |
void | setOutputStream (std::unique_ptr< llvm::raw_pwrite_stream > outStream) |
bool | isOutputStreamNull () |
void | writeOutputStream (const std::string &message) |
llvm::raw_pwrite_stream & | getOutputStream () |
Get the user specified output stream. | |
Timing | |
{ | |
bool | isTimingEnabled () const |
mlir::DefaultTimingManager & | getTimingManager () |
const mlir::DefaultTimingManager & | getTimingManager () const |
mlir::TimingScope & | getTimingScopeRoot () |
const mlir::TimingScope & | getTimingScopeRoot () const |
llvm::raw_ostream & | getTimingStreamMLIR () |
Get the timing stream for the MLIR pass manager. | |
llvm::raw_ostream & | getTimingStreamLLVM () |
Get the timing stream for the new LLVM pass manager. | |
llvm::raw_ostream & | getTimingStreamCodeGen () |
Construction Utility Methods | |
} { | |
void | createDiagnostics (clang::DiagnosticConsumer *client=nullptr, bool shouldOwnClient=true) |
static clang::IntrusiveRefCntPtr< clang::DiagnosticsEngine > | createDiagnostics (clang::DiagnosticOptions *opts, clang::DiagnosticConsumer *client=nullptr, bool shouldOwnClient=true) |
Helper class for managing a single instance of the Flang compiler.
This class serves two purposes: (1) It manages the various objects which are necessary to run the compiler (2) It provides utility routines for constructing and manipulating the common Flang objects.
The compiler instance generally owns the instance of all the objects that it manages. However, clients can still share objects by manually setting the object and retaking ownership prior to destroying the CompilerInstance.
The compiler instance is intended to simplify clients, but not to lock them in to the compiler instance for everything. When possible, utility functions come in two forms; a short form that reuses the CompilerInstance objects, and a long form that takes explicit instances of any required objects.
std::unique_ptr< llvm::raw_pwrite_stream > CompilerInstance::createDefaultOutputFile | ( | bool | binary = true , |
llvm::StringRef | baseInput = "" , |
||
llvm::StringRef | extension = "" |
||
) |
Create the default output file (based on the invocation's options) and add it to the list of tracked output files. If the name of the output file is not provided, it will be derived from the input file.
binary | The mode to open the file in. |
baseInput | If the invocation contains no output file name (i.e. outputFile in FrontendOptions is empty), the input path name to use for deriving the output path. |
extension | The extension to use for output names derived from baseInput . |
|
static |
Create a DiagnosticsEngine object
If no diagnostic client is provided, this method creates a DiagnosticConsumer that is owned by the returned diagnostic object. If using directly the caller is responsible for releasing the returned DiagnosticsEngine's client eventually.
opts | - The diagnostic options; note that the created text diagnostic object contains a reference to these options. |
client | - If non-NULL, a diagnostic client that will be attached to (and optionally, depending on /p shouldOwnClient, owned by) the returned DiagnosticsEngine object. |
bool CompilerInstance::executeAction | ( | FrontendAction & | act | ) |
Execute the provided action against the compiler's CompilerInvocation object.
act | - The action to execute. |
|
inline |
Get the timing stream fro the legacy LLVM pass manager. NOTE: If the codegen is updated to use the new pass manager, this should no longer be needed.