[PATCH] D22885: TargetInstrInfo: add virtual function GetInstSizeInBytes

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


SjoerdMeijer created this revision.
SjoerdMeijer added reviewers: sanjoy, mehdi_amini, dexonsmith, jmolloy.
SjoerdMeijer added a subscriber: llvm-commits.

This adds virtual function GetInstSizeInBytes to TargetInstrInfo that a lot of subclasses 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,12 @@
                                  unsigned &Size, unsigned &Offset,
                                  const MachineFunction &MF) const;
 
+
+  /// Returns the size of the specified MachineInstr. 
+  virtual unsigned GetInstSizeInBytes(const MachineInstr &MI) const {
+    return 4;
+  }
+
   /// 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.65795.patch
Type: text/x-patch
Size: 659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160727/9346b783/attachment.bin>


More information about the llvm-commits mailing list