Coverage Report

Created: 2022-01-22 13:19

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/tools/lldb-server/SystemInitializerLLGS.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- SystemInitializerLLGS.cpp -------------------------------*- 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
#include "SystemInitializerLLGS.h"
10
11
#if defined(__APPLE__)
12
#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
13
using HostObjectFile = ObjectFileMachO;
14
#elif defined(_WIN32)
15
#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
16
using HostObjectFile = ObjectFilePECOFF;
17
#else
18
#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
19
using HostObjectFile = ObjectFileELF;
20
#endif
21
22
#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
23
#define LLDB_TARGET_ARM64
24
#endif
25
26
#if defined(__arm__) || defined(__arm) || defined(_ARM) || defined(_M_ARM) ||  \
27
    defined(LLDB_TARGET_ARM64)
28
#define LLDB_TARGET_ARM
29
#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
30
#endif
31
32
#if defined(__mips64__) || defined(mips64) || defined(__mips64) ||             \
33
    defined(__MIPS64__) || defined(_M_MIPS64)
34
#define LLDB_TARGET_MIPS64
35
#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
36
#endif
37
38
#if defined(__mips__) || defined(mips) || defined(__mips) ||                   \
39
    defined(__MIPS__) || defined(_M_MIPS) || defined(LLDB_TARGET_MIPS64)
40
#define LLDB_TARGET_MIPS
41
#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
42
#endif
43
44
using namespace lldb_private;
45
46
5
llvm::Error SystemInitializerLLGS::Initialize() {
47
5
  if (auto e = SystemInitializerCommon::Initialize())
48
0
    return e;
49
50
5
  HostObjectFile::Initialize();
51
52
#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
53
  EmulateInstructionARM::Initialize();
54
#endif
55
#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
56
  EmulateInstructionMIPS::Initialize();
57
#endif
58
#if defined(LLDB_TARGET_MIPS64)
59
  EmulateInstructionMIPS64::Initialize();
60
#endif
61
62
5
  return llvm::Error::success();
63
5
}
64
65
4
void SystemInitializerLLGS::Terminate() {
66
4
  HostObjectFile::Terminate();
67
68
#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
69
  EmulateInstructionARM::Terminate();
70
#endif
71
#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
72
  EmulateInstructionMIPS::Terminate();
73
#endif
74
#if defined(LLDB_TARGET_MIPS64)
75
  EmulateInstructionMIPS64::Terminate();
76
#endif
77
78
4
  SystemInitializerCommon::Terminate();
79
4
}