summaryrefslogtreecommitdiff
path: root/lib/Analysis/JumpInstrTableInfo.cpp
blob: b5b426533ff3430432a6dacb7360992dfa15d449 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//===-- JumpInstrTableInfo.cpp: Info for Jump-Instruction Tables ----------===//
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief Information about jump-instruction tables that have been created by
/// JumpInstrTables pass.
///
//===----------------------------------------------------------------------===//

#define DEBUG_TYPE "jiti"

#include "llvm/Analysis/JumpInstrTableInfo.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Type.h"

using namespace llvm;

INITIALIZE_PASS(JumpInstrTableInfo, "jump-instr-table-info",
                "Jump-Instruction Table Info", true, true)
char JumpInstrTableInfo::ID = 0;

ImmutablePass *llvm::createJumpInstrTableInfoPass() {
  return new JumpInstrTableInfo();
}

JumpInstrTableInfo::JumpInstrTableInfo() : ImmutablePass(ID), Tables() {
  initializeJumpInstrTableInfoPass(*PassRegistry::getPassRegistry());
}

JumpInstrTableInfo::~JumpInstrTableInfo() {}

void JumpInstrTableInfo::insertEntry(FunctionType *TableFunTy, Function *Target,
                                     Function *Jump) {
  Tables[TableFunTy].push_back(JumpPair(Target, Jump));
}