Coverage Report

Created: 2022-01-18 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- ObjCPlusPlusLanguage.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 "ObjCPlusPlusLanguage.h"
10
11
#include "lldb/Core/PluginManager.h"
12
#include "lldb/Utility/ConstString.h"
13
14
using namespace lldb;
15
using namespace lldb_private;
16
17
LLDB_PLUGIN_DEFINE(ObjCPlusPlusLanguage)
18
19
115
bool ObjCPlusPlusLanguage::IsSourceFile(llvm::StringRef file_path) const {
20
115
  const auto suffixes = {".h", ".mm"};
21
230
  for (auto suffix : suffixes) {
22
230
    if (file_path.endswith_insensitive(suffix))
23
106
      return true;
24
230
  }
25
9
  return false;
26
115
}
27
28
3.47k
void ObjCPlusPlusLanguage::Initialize() {
29
3.47k
  PluginManager::RegisterPlugin(GetPluginNameStatic(), "Objective-C++ Language",
30
3.47k
                                CreateInstance);
31
3.47k
}
32
33
3.46k
void ObjCPlusPlusLanguage::Terminate() {
34
3.46k
  PluginManager::UnregisterPlugin(CreateInstance);
35
3.46k
}
36
37
// Static Functions
38
172k
Language *ObjCPlusPlusLanguage::CreateInstance(lldb::LanguageType language) {
39
172k
  switch (language) {
40
1.00k
  case lldb::eLanguageTypeObjC_plus_plus:
41
1.00k
    return new ObjCPlusPlusLanguage();
42
171k
  default:
43
171k
    return nullptr;
44
172k
  }
45
172k
}