xref: /freebsd/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 //===-- DWARFASTParserClang.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_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFASTPARSERCLANG_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFASTPARSERCLANG_H
11 
12 #include "clang/AST/CharUnits.h"
13 #include "clang/AST/Type.h"
14 #include "llvm/ADT/DenseMap.h"
15 #include "llvm/ADT/SmallPtrSet.h"
16 #include "llvm/ADT/SmallVector.h"
17 
18 #include "DWARFASTParser.h"
19 #include "DWARFDIE.h"
20 #include "DWARFDefines.h"
21 #include "DWARFFormValue.h"
22 #include "LogChannelDWARF.h"
23 #include "lldb/Core/PluginInterface.h"
24 
25 #include "Plugins/ExpressionParser/Clang/ClangASTImporter.h"
26 #include "Plugins/Language/ObjC/ObjCLanguage.h"
27 #include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
28 
29 #include <optional>
30 #include <vector>
31 
32 namespace lldb_private {
33 class CompileUnit;
34 }
35 namespace lldb_private::plugin {
36 namespace dwarf {
37 class DWARFDebugInfoEntry;
38 class SymbolFileDWARF;
39 } // namespace dwarf
40 } // namespace lldb_private::plugin
41 
42 struct ParsedDWARFTypeAttributes;
43 
44 class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {
45 public:
46   DWARFASTParserClang(lldb_private::TypeSystemClang &ast);
47 
48   ~DWARFASTParserClang() override;
49 
50   // DWARFASTParser interface.
51   lldb::TypeSP
52   ParseTypeFromDWARF(const lldb_private::SymbolContext &sc,
53                      const lldb_private::plugin::dwarf::DWARFDIE &die,
54                      bool *type_is_new_ptr) override;
55 
56   lldb_private::ConstString ConstructDemangledNameFromDWARF(
57       const lldb_private::plugin::dwarf::DWARFDIE &die) override;
58 
59   lldb_private::Function *
60   ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit,
61                          const lldb_private::plugin::dwarf::DWARFDIE &die,
62                          const lldb_private::AddressRange &func_range) override;
63 
64   bool
65   CompleteTypeFromDWARF(const lldb_private::plugin::dwarf::DWARFDIE &die,
66                         lldb_private::Type *type,
67                         lldb_private::CompilerType &compiler_type) override;
68 
69   lldb_private::CompilerDecl GetDeclForUIDFromDWARF(
70       const lldb_private::plugin::dwarf::DWARFDIE &die) override;
71 
72   void EnsureAllDIEsInDeclContextHaveBeenParsed(
73       lldb_private::CompilerDeclContext decl_context) override;
74 
75   lldb_private::CompilerDeclContext GetDeclContextForUIDFromDWARF(
76       const lldb_private::plugin::dwarf::DWARFDIE &die) override;
77 
78   lldb_private::CompilerDeclContext GetDeclContextContainingUIDFromDWARF(
79       const lldb_private::plugin::dwarf::DWARFDIE &die) override;
80 
81   lldb_private::ClangASTImporter &GetClangASTImporter();
82 
83   /// Extracts an value for a given Clang integer type from a DWARFFormValue.
84   ///
85   /// \param int_type The Clang type that defines the bit size and signedness
86   ///                 of the integer that should be extracted. Has to be either
87   ///                 an integer type or an enum type. For enum types the
88   ///                 underlying integer type will be considered as the
89   ///                 expected integer type that should be extracted.
90   /// \param form_value The DWARFFormValue that contains the integer value.
91   /// \return An APInt containing the same integer value as the given
92   ///         DWARFFormValue with the bit width of the given integer type.
93   ///         Returns an error if the value in the DWARFFormValue does not fit
94   ///         into the given integer type or the integer type isn't supported.
95   llvm::Expected<llvm::APInt> ExtractIntFromFormValue(
96       const lldb_private::CompilerType &int_type,
97       const lldb_private::plugin::dwarf::DWARFFormValue &form_value) const;
98 
99   /// Returns the template parameters of a class DWARFDIE as a string.
100   ///
101   /// This is mostly useful for -gsimple-template-names which omits template
102   /// parameters from the DIE name and instead always adds template parameter
103   /// children DIEs.
104   ///
105   /// \param die The struct/class DWARFDIE containing template parameters.
106   /// \return A string, including surrounding '<>', of the template parameters.
107   /// If the DIE's name already has '<>', returns an empty string because
108   /// it's assumed that the caller is using the DIE name anyway.
109   std::string GetDIEClassTemplateParams(
110       const lldb_private::plugin::dwarf::DWARFDIE &die) override;
111 
112   void MapDeclDIEToDefDIE(const lldb_private::plugin::dwarf::DWARFDIE &decl_die,
113                           const lldb_private::plugin::dwarf::DWARFDIE &def_die);
114 
115 protected:
116   /// Protected typedefs and members.
117   /// @{
118   class DelayedAddObjCClassProperty;
119   typedef std::vector<DelayedAddObjCClassProperty> DelayedPropertyList;
120 
121   typedef llvm::DenseMap<
122       const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *,
123       clang::DeclContext *>
124       DIEToDeclContextMap;
125   typedef std::multimap<const clang::DeclContext *,
126                         const lldb_private::plugin::dwarf::DWARFDIE>
127       DeclContextToDIEMap;
128   typedef llvm::DenseMap<
129       const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *,
130       lldb_private::OptionalClangModuleID>
131       DIEToModuleMap;
132   typedef llvm::DenseMap<
133       const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *, clang::Decl *>
134       DIEToDeclMap;
135 
136   lldb_private::TypeSystemClang &m_ast;
137   DIEToDeclMap m_die_to_decl;
138   DIEToDeclContextMap m_die_to_decl_ctx;
139   DeclContextToDIEMap m_decl_ctx_to_die;
140   DIEToModuleMap m_die_to_module;
141   std::unique_ptr<lldb_private::ClangASTImporter> m_clang_ast_importer_up;
142   /// @}
143 
144   clang::DeclContext *
145   GetDeclContextForBlock(const lldb_private::plugin::dwarf::DWARFDIE &die);
146 
147   clang::BlockDecl *
148   ResolveBlockDIE(const lldb_private::plugin::dwarf::DWARFDIE &die);
149 
150   clang::NamespaceDecl *
151   ResolveNamespaceDIE(const lldb_private::plugin::dwarf::DWARFDIE &die);
152 
153   /// Returns the namespace decl that a DW_TAG_imported_declaration imports.
154   ///
155   /// \param[in] die The import declaration to resolve. If the DIE is not a
156   ///                DW_TAG_imported_declaration the behaviour is undefined.
157   ///
158   /// \returns The decl corresponding to the namespace that the specified
159   ///          'die' imports. If the imported entity is not a namespace
160   ///          or another import declaration, returns nullptr. If an error
161   ///          occurs, returns nullptr.
162   clang::NamespaceDecl *ResolveImportedDeclarationDIE(
163       const lldb_private::plugin::dwarf::DWARFDIE &die);
164 
165   bool ParseTemplateDIE(const lldb_private::plugin::dwarf::DWARFDIE &die,
166                         lldb_private::TypeSystemClang::TemplateParameterInfos
167                             &template_param_infos);
168 
169   bool ParseTemplateParameterInfos(
170       const lldb_private::plugin::dwarf::DWARFDIE &parent_die,
171       lldb_private::TypeSystemClang::TemplateParameterInfos
172           &template_param_infos);
173 
174   void GetUniqueTypeNameAndDeclaration(
175       const lldb_private::plugin::dwarf::DWARFDIE &die,
176       lldb::LanguageType language, lldb_private::ConstString &unique_typename,
177       lldb_private::Declaration &decl_declaration);
178 
179   bool ParseChildMembers(
180       const lldb_private::plugin::dwarf::DWARFDIE &die,
181       lldb_private::CompilerType &class_compiler_type,
182       std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
183       std::vector<lldb_private::plugin::dwarf::DWARFDIE> &member_function_dies,
184       std::vector<lldb_private::plugin::dwarf::DWARFDIE> &contained_type_dies,
185       DelayedPropertyList &delayed_properties,
186       const lldb::AccessType default_accessibility,
187       lldb_private::ClangASTImporter::LayoutInfo &layout_info);
188 
189   size_t
190   ParseChildParameters(clang::DeclContext *containing_decl_ctx,
191                        const lldb_private::plugin::dwarf::DWARFDIE &parent_die,
192                        bool skip_artificial, bool &is_static, bool &is_variadic,
193                        bool &has_template_params,
194                        std::vector<lldb_private::CompilerType> &function_args,
195                        std::vector<clang::ParmVarDecl *> &function_param_decls,
196                        unsigned &type_quals);
197 
198   size_t ParseChildEnumerators(
199       lldb_private::CompilerType &compiler_type, bool is_signed,
200       uint32_t enumerator_byte_size,
201       const lldb_private::plugin::dwarf::DWARFDIE &parent_die);
202 
203   /// Parse a structure, class, or union type DIE.
204   lldb::TypeSP
205   ParseStructureLikeDIE(const lldb_private::SymbolContext &sc,
206                         const lldb_private::plugin::dwarf::DWARFDIE &die,
207                         ParsedDWARFTypeAttributes &attrs);
208 
209   clang::Decl *
210   GetClangDeclForDIE(const lldb_private::plugin::dwarf::DWARFDIE &die);
211 
212   clang::DeclContext *
213   GetClangDeclContextForDIE(const lldb_private::plugin::dwarf::DWARFDIE &die);
214 
215   clang::DeclContext *GetClangDeclContextContainingDIE(
216       const lldb_private::plugin::dwarf::DWARFDIE &die,
217       lldb_private::plugin::dwarf::DWARFDIE *decl_ctx_die);
218   lldb_private::OptionalClangModuleID
219   GetOwningClangModule(const lldb_private::plugin::dwarf::DWARFDIE &die);
220 
221   bool CopyUniqueClassMethodTypes(
222       const lldb_private::plugin::dwarf::DWARFDIE &src_class_die,
223       const lldb_private::plugin::dwarf::DWARFDIE &dst_class_die,
224       lldb_private::Type *class_type,
225       std::vector<lldb_private::plugin::dwarf::DWARFDIE> &failures);
226 
227   clang::DeclContext *GetCachedClangDeclContextForDIE(
228       const lldb_private::plugin::dwarf::DWARFDIE &die);
229 
230   void LinkDeclContextToDIE(clang::DeclContext *decl_ctx,
231                             const lldb_private::plugin::dwarf::DWARFDIE &die);
232 
233   void LinkDeclToDIE(clang::Decl *decl,
234                      const lldb_private::plugin::dwarf::DWARFDIE &die);
235 
236   /// If \p type_sp is valid, calculate and set its symbol context scope, and
237   /// update the type list for its backing symbol file.
238   ///
239   /// Returns \p type_sp.
240   lldb::TypeSP UpdateSymbolContextScopeForType(
241       const lldb_private::SymbolContext &sc,
242       const lldb_private::plugin::dwarf::DWARFDIE &die, lldb::TypeSP type_sp);
243 
244   /// Follow Clang Module Skeleton CU references to find a type definition.
245   lldb::TypeSP
246   ParseTypeFromClangModule(const lldb_private::SymbolContext &sc,
247                            const lldb_private::plugin::dwarf::DWARFDIE &die,
248                            lldb_private::Log *log);
249 
250   // Return true if this type is a declaration to a type in an external
251   // module.
252   lldb::ModuleSP
253   GetModuleForType(const lldb_private::plugin::dwarf::DWARFDIE &die);
254 
classof(const DWARFASTParser * Parser)255   static bool classof(const DWARFASTParser *Parser) {
256     return Parser->GetKind() == Kind::DWARFASTParserClang;
257   }
258 
259 private:
260   struct FieldInfo {
261     uint64_t bit_size = 0;
262     uint64_t bit_offset = 0;
263     bool is_bitfield = false;
264     bool is_artificial = false;
265 
266     FieldInfo() = default;
267 
SetIsBitfieldFieldInfo268     void SetIsBitfield(bool flag) { is_bitfield = flag; }
IsBitfieldFieldInfo269     bool IsBitfield() { return is_bitfield; }
270 
SetIsArtificialFieldInfo271     void SetIsArtificial(bool flag) { is_artificial = flag; }
IsArtificialFieldInfo272     bool IsArtificial() const { return is_artificial; }
273 
NextBitfieldOffsetIsValidFieldInfo274     bool NextBitfieldOffsetIsValid(const uint64_t next_bit_offset) const {
275       // Any subsequent bitfields must not overlap and must be at a higher
276       // bit offset than any previous bitfield + size.
277       return (bit_size + bit_offset) <= next_bit_offset;
278     }
279   };
280 
281   /// Parsed form of all attributes that are relevant for parsing type members.
282   struct MemberAttributes {
283     explicit MemberAttributes(
284         const lldb_private::plugin::dwarf::DWARFDIE &die,
285         const lldb_private::plugin::dwarf::DWARFDIE &parent_die,
286         lldb::ModuleSP module_sp);
287     const char *name = nullptr;
288     /// Indicates how many bits into the word (according to the host endianness)
289     /// the low-order bit of the field starts. Can be negative.
290     int64_t bit_offset = 0;
291     /// Indicates the size of the field in bits.
292     size_t bit_size = 0;
293     uint64_t data_bit_offset = UINT64_MAX;
294     lldb::AccessType accessibility = lldb::eAccessNone;
295     std::optional<uint64_t> byte_size;
296     std::optional<lldb_private::plugin::dwarf::DWARFFormValue> const_value_form;
297     lldb_private::plugin::dwarf::DWARFFormValue encoding_form;
298     /// Indicates the byte offset of the word from the base address of the
299     /// structure.
300     uint32_t member_byte_offset = UINT32_MAX;
301     bool is_artificial = false;
302     bool is_declaration = false;
303   };
304 
305   /// Returns 'true' if we should create an unnamed bitfield
306   /// and add it to the parser's current AST.
307   ///
308   /// \param[in] last_field_info FieldInfo of the previous DW_TAG_member
309   ///            we parsed.
310   /// \param[in] last_field_end Offset (in bits) where the last parsed field
311   ///            ended.
312   /// \param[in] this_field_info FieldInfo of the current DW_TAG_member
313   ///            being parsed.
314   /// \param[in] layout_info Layout information of all decls parsed by the
315   ///            current parser.
316   bool ShouldCreateUnnamedBitfield(
317       FieldInfo const &last_field_info, uint64_t last_field_end,
318       FieldInfo const &this_field_info,
319       lldb_private::ClangASTImporter::LayoutInfo const &layout_info) const;
320 
321   /// Parses a DW_TAG_APPLE_property DIE and appends the parsed data to the
322   /// list of delayed Objective-C properties.
323   ///
324   /// Note: The delayed property needs to be finalized to actually create the
325   /// property declarations in the module AST.
326   ///
327   /// \param die The DW_TAG_APPLE_property DIE that will be parsed.
328   /// \param parent_die The parent DIE.
329   /// \param class_clang_type The Objective-C class that will contain the
330   /// created property.
331   /// \param delayed_properties The list of delayed properties that the result
332   /// will be appended to.
333   void
334   ParseObjCProperty(const lldb_private::plugin::dwarf::DWARFDIE &die,
335                     const lldb_private::plugin::dwarf::DWARFDIE &parent_die,
336                     const lldb_private::CompilerType &class_clang_type,
337                     DelayedPropertyList &delayed_properties);
338 
339   void
340   ParseSingleMember(const lldb_private::plugin::dwarf::DWARFDIE &die,
341                     const lldb_private::plugin::dwarf::DWARFDIE &parent_die,
342                     const lldb_private::CompilerType &class_clang_type,
343                     lldb::AccessType default_accessibility,
344                     lldb_private::ClangASTImporter::LayoutInfo &layout_info,
345                     FieldInfo &last_field_info);
346 
347   /// If the specified 'die' represents a static data member, creates
348   /// a 'clang::VarDecl' for it and attaches it to specified parent
349   /// 'class_clang_type'.
350   ///
351   /// \param[in] die The member declaration we want to create a
352   ///                clang::VarDecl for.
353   ///
354   /// \param[in] attrs The parsed attributes for the specified 'die'.
355   ///
356   /// \param[in] class_clang_type The parent RecordType of the static
357   ///                             member this function will create.
358   void CreateStaticMemberVariable(
359       const lldb_private::plugin::dwarf::DWARFDIE &die,
360       const MemberAttributes &attrs,
361       const lldb_private::CompilerType &class_clang_type);
362 
363   bool CompleteRecordType(const lldb_private::plugin::dwarf::DWARFDIE &die,
364                           lldb_private::Type *type,
365                           lldb_private::CompilerType &clang_type);
366   bool CompleteEnumType(const lldb_private::plugin::dwarf::DWARFDIE &die,
367                         lldb_private::Type *type,
368                         lldb_private::CompilerType &clang_type);
369 
370   lldb::TypeSP
371   ParseTypeModifier(const lldb_private::SymbolContext &sc,
372                     const lldb_private::plugin::dwarf::DWARFDIE &die,
373                     ParsedDWARFTypeAttributes &attrs);
374   lldb::TypeSP ParseEnum(const lldb_private::SymbolContext &sc,
375                          const lldb_private::plugin::dwarf::DWARFDIE &die,
376                          ParsedDWARFTypeAttributes &attrs);
377   lldb::TypeSP ParseSubroutine(const lldb_private::plugin::dwarf::DWARFDIE &die,
378                                const ParsedDWARFTypeAttributes &attrs);
379 
380   /// Helper function called by \ref ParseSubroutine when parsing ObjC-methods.
381   ///
382   /// \param[in] objc_method Name of the ObjC method being parsed.
383   ///
384   /// \param[in] die The DIE that represents the ObjC method being parsed.
385   ///
386   /// \param[in] clang_type The CompilerType representing the function prototype
387   ///                       of the ObjC method being parsed.
388   ///
389   /// \param[in] attrs DWARF attributes for \ref die.
390   ///
391   /// \param[in] is_variadic Is true iff we're parsing a variadic method.
392   ///
393   /// \returns true on success
394   bool
395   ParseObjCMethod(const lldb_private::ObjCLanguage::MethodName &objc_method,
396                   const lldb_private::plugin::dwarf::DWARFDIE &die,
397                   lldb_private::CompilerType clang_type,
398                   const ParsedDWARFTypeAttributes &attrs, bool is_variadic);
399 
400   /// Helper function called by \ref ParseSubroutine when parsing C++ methods.
401   ///
402   /// \param[in] die The DIE that represents the C++ method being parsed.
403   ///
404   /// \param[in] clang_type The CompilerType representing the function prototype
405   ///                       of the C++ method being parsed.
406   ///
407   /// \param[in] attrs DWARF attributes for \ref die.
408   ///
409   /// \param[in] decl_ctx_die The DIE representing the DeclContext of the C++
410   ///                         method being parsed.
411   ///
412   /// \param[in] is_static Is true iff we're parsing a static method.
413   ///
414   /// \param[out] ignore_containing_context Will get set to true if the caller
415   ///             should treat this C++ method as-if it was not a C++ method.
416   ///             Currently used as a hack to work around templated C++ methods
417   ///             causing class definitions to mismatch between CUs.
418   ///
419   /// \returns A pair of <bool, TypeSP>. The first element is 'true' on success.
420   ///          The second element is non-null if we have previously parsed this
421   ///          method (a null TypeSP does not indicate failure).
422   std::pair<bool, lldb::TypeSP>
423   ParseCXXMethod(const lldb_private::plugin::dwarf::DWARFDIE &die,
424                  lldb_private::CompilerType clang_type,
425                  const ParsedDWARFTypeAttributes &attrs,
426                  const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die,
427                  bool is_static, bool &ignore_containing_context);
428 
429   lldb::TypeSP ParseArrayType(const lldb_private::plugin::dwarf::DWARFDIE &die,
430                               const ParsedDWARFTypeAttributes &attrs);
431   lldb::TypeSP
432   ParsePointerToMemberType(const lldb_private::plugin::dwarf::DWARFDIE &die,
433                            const ParsedDWARFTypeAttributes &attrs);
434 
435   /// Parses a DW_TAG_inheritance DIE into a base/super class.
436   ///
437   /// \param die The DW_TAG_inheritance DIE to parse.
438   /// \param parent_die The parent DIE of the given DIE.
439   /// \param class_clang_type The C++/Objective-C class representing parent_die.
440   /// For an Objective-C class this method sets the super class on success. For
441   /// a C++ class this will *not* add the result as a base class.
442   /// \param default_accessibility The default accessibility that is given to
443   /// base classes if they don't have an explicit accessibility set.
444   /// \param module_sp The current Module.
445   /// \param base_classes The list of C++ base classes that will be appended
446   /// with the parsed base class on success.
447   /// \param layout_info The layout information that will be updated for C++
448   /// base classes with the base offset.
449   void ParseInheritance(
450       const lldb_private::plugin::dwarf::DWARFDIE &die,
451       const lldb_private::plugin::dwarf::DWARFDIE &parent_die,
452       const lldb_private::CompilerType class_clang_type,
453       const lldb::AccessType default_accessibility,
454       const lldb::ModuleSP &module_sp,
455       std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
456       lldb_private::ClangASTImporter::LayoutInfo &layout_info);
457 
458   /// Parses DW_TAG_variant_part DIE into a structure that encodes all variants
459   /// Note that this is currently being emitted by rustc and not Clang
460   /// \param die DW_TAG_variant_part DIE to parse
461   /// \param parent_die The parent DW_TAG_structure_type to parse
462   /// \param class_clang_type The Rust struct representing parent_die.
463   /// \param default_accesibility The default accessibility that is given to
464   ///  base classes if they don't have an explicit accessibility set
465   /// \param layout_info The layout information that will be updated for
466   //   base classes with the base offset
467   void
468   ParseRustVariantPart(lldb_private::plugin::dwarf::DWARFDIE &die,
469                        const lldb_private::plugin::dwarf::DWARFDIE &parent_die,
470                        lldb_private::CompilerType &class_clang_type,
471                        const lldb::AccessType default_accesibility,
472                        lldb_private::ClangASTImporter::LayoutInfo &layout_info);
473 };
474 
475 /// Parsed form of all attributes that are relevant for type reconstruction.
476 /// Some attributes are relevant for all kinds of types (declaration), while
477 /// others are only meaningful to a specific type (is_virtual)
478 struct ParsedDWARFTypeAttributes {
479   explicit ParsedDWARFTypeAttributes(
480       const lldb_private::plugin::dwarf::DWARFDIE &die);
481 
482   lldb::AccessType accessibility = lldb::eAccessNone;
483   bool is_artificial = false;
484   bool is_complete_objc_class = false;
485   bool is_explicit = false;
486   bool is_forward_declaration = false;
487   bool is_inline = false;
488   bool is_scoped_enum = false;
489   bool is_vector = false;
490   bool is_virtual = false;
491   bool is_objc_direct_call = false;
492   bool exports_symbols = false;
493   clang::StorageClass storage = clang::SC_None;
494   const char *mangled_name = nullptr;
495   lldb_private::ConstString name;
496   lldb_private::Declaration decl;
497   lldb_private::plugin::dwarf::DWARFDIE object_pointer;
498   lldb_private::plugin::dwarf::DWARFFormValue abstract_origin;
499   lldb_private::plugin::dwarf::DWARFFormValue containing_type;
500   lldb_private::plugin::dwarf::DWARFFormValue signature;
501   lldb_private::plugin::dwarf::DWARFFormValue specification;
502   lldb_private::plugin::dwarf::DWARFFormValue type;
503   lldb::LanguageType class_language = lldb::eLanguageTypeUnknown;
504   std::optional<uint64_t> byte_size;
505   std::optional<uint64_t> alignment;
506   size_t calling_convention = llvm::dwarf::DW_CC_normal;
507   uint32_t bit_stride = 0;
508   uint32_t byte_stride = 0;
509   uint32_t encoding = 0;
510   clang::RefQualifierKind ref_qual =
511       clang::RQ_None; ///< Indicates ref-qualifier of
512                       ///< C++ member function if present.
513                       ///< Is RQ_None otherwise.
514 };
515 
516 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFASTPARSERCLANG_H
517