CGRAOmp  0.1
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CGRAOmp::DFGPassBuilder Class Reference

A class to access the DFG Passes. More...

#include <DFGPass.hpp>

Public Types

using CallBackT = std::function< bool(StringRef, DFGPassManager &)>
 

Public Member Functions

 DFGPassBuilder ()
 
void registerPipelineParsingCallback (const CallBackT &C)
 Register a call back function to parse the pass pipeline. More...
 
Error parsePassPipeline (DFGPassManager &DPM, ArrayRef< std::string > PipelineText)
 Parsing the pipeline setting for DFG optimization. More...
 

Private Member Functions

Error search_callback ()
 Looking up call back function in the dynamic libraries. More...
 

Private Attributes

SmallVector< CallBackTcallback_list
 

Detailed Description

A class to access the DFG Passes.

Member Typedef Documentation

◆ CallBackT

using CGRAOmp::DFGPassBuilder::CallBackT = std::function<bool(StringRef, DFGPassManager &)>

Constructor & Destructor Documentation

◆ DFGPassBuilder()

DFGPassBuilder::DFGPassBuilder ( )

Member Function Documentation

◆ parsePassPipeline()

Error DFGPassBuilder::parsePassPipeline ( DFGPassManager DPM,
ArrayRef< std::string >  PipelineText 
)

Parsing the pipeline setting for DFG optimization.

Parameters
DPMDFGPassManager
PipelineTexta list of name of passes to be applied
Returns
Error is retured if a name of pass does not match any registered passes

◆ registerPipelineParsingCallback()

void DFGPassBuilder::registerPipelineParsingCallback ( const CallBackT C)

Register a call back function to parse the pass pipeline.

Parameters
CCall back function

◆ search_callback()

Error DFGPassBuilder::search_callback ( )
private

Looking up call back function in the dynamic libraries.

Returns
Error in either case, a failure in loading the dynmic lib or no call back function named getDFGPassPluginInfo

An exmaple of the call back function:

return { "Plugin name",
[](DFGPassBuilder &PB) {
PB.registerPipelineParsingCallback(
[](StringRef Name, DFGPassManager &PM) {
if (Name == "my-dfg-pass") {
PM.addPass(MyDFGPass());
return true;
}
return false;
}
);
}
};
}

Member Data Documentation

◆ callback_list

SmallVector<CallBackT> CGRAOmp::DFGPassBuilder::callback_list
private

The documentation for this class was generated from the following files:
getDFGPassPluginInfo
::CGRAOmp::DFGPassPluginLibraryInfo getDFGPassPluginInfo()
Definition: HelloDFGPass.cpp:47
CGRAOmp::DFGPassPluginLibraryInfo
A bundled information about the DFG Pass.
Definition: DFGPass.hpp:177
CGRAOmp::DFGPassBuilder::DFGPassBuilder
DFGPassBuilder()
Definition: DFGPass.cpp:76