]> git.proxmox.com Git - rustc.git/blame - src/llvm/lib/MC/MCInstrAnalysis.cpp
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / lib / MC / MCInstrAnalysis.cpp
CommitLineData
223e47cc
LB
1//===-- MCInstrAnalysis.cpp - InstrDesc target hooks ------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/MC/MCInstrAnalysis.h"
11using namespace llvm;
12
1a4d82fc
JJ
13bool MCInstrAnalysis::evaluateBranch(const MCInst &Inst, uint64_t Addr,
14 uint64_t Size, uint64_t &Target) const {
223e47cc
LB
15 if (Inst.getNumOperands() == 0 ||
16 Info->get(Inst.getOpcode()).OpInfo[0].OperandType != MCOI::OPERAND_PCREL)
1a4d82fc 17 return false;
223e47cc
LB
18
19 int64_t Imm = Inst.getOperand(0).getImm();
1a4d82fc
JJ
20 Target = Addr+Size+Imm;
21 return true;
223e47cc 22}