summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/JumpInstrTableInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Analysis/JumpInstrTableInfo.h')
-rw-r--r--include/llvm/Analysis/JumpInstrTableInfo.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/llvm/Analysis/JumpInstrTableInfo.h b/include/llvm/Analysis/JumpInstrTableInfo.h
index 54760aa02466..591e794a3901 100644
--- a/include/llvm/Analysis/JumpInstrTableInfo.h
+++ b/include/llvm/Analysis/JumpInstrTableInfo.h
@@ -16,7 +16,6 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/Pass.h"
-
#include <vector>
namespace llvm {
@@ -37,7 +36,9 @@ class JumpInstrTableInfo : public ImmutablePass {
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 @@ public:
/// 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 */