27 #define DEBUG_TYPE "reset-machine-function" 29 STATISTIC(NumFunctionsReset,
"Number of functions reset");
35 bool EmitFallbackDiag;
37 bool AbortOnFailedISel;
41 ResetMachineFunction(
bool EmitFallbackDiag =
false,
42 bool AbortOnFailedISel =
false)
44 AbortOnFailedISel(AbortOnFailedISel) {}
46 StringRef getPassName()
const override {
return "ResetMachineFunction"; }
57 auto ClearVRegTypesOnReturn =
62 if (AbortOnFailedISel)
67 if (EmitFallbackDiag) {
82 "Reset machine function if ISel failed",
false,
false)
86 bool AbortOnFailedISel = false) {
87 return new ResetMachineFunction(EmitFallbackDiag, AbortOnFailedISel);
Diagnostic information for ISel fallback path.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
void clearVirtRegTypes()
Remove all types associated to virtual registers (after instruction selection and constraining of all...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
INITIALIZE_PASS(ResetMachineFunction, DEBUG_TYPE, "Reset machine function if ISel failed", false, false) MachineFunctionPass *llvm
const MachineFunctionProperties & getProperties() const
Get the function properties.
LLVM_NODISCARD detail::scope_exit< typename std::decay< Callable >::type > make_scope_exit(Callable &&F)
STATISTIC(NumFunctions, "Total number of functions")
MachineFunctionPass * createResetMachineFunctionPass(bool EmitFallbackDiag, bool AbortOnFailedISel)
This pass resets a MachineFunction when it has the FailedISel property as if it was just created...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Represent the analysis usage information of a pass.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
const Function & getFunction() const
Return the LLVM function that this machine code represents.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void reset()
Reset the instance as if it was just created.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
bool hasProperty(Property P) const
StringRef - Represent a constant reference to a string, i.e.