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 
16 namespace 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.
20 class DeclVendor {
21 public:
27  };
28  // Constructors and Destructors
29  DeclVendor(DeclVendorKind kind) : m_kind(kind) {}
30 
31  virtual ~DeclVendor() {}
32 
33  DeclVendorKind GetKind() const { return m_kind; }
34 
35  /// Look up the set of Decls that the DeclVendor currently knows about
36  /// matching a given name.
37  ///
38  /// \param[in] name
39  /// The name to look for.
40  ///
41  /// \param[in] append
42  /// If true, FindDecls will clear "decls" when it starts.
43  ///
44  /// \param[in] max_matches
45  /// The maximum number of Decls to return. UINT32_MAX means "as
46  /// many as possible."
47  ///
48  /// \return
49  /// The number of Decls added to decls; will not exceed
50  /// max_matches.
51  virtual uint32_t FindDecls(ConstString name, bool append,
52  uint32_t max_matches,
53  std::vector<CompilerDecl> &decls) = 0;
54 
55  /// Look up the types that the DeclVendor currently knows about matching a
56  /// given name.
57  ///
58  /// \param[in] name
59  /// The name to look for.
60  ///
61  /// \param[in] max_matches
62  // The maximum number of matches. UINT32_MAX means "as many as possible".
63  ///
64  /// \return
65  /// The vector of CompilerTypes that was found.
66  std::vector<CompilerType> FindTypes(ConstString name, uint32_t max_matches);
67 
68 private:
69  // For DeclVendor only
71 
73 };
74 
75 } // namespace lldb_private
76 
77 #endif
DeclVendorKind GetKind() const
Definition: DeclVendor.h:33
A class that represents a running process on the host machine.
DISALLOW_COPY_AND_ASSIGN(DeclVendor)
A uniqued constant string class.
Definition: ConstString.h:40
const DeclVendorKind m_kind
Definition: DeclVendor.h:72
DeclVendor(DeclVendorKind kind)
Definition: DeclVendor.h:29
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...
std::vector< CompilerType > FindTypes(ConstString name, uint32_t max_matches)
Look up the types that the DeclVendor currently knows about matching a given name.
Definition: DeclVendor.cpp:18