]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/source/Symbol/DeclVendor.cpp
MFC r355940:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / source / Symbol / DeclVendor.cpp
1 //===-- DeclVendor.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 "lldb/Symbol/DeclVendor.h"
10
11 #include "lldb/Symbol/ClangASTContext.h"
12
13 #include <vector>
14
15 using namespace lldb;
16 using namespace lldb_private;
17
18 std::vector<CompilerType> DeclVendor::FindTypes(ConstString name,
19                                                 uint32_t max_matches) {
20   // FIXME: This depends on clang, but should be able to support any
21   // TypeSystem.
22   std::vector<CompilerType> ret;
23   std::vector<clang::NamedDecl *> decls;
24   if (FindDecls(name, /*append*/ true, max_matches, decls))
25     for (auto *decl : decls)
26       if (auto type = ClangASTContext::GetTypeForDecl(decl))
27         ret.push_back(type);
28   return ret;
29 }