1 //===- MachineFunctionInitalizer.h - machine function initializer ---------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file declares an interface that allows custom machine function 11 // initialization. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #ifndef LLVM_CODEGEN_MACHINEFUNCTIONINITIALIZER_H 16 #define LLVM_CODEGEN_MACHINEFUNCTIONINITIALIZER_H 17 18 namespace llvm { 19 20 class MachineFunction; 21 22 /// This interface provides a way to initialize machine functions after they are 23 /// created by the machine function analysis pass. 24 class MachineFunctionInitializer { 25 virtual void anchor(); 26 27 public: ~MachineFunctionInitializer()28 virtual ~MachineFunctionInitializer() {} 29 30 /// Initialize the machine function. 31 /// 32 /// Return true if error occurred. 33 virtual bool initializeMachineFunction(MachineFunction &MF) = 0; 34 }; 35 36 } // end namespace llvm 37 38 #endif 39