[PATCH] D22885: TargetInstrInfo: add virtual function GetInstSizeInBytes

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 13:49:52 PDT 2016


SjoerdMeijer updated this revision to Diff 65798.
SjoerdMeijer added a comment.

Thanks for reviewing.
I have added llvm_unreachable as the default implementation instead of 4.
Can we keep the function name that starts with a capital letter because that's the function that 6 targets already implement?


https://reviews.llvm.org/D22885

Files:
  include/llvm/Target/TargetInstrInfo.h

Index: include/llvm/Target/TargetInstrInfo.h
===================================================================
--- include/llvm/Target/TargetInstrInfo.h
+++ include/llvm/Target/TargetInstrInfo.h
@@ -250,6 +250,11 @@
                                  unsigned &Size, unsigned &Offset,
                                  const MachineFunction &MF) const;
 
+  /// Returns the size of the specified MachineInstr. 
+  virtual unsigned GetInstSizeInBytes(const MachineInstr &MI) const {
+    llvm_unreachable("Target didn't implement TargetInstrInfo::GetInstSizeInBytes!");
+  }
+
   /// Return true if the instruction is as cheap as a move instruction.
   ///
   /// Targets for different archs need to override this, and different


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22885.65798.patch
Type: text/x-patch
Size: 729 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160727/4a9d0d1a/attachment.bin>


More information about the llvm-commits mailing list