Coverage Report

Created: 2023-05-31 04:38

/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.85k
void ArchitectureAArch64::Initialize() {
19
3.85k
  PluginManager::RegisterPlugin(GetPluginNameStatic(),
20
3.85k
                                "AArch64-specific algorithms",
21
3.85k
                                &ArchitectureAArch64::Create);
22
3.85k
}
23
24
3.84k
void ArchitectureAArch64::Terminate() {
25
3.84k
  PluginManager::UnregisterPlugin(&ArchitectureAArch64::Create);
26
3.84k
}
27
28
std::unique_ptr<Architecture>
29
11.4k
ArchitectureAArch64::Create(const ArchSpec &arch) {
30
11.4k
  auto machine = arch.GetMachine();
31
11.4k
  if (machine != llvm::Triple::aarch64 && 
machine != llvm::Triple::aarch64_be11.3k
&&
32
11.4k
      
machine != llvm::Triple::aarch64_3211.3k
) {
33
11.3k
    return nullptr;
34
11.3k
  }
35
106
  return std::unique_ptr<Architecture>(new ArchitectureAArch64());
36
11.4k
}