Go to the documentation of this file.
27 #define DEBUG_TYPE "reset-machine-function"
29 STATISTIC(NumFunctionsReset,
"Number of functions reset");
30 STATISTIC(NumFunctionsVisited,
"Number of functions visited");
36 bool EmitFallbackDiag;
38 bool AbortOnFailedISel;
42 ResetMachineFunction(
bool EmitFallbackDiag =
false,
43 bool AbortOnFailedISel =
false)
45 AbortOnFailedISel(AbortOnFailedISel) {}
47 StringRef getPassName()
const override {
return "ResetMachineFunction"; }
55 ++NumFunctionsVisited;
59 auto ClearVRegTypesOnReturn =
64 if (AbortOnFailedISel)
69 if (EmitFallbackDiag) {
72 F.getContext().diagnose(DiagFallback);
84 "Reset machine function if ISel failed",
false,
false)
88 bool AbortOnFailedISel =
false) {
89 return new ResetMachineFunction(EmitFallbackDiag, AbortOnFailedISel);
bool hasProperty(Property P) const
This is an optimization pass for GlobalISel generic memory operations.
Diagnostic information for ISel fallback path.
INITIALIZE_PASS(ResetMachineFunction, DEBUG_TYPE, "Reset machine function if ISel failed", false, false) MachineFunctionPass *llvm
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Represent the analysis usage information of a pass.
const MachineFunctionProperties & getProperties() const
Get the function properties.
MachineFunctionPass * createResetMachineFunctionPass(bool EmitFallbackDiag, bool AbortOnFailedISel)
This pass resets a MachineFunction when it has the FailedISel property as if it was just created.
LLVM_NODISCARD detail::scope_exit< typename std::decay< Callable >::type > make_scope_exit(Callable &&F)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
STATISTIC(NumFunctions, "Total number of functions")
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
StringRef - Represent a constant reference to a string, i.e.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
Function & getFunction()
Return the LLVM function that this machine code represents.
void reset()
Reset the instance as if it was just created.