1278332Semaste//===-- DeclVendor.h --------------------------------------------*- C++ -*-===//
2278332Semaste//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6278332Semaste//
7278332Semaste//===----------------------------------------------------------------------===//
8278332Semaste
9278332Semaste#ifndef liblldb_DeclVendor_h_
10278332Semaste#define liblldb_DeclVendor_h_
11278332Semaste
12321369Sdim#include "lldb/lldb-defines.h"
13278332Semaste
14278332Semaste#include <vector>
15278332Semaste
16278332Semastenamespace lldb_private {
17314564Sdim
18341825Sdim// The Decl vendor class is intended as a generic interface to search for named
19341825Sdim// declarations that are not necessarily backed by a specific symbol file.
20314564Sdimclass DeclVendor {
21278332Semastepublic:
22360784Sdim  enum DeclVendorKind {
23360784Sdim    eClangDeclVendor,
24360784Sdim    eClangModuleDeclVendor,
25360784Sdim    eAppleObjCDeclVendor,
26360784Sdim    eLastClangDeclVendor,
27360784Sdim  };
28314564Sdim  // Constructors and Destructors
29360784Sdim  DeclVendor(DeclVendorKind kind) : m_kind(kind) {}
30314564Sdim
31314564Sdim  virtual ~DeclVendor() {}
32314564Sdim
33360784Sdim  DeclVendorKind GetKind() const { return m_kind; }
34360784Sdim
35314564Sdim  /// Look up the set of Decls that the DeclVendor currently knows about
36314564Sdim  /// matching a given name.
37314564Sdim  ///
38353358Sdim  /// \param[in] name
39314564Sdim  ///     The name to look for.
40314564Sdim  ///
41353358Sdim  /// \param[in] append
42314564Sdim  ///     If true, FindDecls will clear "decls" when it starts.
43314564Sdim  ///
44353358Sdim  /// \param[in] max_matches
45314564Sdim  ///     The maximum number of Decls to return.  UINT32_MAX means "as
46314564Sdim  ///     many as possible."
47314564Sdim  ///
48353358Sdim  /// \return
49314564Sdim  ///     The number of Decls added to decls; will not exceed
50314564Sdim  ///     max_matches.
51353358Sdim  virtual uint32_t FindDecls(ConstString name, bool append,
52314564Sdim                             uint32_t max_matches,
53360784Sdim                             std::vector<CompilerDecl> &decls) = 0;
54314564Sdim
55353358Sdim  /// Look up the types that the DeclVendor currently knows about matching a
56353358Sdim  /// given name.
57353358Sdim  ///
58353358Sdim  /// \param[in] name
59353358Sdim  ///     The name to look for.
60353358Sdim  ///
61353358Sdim  /// \param[in] max_matches
62353358Sdim  //      The maximum number of matches. UINT32_MAX means "as many as possible".
63353358Sdim  ///
64353358Sdim  /// \return
65353358Sdim  ///     The vector of CompilerTypes that was found.
66353358Sdim  std::vector<CompilerType> FindTypes(ConstString name, uint32_t max_matches);
67353358Sdim
68278332Semasteprivate:
69314564Sdim  // For DeclVendor only
70314564Sdim  DISALLOW_COPY_AND_ASSIGN(DeclVendor);
71360784Sdim
72360784Sdim  const DeclVendorKind m_kind;
73278332Semaste};
74314564Sdim
75278332Semaste} // namespace lldb_private
76278332Semaste
77278332Semaste#endif
78