1*80814287SRaphael Isemann //===-- DeclVendor.cpp ----------------------------------------------------===//
28055cbc4SAlex Langford //
38055cbc4SAlex Langford // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
48055cbc4SAlex Langford // See https://llvm.org/LICENSE.txt for license information.
58055cbc4SAlex Langford // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
68055cbc4SAlex Langford //
78055cbc4SAlex Langford //===----------------------------------------------------------------------===//
88055cbc4SAlex Langford 
98055cbc4SAlex Langford #include "lldb/Symbol/DeclVendor.h"
10cb68bd72SAlex Langford #include "lldb/Symbol/CompilerDecl.h"
11cb68bd72SAlex Langford #include "lldb/Symbol/TypeSystem.h"
128055cbc4SAlex Langford 
138055cbc4SAlex Langford #include <vector>
148055cbc4SAlex Langford 
158055cbc4SAlex Langford using namespace lldb;
168055cbc4SAlex Langford using namespace lldb_private;
178055cbc4SAlex Langford 
FindTypes(ConstString name,uint32_t max_matches)188055cbc4SAlex Langford std::vector<CompilerType> DeclVendor::FindTypes(ConstString name,
198055cbc4SAlex Langford                                                 uint32_t max_matches) {
208055cbc4SAlex Langford   std::vector<CompilerType> ret;
21cb68bd72SAlex Langford   std::vector<CompilerDecl> decls;
228055cbc4SAlex Langford   if (FindDecls(name, /*append*/ true, max_matches, decls))
23cb68bd72SAlex Langford     for (auto decl : decls)
24cb68bd72SAlex Langford       if (auto type =
25cb68bd72SAlex Langford               decl.GetTypeSystem()->GetTypeForDecl(decl.GetOpaqueDecl()))
268055cbc4SAlex Langford         ret.push_back(type);
278055cbc4SAlex Langford   return ret;
288055cbc4SAlex Langford }
29