Coverage Report

Created: 2018-11-12 17:33

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