Mercurial > hg > CbC > CbC_llvm
comparison 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 |
comparison
equal
deleted
inserted
replaced
78:af83660cff7b | 83:60c9769439b8 |
---|---|
14 #ifndef LLVM_ANALYSIS_JUMPINSTRTABLEINFO_H | 14 #ifndef LLVM_ANALYSIS_JUMPINSTRTABLEINFO_H |
15 #define LLVM_ANALYSIS_JUMPINSTRTABLEINFO_H | 15 #define LLVM_ANALYSIS_JUMPINSTRTABLEINFO_H |
16 | 16 |
17 #include "llvm/ADT/DenseMap.h" | 17 #include "llvm/ADT/DenseMap.h" |
18 #include "llvm/Pass.h" | 18 #include "llvm/Pass.h" |
19 | |
20 #include <vector> | 19 #include <vector> |
21 | 20 |
22 namespace llvm { | 21 namespace llvm { |
23 class Function; | 22 class Function; |
24 class FunctionType; | 23 class FunctionType; |
35 /// for the jump-instruction tables. | 34 /// for the jump-instruction tables. |
36 class JumpInstrTableInfo : public ImmutablePass { | 35 class JumpInstrTableInfo : public ImmutablePass { |
37 public: | 36 public: |
38 static char ID; | 37 static char ID; |
39 | 38 |
40 JumpInstrTableInfo(); | 39 /// The default byte alignment for jump tables is 16, which is large but |
40 /// usually safe. | |
41 JumpInstrTableInfo(uint64_t ByteAlign = 16); | |
41 virtual ~JumpInstrTableInfo(); | 42 virtual ~JumpInstrTableInfo(); |
42 const char *getPassName() const override { | 43 const char *getPassName() const override { |
43 return "Jump-Instruction Table Info"; | 44 return "Jump-Instruction Table Info"; |
44 } | 45 } |
45 | 46 |
50 void insertEntry(FunctionType *TableFunTy, Function *Target, Function *Jump); | 51 void insertEntry(FunctionType *TableFunTy, Function *Target, Function *Jump); |
51 | 52 |
52 /// Gets the tables. | 53 /// Gets the tables. |
53 const JumpTables &getTables() const { return Tables; } | 54 const JumpTables &getTables() const { return Tables; } |
54 | 55 |
56 /// Gets the alignment in bytes of a jumptable entry. | |
57 uint64_t entryByteAlignment() const { return ByteAlignment; } | |
55 private: | 58 private: |
56 JumpTables Tables; | 59 JumpTables Tables; |
60 | |
61 /// A power-of-two alignment of a jumptable entry. | |
62 uint64_t ByteAlignment; | |
57 }; | 63 }; |
64 | |
65 /// Creates a JumpInstrTableInfo pass with the given bound on entry size. This | |
66 /// bound specifies the maximum number of bytes needed to represent an | |
67 /// unconditional jump or a trap instruction in the back end currently in use. | |
68 ModulePass *createJumpInstrTableInfoPass(unsigned Bound); | |
58 } | 69 } |
59 | 70 |
60 #endif /* LLVM_ANALYSIS_JUMPINSTRTABLEINFO_H */ | 71 #endif /* LLVM_ANALYSIS_JUMPINSTRTABLEINFO_H */ |