Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/MC/MCWin64EH.h
Line
Count
Source (jump to first uncovered line)
1
//===- MCWin64EH.h - Machine Code Win64 EH support --------------*- C++ -*-===//
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
// This file contains declarations to support the Win64 Exception Handling
10
// scheme in MC.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_MC_MCWIN64EH_H
15
#define LLVM_MC_MCWIN64EH_H
16
17
#include "llvm/MC/MCWinEH.h"
18
#include "llvm/Support/Win64EH.h"
19
20
namespace llvm {
21
class MCStreamer;
22
class MCSymbol;
23
24
namespace Win64EH {
25
struct Instruction {
26
484
  static WinEH::Instruction PushNonVol(MCSymbol *L, unsigned Reg) {
27
484
    return WinEH::Instruction(Win64EH::UOP_PushNonVol, L, Reg, -1);
28
484
  }
29
710
  static WinEH::Instruction Alloc(MCSymbol *L, unsigned Size) {
30
710
    return WinEH::Instruction(Size > 128 ? 
UOP_AllocLarge55
:
UOP_AllocSmall655
, L,
31
710
                              -1, Size);
32
710
  }
33
2
  static WinEH::Instruction PushMachFrame(MCSymbol *L, bool Code) {
34
2
    return WinEH::Instruction(UOP_PushMachFrame, L, -1, Code ? 1 : 
00
);
35
2
  }
36
  static WinEH::Instruction SaveNonVol(MCSymbol *L, unsigned Reg,
37
2
                                       unsigned Offset) {
38
2
    return WinEH::Instruction(Offset > 512 * 1024 - 8 ? 
UOP_SaveNonVolBig0
39
2
                                                      : UOP_SaveNonVol,
40
2
                              L, Reg, Offset);
41
2
  }
42
  static WinEH::Instruction SaveXMM(MCSymbol *L, unsigned Reg,
43
194
                                    unsigned Offset) {
44
194
    return WinEH::Instruction(Offset > 512 * 1024 - 8 ? 
UOP_SaveXMM128Big0
45
194
                                                      : UOP_SaveXMM128,
46
194
                              L, Reg, Offset);
47
194
  }
48
99
  static WinEH::Instruction SetFPReg(MCSymbol *L, unsigned Reg, unsigned Off) {
49
99
    return WinEH::Instruction(UOP_SetFPReg, L, Reg, Off);
50
99
  }
51
};
52
53
class UnwindEmitter : public WinEH::UnwindEmitter {
54
public:
55
  void Emit(MCStreamer &Streamer) const override;
56
  void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI) const override;
57
};
58
59
class ARM64UnwindEmitter : public WinEH::UnwindEmitter {
60
public:
61
  void Emit(MCStreamer &Streamer) const override;
62
  void EmitUnwindInfo(MCStreamer &Streamer,
63
                      WinEH::FrameInfo *FI) const override;
64
};
65
66
}
67
} // end namespace llvm
68
69
#endif