Coverage Report

Created: 2022-01-18 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.cpp
Line
Count
Source
1
//===-- ClangDeclVendor.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/ExpressionParser/Clang/ClangDeclVendor.h"
10
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
11
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
12
13
#include "lldb/Utility/ConstString.h"
14
15
using namespace lldb_private;
16
17
uint32_t ClangDeclVendor::FindDecls(ConstString name, bool append,
18
                                    uint32_t max_matches,
19
33.0k
                                    std::vector<clang::NamedDecl *> &decls) {
20
33.0k
  if (!append)
21
33.0k
    decls.clear();
22
23
33.0k
  std::vector<CompilerDecl> compiler_decls;
24
33.0k
  uint32_t ret = FindDecls(name, /*append*/ false, max_matches, compiler_decls);
25
33.0k
  for (CompilerDecl compiler_decl : compiler_decls) {
26
1.20k
    clang::Decl *d = ClangUtil::GetDecl(compiler_decl);
27
1.20k
    clang::NamedDecl *nd = llvm::cast<clang::NamedDecl>(d);
28
1.20k
    decls.push_back(nd);
29
1.20k
  }
30
33.0k
  return ret;
31
33.0k
}