diff options
author | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2008-04-16 20:10:13 +0000 |
---|---|---|
committer | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2008-04-16 20:10:13 +0000 |
commit | 52e724ad7e679ee590f4bd763d55280586a8f1bc (patch) | |
tree | 17e026641b730ae73981f77df025c5543c674201 /include | |
parent | dc00858e11d243bd2c7cb39bbb92c557b123573e (diff) | |
download | external_llvm-52e724ad7e679ee590f4bd763d55280586a8f1bc.zip external_llvm-52e724ad7e679ee590f4bd763d55280586a8f1bc.tar.gz external_llvm-52e724ad7e679ee590f4bd763d55280586a8f1bc.tar.bz2 |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetInstrInfo.h | 13 |
1 files changed, 13 insertions, 0 deletions
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 |