Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:51

0001 //===-- DeclVendor.h --------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_SYMBOL_DECLVENDOR_H
0010 #define LLDB_SYMBOL_DECLVENDOR_H
0011 
0012 #include "lldb/lldb-defines.h"
0013 
0014 #include <vector>
0015 
0016 namespace lldb_private {
0017 
0018 // The Decl vendor class is intended as a generic interface to search for named
0019 // declarations that are not necessarily backed by a specific symbol file.
0020 class DeclVendor {
0021 public:
0022   enum DeclVendorKind {
0023     eClangDeclVendor,
0024     eClangModuleDeclVendor,
0025     eAppleObjCDeclVendor,
0026     eLastClangDeclVendor,
0027   };
0028   // Constructors and Destructors
0029   DeclVendor(DeclVendorKind kind) : m_kind(kind) {}
0030 
0031   virtual ~DeclVendor() = default;
0032 
0033   DeclVendorKind GetKind() const { return m_kind; }
0034 
0035   /// Look up the set of Decls that the DeclVendor currently knows about
0036   /// matching a given name.
0037   ///
0038   /// \param[in] name
0039   ///     The name to look for.
0040   ///
0041   /// \param[in] append
0042   ///     If true, FindDecls will clear "decls" when it starts.
0043   ///
0044   /// \param[in] max_matches
0045   ///     The maximum number of Decls to return.  UINT32_MAX means "as
0046   ///     many as possible."
0047   ///
0048   /// \return
0049   ///     The number of Decls added to decls; will not exceed
0050   ///     max_matches.
0051   virtual uint32_t FindDecls(ConstString name, bool append,
0052                              uint32_t max_matches,
0053                              std::vector<CompilerDecl> &decls) = 0;
0054 
0055   /// Look up the types that the DeclVendor currently knows about matching a
0056   /// given name.
0057   ///
0058   /// \param[in] name
0059   ///     The name to look for.
0060   ///
0061   /// \param[in] max_matches
0062   //      The maximum number of matches. UINT32_MAX means "as many as possible".
0063   ///
0064   /// \return
0065   ///     The vector of CompilerTypes that was found.
0066   std::vector<CompilerType> FindTypes(ConstString name, uint32_t max_matches);
0067 
0068 private:
0069   // For DeclVendor only
0070   DeclVendor(const DeclVendor &) = delete;
0071   const DeclVendor &operator=(const DeclVendor &) = delete;
0072 
0073   const DeclVendorKind m_kind;
0074 };
0075 
0076 } // namespace lldb_private
0077 
0078 #endif