1 //===-- JumpInstrTableInfo.cpp: Info for Jump-Instruction Tables ----------===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
9 /// \brief Information about jump-instruction tables that have been created by
10 /// JumpInstrTables pass.
12 //===----------------------------------------------------------------------===//
14 #define DEBUG_TYPE "jiti"
16 #include "llvm/Analysis/JumpInstrTableInfo.h"
17 #include "llvm/Analysis/Passes.h"
18 #include "llvm/IR/Function.h"
19 #include "llvm/IR/Type.h"
23 INITIALIZE_PASS(JumpInstrTableInfo, "jump-instr-table-info",
24 "Jump-Instruction Table Info", true, true)
25 char JumpInstrTableInfo::ID = 0;
27 ImmutablePass *llvm::createJumpInstrTableInfoPass() {
28 return new JumpInstrTableInfo();
31 JumpInstrTableInfo::JumpInstrTableInfo() : ImmutablePass(ID), Tables() {
32 initializeJumpInstrTableInfoPass(*PassRegistry::getPassRegistry());
35 JumpInstrTableInfo::~JumpInstrTableInfo() {}
37 void JumpInstrTableInfo::insertEntry(FunctionType *TableFunTy, Function *Target,
39 Tables[TableFunTy].push_back(JumpPair(Target, Jump));