From 52e724ad7e679ee590f4bd763d55280586a8f1bc Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 16 Apr 2008 20:10:13 +0000 Subject: Infrastructure for getting the machine code size of a function and an instruction. X86, PowerPC and ARM are implemented git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49809 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetInstrInfo.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 183967c..ca35fa7 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -388,6 +388,18 @@ public: abort(); return 0; // Must return a value in order to compile with VS 2005 } + + /// GetInstSize - Returns the size of the specified Instruction. + /// + virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const { + assert(0 && "Target didn't implement TargetInstrInfo::GetInstSize!"); + return 0; + } + + /// GetFunctionSizeInBytes - Returns the size of the specified MachineFunction. + /// + virtual unsigned GetFunctionSizeInBytes(const MachineFunction &MF) const = 0; + }; /// TargetInstrInfoImpl - This is the default implementation of @@ -408,6 +420,7 @@ public: MachineBasicBlock::iterator MI, unsigned DestReg, const MachineInstr *Orig) const; + virtual unsigned GetFunctionSizeInBytes(const MachineFunction &MF) const; }; } // End llvm namespace -- cgit v1.1