LLDB mainline
DWARFASTParserClang.h
Go to the documentation of this file.
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"
24
28
29#include <optional>
30#include <vector>
31
32namespace lldb_private {
33class CompileUnit;
34}
35namespace lldb_private::plugin {
36namespace dwarf {
38class SymbolFileDWARF;
39} // namespace dwarf
40} // namespace lldb_private::plugin
41
43
45public:
47
49
50 // LLVM RTTI support
51 static bool classof(const DWARFASTParser *Parser) {
52 return Parser->GetKind() == Kind::DWARFASTParserClang;
53 }
54
55 // DWARFASTParser interface.
59 bool *type_is_new_ptr) override;
60
62 const lldb_private::plugin::dwarf::DWARFDIE &die) override;
63
67 lldb_private::AddressRanges func_ranges) override;
68
72 const lldb_private::CompilerType &compiler_type) override;
73
75 const lldb_private::plugin::dwarf::DWARFDIE &die) override;
76
78 lldb_private::CompilerDeclContext decl_context) override;
79
81 const lldb_private::plugin::dwarf::DWARFDIE &die) override;
82
84 const lldb_private::plugin::dwarf::DWARFDIE &die) override;
85
87
88 /// Extracts an value for a given Clang integer type from a DWARFFormValue.
89 ///
90 /// \param int_type The Clang type that defines the bit size and signedness
91 /// of the integer that should be extracted. Has to be either
92 /// an integer type or an enum type. For enum types the
93 /// underlying integer type will be considered as the
94 /// expected integer type that should be extracted.
95 /// \param form_value The DWARFFormValue that contains the integer value.
96 /// \return An APInt containing the same integer value as the given
97 /// DWARFFormValue with the bit width of the given integer type.
98 /// Returns an error if the value in the DWARFFormValue does not fit
99 /// into the given integer type or the integer type isn't supported.
100 llvm::Expected<llvm::APInt> ExtractIntFromFormValue(
101 const lldb_private::CompilerType &int_type,
102 const lldb_private::plugin::dwarf::DWARFFormValue &form_value) const;
103
104 /// Returns the template parameters of a class DWARFDIE as a string.
105 ///
106 /// This is mostly useful for -gsimple-template-names which omits template
107 /// parameters from the DIE name and instead always adds template parameter
108 /// children DIEs.
109 ///
110 /// \param die The struct/class DWARFDIE containing template parameters.
111 /// \return A string, including surrounding '<>', of the template parameters.
112 /// If the DIE's name already has '<>', returns an empty string because
113 /// it's assumed that the caller is using the DIE name anyway.
114 std::string
116
119
120 /// Get the object parameter DIE if one exists, otherwise returns
121 /// a default DWARFDIE.
122 ///
123 /// \param[in] subprogram DIE of function for which to get the object
124 /// parameter. \param[in] containing_decl_ctx DIE representing declaration
125 /// context of \a subprogram. If this DIE isn't a valid declaration context
126 /// for class methods, assume no object parameter exists.
127 ///
128 /// \returns DIE of object parameter if one exists.
129 ///
132 const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die);
133
134protected:
135 /// Protected typedefs and members.
136 /// @{
137 class DelayedAddObjCClassProperty;
138 typedef std::vector<DelayedAddObjCClassProperty> DelayedPropertyList;
139
140 typedef llvm::DenseMap<
142 clang::DeclContext *>
144 typedef std::multimap<const clang::DeclContext *,
147 typedef llvm::DenseMap<
151 typedef llvm::DenseMap<
154
160 std::unique_ptr<lldb_private::ClangASTImporter> m_clang_ast_importer_up;
161 /// @}
162
163 clang::DeclContext *
165
166 clang::BlockDecl *
168
169 clang::NamespaceDecl *
171
172 /// Returns the namespace decl that a DW_TAG_imported_declaration imports.
173 ///
174 /// \param[in] die The import declaration to resolve. If the DIE is not a
175 /// DW_TAG_imported_declaration the behaviour is undefined.
176 ///
177 /// \returns The decl corresponding to the namespace that the specified
178 /// 'die' imports. If the imported entity is not a namespace
179 /// or another import declaration, returns nullptr. If an error
180 /// occurs, returns nullptr.
181 clang::NamespaceDecl *ResolveImportedDeclarationDIE(
183
186 &template_param_infos);
187
191 &template_param_infos);
192
195 lldb::LanguageType language, lldb_private::ConstString &unique_typename,
196 lldb_private::Declaration &decl_declaration);
197
200 const lldb_private::CompilerType &class_compiler_type,
201 std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
202 std::vector<lldb_private::plugin::dwarf::DWARFDIE> &member_function_dies,
203 std::vector<lldb_private::plugin::dwarf::DWARFDIE> &contained_type_dies,
204 DelayedPropertyList &delayed_properties,
206
208 clang::DeclContext *containing_decl_ctx,
210 bool &is_variadic, bool &has_template_params,
211 std::vector<lldb_private::CompilerType> &function_param_types,
212 llvm::SmallVectorImpl<llvm::StringRef> &function_param_names);
213
215 const lldb_private::CompilerType &compiler_type, bool is_signed,
216 uint32_t enumerator_byte_size,
217 const lldb_private::plugin::dwarf::DWARFDIE &parent_die);
218
219 /// Parse a structure, class, or union type DIE.
223 const ParsedDWARFTypeAttributes &attrs);
224
225 clang::Decl *
227
228 clang::DeclContext *
230
231 clang::DeclContext *GetClangDeclContextContainingDIE(
236
238 const lldb_private::plugin::dwarf::DWARFDIE &src_class_die,
239 const lldb_private::plugin::dwarf::DWARFDIE &dst_class_die,
240 lldb_private::Type *class_type,
241 std::vector<lldb_private::plugin::dwarf::DWARFDIE> &failures);
242
243 clang::DeclContext *GetCachedClangDeclContextForDIE(
245
246 void LinkDeclContextToDIE(clang::DeclContext *decl_ctx,
248
249 void LinkDeclToDIE(clang::Decl *decl,
251
252 /// If \p type_sp is valid, calculate and set its symbol context scope, and
253 /// update the type list for its backing symbol file.
254 ///
255 /// Returns \p type_sp.
259
260 /// Follow Clang Module Skeleton CU references to find a type definition.
264 lldb_private::Log *log);
265
266 // Return true if this type is a declaration to a type in an external
267 // module.
270
271private:
272 struct FieldInfo {
273 /// Size in bits that this field occupies. Can but
274 /// need not be the DW_AT_bit_size of the field.
275 uint64_t bit_size = 0;
276
277 /// Offset of this field in bits from the beginning
278 /// of the containing struct. Can but need not
279 /// be the DW_AT_data_bit_offset of the field.
280 uint64_t bit_offset = 0;
281
282 /// In case this field is folded into the storage
283 /// of a previous member's storage (for example
284 /// with [[no_unique_address]]), the effective field
285 /// end is the offset in bits from the beginning of
286 /// the containing struct where the field we were
287 /// folded into ended.
288 std::optional<uint64_t> effective_field_end;
289
290 /// Set to 'true' if this field is a bit-field.
291 bool is_bitfield = false;
292
293 /// Set to 'true' if this field is DW_AT_artificial.
294 bool is_artificial = false;
295
296 FieldInfo() = default;
297
298 void SetIsBitfield(bool flag) { is_bitfield = flag; }
299 bool IsBitfield() const { return is_bitfield; }
300
301 void SetIsArtificial(bool flag) { is_artificial = flag; }
302 bool IsArtificial() const { return is_artificial; }
303
304 bool NextBitfieldOffsetIsValid(const uint64_t next_bit_offset) const {
305 // Any subsequent bitfields must not overlap and must be at a higher
306 // bit offset than any previous bitfield + size.
307 return (bit_size + bit_offset) <= next_bit_offset;
308 }
309
310 /// Returns the offset in bits of where the storage this field
311 /// occupies ends.
312 uint64_t GetFieldEnd() const { return bit_size + bit_offset; }
313
314 void SetEffectiveFieldEnd(uint64_t val) { effective_field_end = val; }
315
316 /// If this field was folded into storage of a previous field,
317 /// returns the offset in bits of where that storage ends. Otherwise,
318 /// returns the regular field end (see \ref GetFieldEnd).
319 uint64_t GetEffectiveFieldEnd() const {
320 return effective_field_end.value_or(GetFieldEnd());
321 }
322 };
323
324 /// Parsed form of all attributes that are relevant for parsing type members.
326 explicit MemberAttributes(
329 lldb::ModuleSP module_sp);
330 const char *name = nullptr;
331 /// Indicates how many bits into the word (according to the host endianness)
332 /// the low-order bit of the field starts. Can be negative.
333 int64_t bit_offset = 0;
334 /// Indicates the size of the field in bits.
335 size_t bit_size = 0;
337 std::optional<uint64_t> byte_size;
338 std::optional<lldb_private::plugin::dwarf::DWARFFormValue> const_value_form;
340 /// Indicates the byte offset of the word from the base address of the
341 /// structure.
343 bool is_artificial = false;
344 bool is_declaration = false;
345 };
346
347 /// Returns 'true' if we should create an unnamed bitfield
348 /// and add it to the parser's current AST.
349 ///
350 /// \param[in] last_field_info FieldInfo of the previous DW_TAG_member
351 /// we parsed.
352 /// \param[in] last_field_end Offset (in bits) where the last parsed field
353 /// ended.
354 /// \param[in] this_field_info FieldInfo of the current DW_TAG_member
355 /// being parsed.
356 /// \param[in] layout_info Layout information of all decls parsed by the
357 /// current parser.
359 FieldInfo const &last_field_info, uint64_t last_field_end,
360 FieldInfo const &this_field_info,
361 lldb_private::ClangASTImporter::LayoutInfo const &layout_info) const;
362
363 /// Tries to detect whether \ref class_clang_type contained an unnamed
364 /// bit-field between \ref previous_field and \ref current_field, and if
365 /// so, adds a clang::FieldDecl representing that bit-field to
366 /// \ref class_clang_type.
367 ///
368 /// This is necessary because Clang (and GCC) doesn't emit a DW_TAG_member
369 /// entry for unnamed bit-fields. So we derive it (with some exceptions),
370 /// by checking whether there is a gap between where the storage of a
371 /// DW_TAG_member ended and the subsequent DW_TAG_member began.
372 ///
373 /// \param[in,out] layout_info Layout information of all decls parsed by the
374 /// current parser. Will contain an entry for
375 /// the unnamed bit-field if this function created
376 /// one.
377 ///
378 /// \param[in] class_clang_type The RecordType to which the unnamed bit-field
379 /// will be added (if any).
380 ///
381 /// \param[in] previous_field FieldInfo of the previous DW_TAG_member
382 /// we parsed.
383 ///
384 /// \param[in] current_field FieldInfo of the current DW_TAG_member
385 /// being parsed.
386 ///
389 const lldb_private::CompilerType &class_clang_type,
390 const FieldInfo &previous_field, const FieldInfo &current_field);
391
392 /// Parses a DW_TAG_APPLE_property DIE and appends the parsed data to the
393 /// list of delayed Objective-C properties.
394 ///
395 /// Note: The delayed property needs to be finalized to actually create the
396 /// property declarations in the module AST.
397 ///
398 /// \param die The DW_TAG_APPLE_property DIE that will be parsed.
399 /// \param parent_die The parent DIE.
400 /// \param class_clang_type The Objective-C class that will contain the
401 /// created property.
402 /// \param delayed_properties The list of delayed properties that the result
403 /// will be appended to.
404 void
407 const lldb_private::CompilerType &class_clang_type,
408 DelayedPropertyList &delayed_properties);
409
410 void
413 const lldb_private::CompilerType &class_clang_type,
415 FieldInfo &last_field_info);
416
417 /// If the specified 'die' represents a static data member, creates
418 /// a 'clang::VarDecl' for it and attaches it to specified parent
419 /// 'class_clang_type'.
420 ///
421 /// \param[in] die The member declaration we want to create a
422 /// clang::VarDecl for.
423 ///
424 /// \param[in] attrs The parsed attributes for the specified 'die'.
425 ///
426 /// \param[in] class_clang_type The parent RecordType of the static
427 /// member this function will create.
430 const MemberAttributes &attrs,
431 const lldb_private::CompilerType &class_clang_type);
432
434 const lldb_private::CompilerType &clang_type);
436 lldb_private::Type *type,
437 const lldb_private::CompilerType &clang_type);
438
447 const ParsedDWARFTypeAttributes &attrs);
448
449 /// Helper function called by \ref ParseSubroutine when parsing ObjC-methods.
450 ///
451 /// \param[in] objc_method Name of the ObjC method being parsed.
452 ///
453 /// \param[in] die The DIE that represents the ObjC method being parsed.
454 ///
455 /// \param[in] clang_type The CompilerType representing the function prototype
456 /// of the ObjC method being parsed.
457 ///
458 /// \param[in] attrs DWARF attributes for \ref die.
459 ///
460 /// \param[in] is_variadic Is true iff we're parsing a variadic method.
461 ///
462 /// \returns true on success
463 bool
467 const ParsedDWARFTypeAttributes &attrs, bool is_variadic);
468
469 /// Helper function called by \ref ParseSubroutine when parsing C++ methods.
470 ///
471 /// \param[in] die The DIE that represents the C++ method being parsed.
472 ///
473 /// \param[in] clang_type The CompilerType representing the function prototype
474 /// of the C++ method being parsed.
475 ///
476 /// \param[in] attrs DWARF attributes for \ref die.
477 ///
478 /// \param[in] decl_ctx_die The DIE representing the DeclContext of the C++
479 /// method being parsed.
480 ///
481 /// \param[in] object_parameter The DIE of this subprogram's object parameter.
482 /// May be an invalid DIE for C++ static methods.
483 ///
484 /// \param[out] ignore_containing_context Will get set to true if the caller
485 /// should treat this C++ method as-if it was not a C++ method.
486 /// Currently used as a hack to work around templated C++ methods
487 /// causing class definitions to mismatch between CUs.
488 ///
489 /// \returns A pair of <bool, TypeSP>. The first element is 'true' on success.
490 /// The second element is non-null if we have previously parsed this
491 /// method (a null TypeSP does not indicate failure).
492 std::pair<bool, lldb::TypeSP>
495 const ParsedDWARFTypeAttributes &attrs,
496 const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die,
497 const lldb_private::plugin::dwarf::DWARFDIE &object_parameter,
498 bool &ignore_containing_context);
499
501 const ParsedDWARFTypeAttributes &attrs);
504 const ParsedDWARFTypeAttributes &attrs);
505
506 /// Parses a DW_TAG_inheritance DIE into a base/super class.
507 ///
508 /// \param die The DW_TAG_inheritance DIE to parse.
509 /// \param parent_die The parent DIE of the given DIE.
510 /// \param class_clang_type The C++/Objective-C class representing parent_die.
511 /// For an Objective-C class this method sets the super class on success. For
512 /// a C++ class this will *not* add the result as a base class.
513 /// \param module_sp The current Module.
514 /// \param base_classes The list of C++ base classes that will be appended
515 /// with the parsed base class on success.
516 /// \param layout_info The layout information that will be updated for C++
517 /// base classes with the base offset.
518 void ParseInheritance(
521 const lldb_private::CompilerType class_clang_type,
522 const lldb::ModuleSP &module_sp,
523 std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
525
526 /// Parses DW_TAG_variant_part DIE into a structure that encodes all variants
527 /// Note that this is currently being emitted by rustc and not Clang
528 /// \param die DW_TAG_variant_part DIE to parse
529 /// \param parent_die The parent DW_TAG_structure_type to parse
530 /// \param class_clang_type The Rust struct representing parent_die.
531 /// \param layout_info The layout information that will be updated for
532 // base classes with the base offset
533 void
536 const lldb_private::CompilerType &class_clang_type,
538};
539
540/// Parsed form of all attributes that are relevant for type reconstruction.
541/// Some attributes are relevant for all kinds of types (declaration), while
542/// others are only meaningful to a specific type (is_virtual)
546
547 bool is_artificial = false;
549 bool is_explicit = false;
551 bool is_inline = false;
552 bool is_scoped_enum = false;
553 bool is_vector = false;
554 bool is_virtual = false;
556 bool exports_symbols = false;
557 clang::StorageClass storage = clang::SC_None;
558 const char *mangled_name = nullptr;
567 std::optional<uint64_t> byte_size;
568 std::optional<uint64_t> data_bit_size;
569 std::optional<uint64_t> alignment;
570 size_t calling_convention = llvm::dwarf::DW_CC_normal;
571 uint32_t bit_stride = 0;
572 uint32_t byte_stride = 0;
573 uint32_t encoding = 0;
574
575 ///< Indicates ref-qualifier of C++ member function if present.
576 ///< Is RQ_None otherwise.
577 clang::RefQualifierKind ref_qual = clang::RQ_None;
578
579 ///< Has a value if this DIE represents an enum that was declared
580 ///< with enum_extensibility.
581 std::optional<clang::EnumExtensibilityAttr::Kind> enum_kind;
582};
583
584#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFASTPARSERCLANG_H
lldb::TypeSP ParsePointerToMemberType(const lldb_private::plugin::dwarf::DWARFDIE &die, const ParsedDWARFTypeAttributes &attrs)
bool CompleteEnumType(const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::Type *type, const lldb_private::CompilerType &clang_type)
clang::NamespaceDecl * ResolveImportedDeclarationDIE(const lldb_private::plugin::dwarf::DWARFDIE &die)
Returns the namespace decl that a DW_TAG_imported_declaration imports.
void CreateStaticMemberVariable(const lldb_private::plugin::dwarf::DWARFDIE &die, const MemberAttributes &attrs, const lldb_private::CompilerType &class_clang_type)
If the specified 'die' represents a static data member, creates a 'clang::VarDecl' for it and attache...
std::unique_ptr< lldb_private::ClangASTImporter > m_clang_ast_importer_up
lldb::TypeSP ParseEnum(const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
std::string GetDIEClassTemplateParams(lldb_private::plugin::dwarf::DWARFDIE die) override
Returns the template parameters of a class DWARFDIE as a string.
bool CompleteRecordType(const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::CompilerType &clang_type)
static bool classof(const DWARFASTParser *Parser)
llvm::DenseMap< const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *, clang::Decl * > DIEToDeclMap
lldb::TypeSP UpdateSymbolContextScopeForType(const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb::TypeSP type_sp)
If type_sp is valid, calculate and set its symbol context scope, and update the type list for its bac...
lldb_private::TypeSystemClang & m_ast
bool ShouldCreateUnnamedBitfield(FieldInfo const &last_field_info, uint64_t last_field_end, FieldInfo const &this_field_info, lldb_private::ClangASTImporter::LayoutInfo const &layout_info) const
Returns 'true' if we should create an unnamed bitfield and add it to the parser's current AST.
bool CompleteTypeFromDWARF(const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::Type *type, const lldb_private::CompilerType &compiler_type) override
lldb::TypeSP ParseArrayType(const lldb_private::plugin::dwarf::DWARFDIE &die, const ParsedDWARFTypeAttributes &attrs)
lldb_private::ClangASTImporter & GetClangASTImporter()
clang::BlockDecl * ResolveBlockDIE(const lldb_private::plugin::dwarf::DWARFDIE &die)
lldb::TypeSP ParseTypeFromDWARF(const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, bool *type_is_new_ptr) override
clang::DeclContext * GetClangDeclContextContainingDIE(const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::plugin::dwarf::DWARFDIE *decl_ctx_die)
lldb_private::plugin::dwarf::DWARFDIE GetObjectParameter(const lldb_private::plugin::dwarf::DWARFDIE &subprogram, const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die)
Get the object parameter DIE if one exists, otherwise returns a default DWARFDIE.
clang::DeclContext * GetDeclContextForBlock(const lldb_private::plugin::dwarf::DWARFDIE &die)
std::multimap< const clang::DeclContext *, const lldb_private::plugin::dwarf::DWARFDIE > DeclContextToDIEMap
lldb::TypeSP ParseTypeModifier(const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
lldb::TypeSP ParseTypeFromClangModule(const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::Log *log)
Follow Clang Module Skeleton CU references to find a type definition.
lldb::TypeSP ParseStructureLikeDIE(const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, const ParsedDWARFTypeAttributes &attrs)
Parse a structure, class, or union type DIE.
DIEToDeclContextMap m_die_to_decl_ctx
void ParseObjCProperty(const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, const lldb_private::CompilerType &class_clang_type, DelayedPropertyList &delayed_properties)
Parses a DW_TAG_APPLE_property DIE and appends the parsed data to the list of delayed Objective-C pro...
void EnsureAllDIEsInDeclContextHaveBeenParsed(lldb_private::CompilerDeclContext decl_context) override
clang::NamespaceDecl * ResolveNamespaceDIE(const lldb_private::plugin::dwarf::DWARFDIE &die)
void GetUniqueTypeNameAndDeclaration(const lldb_private::plugin::dwarf::DWARFDIE &die, lldb::LanguageType language, lldb_private::ConstString &unique_typename, lldb_private::Declaration &decl_declaration)
lldb_private::ConstString ConstructDemangledNameFromDWARF(const lldb_private::plugin::dwarf::DWARFDIE &die) override
lldb_private::CompilerDeclContext GetDeclContextContainingUIDFromDWARF(const lldb_private::plugin::dwarf::DWARFDIE &die) override
void ParseInheritance(const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, const lldb_private::CompilerType class_clang_type, const lldb::ModuleSP &module_sp, std::vector< std::unique_ptr< clang::CXXBaseSpecifier > > &base_classes, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
Parses a DW_TAG_inheritance DIE into a base/super class.
void ParseSingleMember(const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, const lldb_private::CompilerType &class_clang_type, lldb_private::ClangASTImporter::LayoutInfo &layout_info, FieldInfo &last_field_info)
size_t ParseChildEnumerators(const lldb_private::CompilerType &compiler_type, bool is_signed, uint32_t enumerator_byte_size, const lldb_private::plugin::dwarf::DWARFDIE &parent_die)
bool ParseObjCMethod(const lldb_private::ObjCLanguage::ObjCMethodName &objc_method, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::CompilerType clang_type, const ParsedDWARFTypeAttributes &attrs, bool is_variadic)
Helper function called by ParseSubroutine when parsing ObjC-methods.
~DWARFASTParserClang() override
std::vector< DelayedAddObjCClassProperty > DelayedPropertyList
lldb::ModuleSP GetModuleForType(const lldb_private::plugin::dwarf::DWARFDIE &die)
bool CopyUniqueClassMethodTypes(const lldb_private::plugin::dwarf::DWARFDIE &src_class_die, const lldb_private::plugin::dwarf::DWARFDIE &dst_class_die, lldb_private::Type *class_type, std::vector< lldb_private::plugin::dwarf::DWARFDIE > &failures)
clang::DeclContext * GetClangDeclContextForDIE(const lldb_private::plugin::dwarf::DWARFDIE &die)
bool ParseTemplateDIE(const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::TypeSystemClang::TemplateParameterInfos &template_param_infos)
lldb_private::CompilerDeclContext GetDeclContextForUIDFromDWARF(const lldb_private::plugin::dwarf::DWARFDIE &die) override
llvm::Expected< llvm::APInt > ExtractIntFromFormValue(const lldb_private::CompilerType &int_type, const lldb_private::plugin::dwarf::DWARFFormValue &form_value) const
Extracts an value for a given Clang integer type from a DWARFFormValue.
bool ParseChildMembers(const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::CompilerType &class_compiler_type, std::vector< std::unique_ptr< clang::CXXBaseSpecifier > > &base_classes, std::vector< lldb_private::plugin::dwarf::DWARFDIE > &member_function_dies, std::vector< lldb_private::plugin::dwarf::DWARFDIE > &contained_type_dies, DelayedPropertyList &delayed_properties, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
clang::DeclContext * GetCachedClangDeclContextForDIE(const lldb_private::plugin::dwarf::DWARFDIE &die)
DIEToModuleMap m_die_to_module
DeclContextToDIEMap m_decl_ctx_to_die
lldb_private::Function * ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::AddressRanges func_ranges) override
void ParseChildParameters(clang::DeclContext *containing_decl_ctx, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, bool &is_variadic, bool &has_template_params, std::vector< lldb_private::CompilerType > &function_param_types, llvm::SmallVectorImpl< llvm::StringRef > &function_param_names)
void AddUnnamedBitfieldToRecordTypeIfNeeded(lldb_private::ClangASTImporter::LayoutInfo &class_layout_info, const lldb_private::CompilerType &class_clang_type, const FieldInfo &previous_field, const FieldInfo &current_field)
Tries to detect whether class_clang_type contained an unnamed bit-field between previous_field and cu...
llvm::DenseMap< const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *, clang::DeclContext * > DIEToDeclContextMap
lldb::TypeSP ParseSubroutine(const lldb_private::plugin::dwarf::DWARFDIE &die, const ParsedDWARFTypeAttributes &attrs)
void MapDeclDIEToDefDIE(const lldb_private::plugin::dwarf::DWARFDIE &decl_die, const lldb_private::plugin::dwarf::DWARFDIE &def_die)
lldb_private::CompilerDecl GetDeclForUIDFromDWARF(const lldb_private::plugin::dwarf::DWARFDIE &die) override
llvm::DenseMap< const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *, lldb_private::OptionalClangModuleID > DIEToModuleMap
bool ParseTemplateParameterInfos(const lldb_private::plugin::dwarf::DWARFDIE &parent_die, lldb_private::TypeSystemClang::TemplateParameterInfos &template_param_infos)
DWARFASTParserClang(lldb_private::TypeSystemClang &ast)
void ParseRustVariantPart(lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, const lldb_private::CompilerType &class_clang_type, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
Parses DW_TAG_variant_part DIE into a structure that encodes all variants Note that this is currently...
clang::Decl * GetClangDeclForDIE(const lldb_private::plugin::dwarf::DWARFDIE &die)
void LinkDeclToDIE(clang::Decl *decl, const lldb_private::plugin::dwarf::DWARFDIE &die)
void LinkDeclContextToDIE(clang::DeclContext *decl_ctx, const lldb_private::plugin::dwarf::DWARFDIE &die)
lldb_private::OptionalClangModuleID GetOwningClangModule(const lldb_private::plugin::dwarf::DWARFDIE &die)
std::pair< bool, lldb::TypeSP > ParseCXXMethod(const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::CompilerType clang_type, const ParsedDWARFTypeAttributes &attrs, const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die, const lldb_private::plugin::dwarf::DWARFDIE &object_parameter, bool &ignore_containing_context)
Helper function called by ParseSubroutine when parsing C++ methods.
Manages and observes all Clang AST node importing in LLDB.
A class that describes a compilation unit.
Definition CompileUnit.h:43
Represents a generic declaration context in a program.
Represents a generic declaration such as a function declaration.
Generic representation of a type in a programming language.
A uniqued constant string class.
Definition ConstString.h:40
A class that describes the declaration location of a lldb object.
Definition Declaration.h:24
A class that describes a function.
Definition Function.h:400
Defines a symbol context baton that can be handed other debug core functions.
A TypeSystem implementation based on Clang.
DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic o...
#define UINT64_MAX
#define UINT32_MAX
A class that represents a running process on the host machine.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
std::shared_ptr< lldb_private::Type > TypeSP
std::shared_ptr< lldb_private::Module > ModuleSP
bool is_artificial
Set to 'true' if this field is DW_AT_artificial.
std::optional< uint64_t > effective_field_end
In case this field is folded into the storage of a previous member's storage (for example with [[no_u...
uint64_t GetEffectiveFieldEnd() const
If this field was folded into storage of a previous field, returns the offset in bits of where that s...
uint64_t bit_offset
Offset of this field in bits from the beginning of the containing struct.
bool NextBitfieldOffsetIsValid(const uint64_t next_bit_offset) const
uint64_t GetFieldEnd() const
Returns the offset in bits of where the storage this field occupies ends.
uint64_t bit_size
Size in bits that this field occupies.
bool is_bitfield
Set to 'true' if this field is a bit-field.
Parsed form of all attributes that are relevant for parsing type members.
int64_t bit_offset
Indicates how many bits into the word (according to the host endianness) the low-order bit of the fie...
uint32_t member_byte_offset
Indicates the byte offset of the word from the base address of the structure.
lldb_private::plugin::dwarf::DWARFFormValue encoding_form
size_t bit_size
Indicates the size of the field in bits.
std::optional< lldb_private::plugin::dwarf::DWARFFormValue > const_value_form
MemberAttributes(const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, lldb::ModuleSP module_sp)
Parsed form of all attributes that are relevant for type reconstruction.
lldb_private::Declaration decl
uint32_t encoding
Indicates ref-qualifier of C++ member function if present.
lldb_private::ConstString name
std::optional< clang::EnumExtensibilityAttr::Kind > enum_kind
std::optional< uint64_t > alignment
lldb::LanguageType class_language
std::optional< uint64_t > byte_size
lldb_private::plugin::dwarf::DWARFFormValue signature
lldb_private::plugin::dwarf::DWARFFormValue type
ParsedDWARFTypeAttributes(const lldb_private::plugin::dwarf::DWARFDIE &die)
clang::RefQualifierKind ref_qual
Has a value if this DIE represents an enum that was declared with enum_extensibility.
lldb_private::plugin::dwarf::DWARFFormValue specification
lldb_private::plugin::dwarf::DWARFFormValue abstract_origin
std::optional< uint64_t > data_bit_size
lldb_private::plugin::dwarf::DWARFFormValue containing_type