LLDB mainline
DeclVendor.h
Go to the documentation of this file.
1//===-- DeclVendor.h --------------------------------------------*- 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#ifndef LLDB_SYMBOL_DECLVENDOR_H
10#define LLDB_SYMBOL_DECLVENDOR_H
11
12#include "lldb/lldb-defines.h"
13
14#include <vector>
15
16namespace lldb_private {
17
18// The Decl vendor class is intended as a generic interface to search for named
19// declarations that are not necessarily backed by a specific symbol file.
21public:
27 // Constructors and Destructors
29
30 virtual ~DeclVendor() = default;
31
32 DeclVendorKind GetKind() const { return m_kind; }
33
34 /// Look up the set of Decls that the DeclVendor currently knows about
35 /// matching a given name.
36 ///
37 /// \param[in] name
38 /// The name to look for.
39 ///
40 /// \param[in] append
41 /// If true, FindDecls will clear "decls" when it starts.
42 ///
43 /// \param[in] max_matches
44 /// The maximum number of Decls to return. UINT32_MAX means "as
45 /// many as possible."
46 ///
47 /// \return
48 /// The number of Decls added to decls; will not exceed
49 /// max_matches.
50 virtual uint32_t FindDecls(ConstString name, bool append,
51 uint32_t max_matches,
52 std::vector<CompilerDecl> &decls) = 0;
53
54 /// Look up the types that the DeclVendor currently knows about matching a
55 /// given name.
56 ///
57 /// \param[in] name
58 /// The name to look for.
59 ///
60 /// \param[in] max_matches
61 // The maximum number of matches. UINT32_MAX means "as many as possible".
62 ///
63 /// \return
64 /// The vector of CompilerTypes that was found.
65 std::vector<CompilerType> FindTypes(ConstString name, uint32_t max_matches);
66
67private:
68 // For DeclVendor only
69 DeclVendor(const DeclVendor &) = delete;
70 const DeclVendor &operator=(const DeclVendor &) = delete;
71
73};
74
75} // namespace lldb_private
76
77#endif
A uniqued constant string class.
Definition ConstString.h:40
const DeclVendorKind m_kind
Definition DeclVendor.h:72
DeclVendorKind GetKind() const
Definition DeclVendor.h:32
DeclVendor(const DeclVendor &)=delete
virtual ~DeclVendor()=default
DeclVendor(DeclVendorKind kind)
Definition DeclVendor.h:28
virtual uint32_t FindDecls(ConstString name, bool append, uint32_t max_matches, std::vector< CompilerDecl > &decls)=0
Look up the set of Decls that the DeclVendor currently knows about matching a given name.
const DeclVendor & operator=(const DeclVendor &)=delete
std::vector< CompilerType > FindTypes(ConstString name, uint32_t max_matches)
Look up the types that the DeclVendor currently knows about matching a given name.
A class that represents a running process on the host machine.