diff include/llvm/Analysis/JumpInstrTableInfo.h @ 83:60c9769439b8 LLVM3.7

LLVM 3.7
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Wed, 18 Feb 2015 14:55:36 +0900
parents 54457678186b
children
line wrap: on
line diff
--- a/include/llvm/Analysis/JumpInstrTableInfo.h	Mon Sep 08 22:07:30 2014 +0900
+++ b/include/llvm/Analysis/JumpInstrTableInfo.h	Wed Feb 18 14:55:36 2015 +0900
@@ -16,7 +16,6 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/Pass.h"
-
 #include <vector>
 
 namespace llvm {
@@ -37,7 +36,9 @@
 public:
   static char ID;
 
-  JumpInstrTableInfo();
+  /// The default byte alignment for jump tables is 16, which is large but
+  /// usually safe.
+  JumpInstrTableInfo(uint64_t ByteAlign = 16);
   virtual ~JumpInstrTableInfo();
   const char *getPassName() const override {
     return "Jump-Instruction Table Info";
@@ -52,9 +53,19 @@
   /// Gets the tables.
   const JumpTables &getTables() const { return Tables; }
 
+  /// Gets the alignment in bytes of a jumptable entry.
+  uint64_t entryByteAlignment() const { return ByteAlignment; }
 private:
   JumpTables Tables;
+
+  /// A power-of-two alignment of a jumptable entry.
+  uint64_t ByteAlignment;
 };
+
+/// Creates a JumpInstrTableInfo pass with the given bound on entry size. This
+/// bound specifies the maximum number of bytes needed to represent an
+/// unconditional jump or a trap instruction in the back end currently in use.
+ModulePass *createJumpInstrTableInfoPass(unsigned Bound);
 }
 
 #endif /* LLVM_ANALYSIS_JUMPINSTRTABLEINFO_H */