Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/MC/MCInstrAnalysis.cpp
Line
Count
Source
1
//===- MCInstrAnalysis.cpp - InstrDesc target hooks -----------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "llvm/MC/MCInstrAnalysis.h"
10
11
#include "llvm/ADT/APInt.h"
12
#include "llvm/MC/MCInst.h"
13
#include "llvm/MC/MCInstrDesc.h"
14
#include "llvm/MC/MCInstrInfo.h"
15
#include <cstdint>
16
17
using namespace llvm;
18
19
bool MCInstrAnalysis::clearsSuperRegisters(const MCRegisterInfo &MRI,
20
                                           const MCInst &Inst,
21
62
                                           APInt &Writes) const {
22
62
  Writes.clearAllBits();
23
62
  return false;
24
62
}
25
26
bool MCInstrAnalysis::evaluateBranch(const MCInst &Inst, uint64_t Addr,
27
53.8k
                                     uint64_t Size, uint64_t &Target) const {
28
53.8k
  if (Inst.getNumOperands() == 0 ||
29
53.8k
      
Info->get(Inst.getOpcode()).OpInfo[0].OperandType != MCOI::OPERAND_PCREL53.8k
)
30
2.15k
    return false;
31
51.7k
32
51.7k
  int64_t Imm = Inst.getOperand(0).getImm();
33
51.7k
  Target = Addr+Size+Imm;
34
51.7k
  return true;
35
51.7k
}