Coverage Report

Created: 2022-01-18 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/Architecture/AArch64/ArchitectureAArch64.cpp
Line
Count
Source
1
//===-- ArchitectureAArch64.cpp -------------------------------------------===//
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 "Plugins/Architecture/AArch64/ArchitectureAArch64.h"
10
#include "lldb/Core/PluginManager.h"
11
#include "lldb/Utility/ArchSpec.h"
12
13
using namespace lldb_private;
14
using namespace lldb;
15
16
LLDB_PLUGIN_DEFINE(ArchitectureAArch64)
17
18
3.44k
void ArchitectureAArch64::Initialize() {
19
3.44k
  PluginManager::RegisterPlugin(GetPluginNameStatic(),
20
3.44k
                                "AArch64-specific algorithms",
21
3.44k
                                &ArchitectureAArch64::Create);
22
3.44k
}
23
24
3.43k
void ArchitectureAArch64::Terminate() {
25
3.43k
  PluginManager::UnregisterPlugin(&ArchitectureAArch64::Create);
26
3.43k
}
27
28
std::unique_ptr<Architecture>
29
12.2k
ArchitectureAArch64::Create(const ArchSpec &arch) {
30
12.2k
  auto machine = arch.GetMachine();
31
12.2k
  if (machine != llvm::Triple::aarch64 && 
machine != llvm::Triple::aarch64_be12.2k
&&
32
12.2k
      
machine != llvm::Triple::aarch64_3212.2k
) {
33
12.2k
    return nullptr;
34
12.2k
  }
35
64
  return std::unique_ptr<Architecture>(new ArchitectureAArch64());
36
12.2k
}