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 {
37class DWARFDebugInfoEntry;
38class SymbolFileDWARF;
39} // namespace dwarf
40} // namespace lldb_private::plugin
41
43
45public:
47
49
50 // DWARFASTParser interface.
54 bool *type_is_new_ptr) override;
55
57 const lldb_private::plugin::dwarf::DWARFDIE &die) override;
58
62 lldb_private::AddressRanges func_ranges) override;
63
67 const lldb_private::CompilerType &compiler_type) override;
68
70 const lldb_private::plugin::dwarf::DWARFDIE &die) override;
71
73 lldb_private::CompilerDeclContext decl_context) override;
74
76 const lldb_private::plugin::dwarf::DWARFDIE &die) override;
77
79 const lldb_private::plugin::dwarf::DWARFDIE &die) override;
80
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
111
114
115protected:
116 /// Protected typedefs and members.
117 /// @{
119 typedef std::vector<DelayedAddObjCClassProperty> DelayedPropertyList;
120
121 typedef llvm::DenseMap<
123 clang::DeclContext *>
125 typedef std::multimap<const clang::DeclContext *,
128 typedef llvm::DenseMap<
132 typedef llvm::DenseMap<
135
141 std::unique_ptr<lldb_private::ClangASTImporter> m_clang_ast_importer_up;
142 /// @}
143
144 clang::DeclContext *
146
147 clang::BlockDecl *
149
150 clang::NamespaceDecl *
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(
164
167 &template_param_infos);
168
172 &template_param_infos);
173
176 lldb::LanguageType language, lldb_private::ConstString &unique_typename,
177 lldb_private::Declaration &decl_declaration);
178
181 const 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,
188
189 size_t
190 ParseChildParameters(clang::DeclContext *containing_decl_ctx,
192 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
199 const 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.
208
209 clang::Decl *
211
212 clang::DeclContext *
214
215 clang::DeclContext *GetClangDeclContextContainingDIE(
220
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(
229
230 void LinkDeclContextToDIE(clang::DeclContext *decl_ctx,
232
233 void LinkDeclToDIE(clang::Decl *decl,
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.
243
244 /// Follow Clang Module Skeleton CU references to find a type definition.
248 lldb_private::Log *log);
249
250 // Return true if this type is a declaration to a type in an external
251 // module.
254
255 static bool classof(const DWARFASTParser *Parser) {
256 return Parser->GetKind() == Kind::DWARFASTParserClang;
257 }
258
259private:
260 struct FieldInfo {
261 /// Size in bits that this field occupies. Can but
262 /// need not be the DW_AT_bit_size of the field.
263 uint64_t bit_size = 0;
264
265 /// Offset of this field in bits from the beginning
266 /// of the containing struct. Can but need not
267 /// be the DW_AT_data_bit_offset of the field.
268 uint64_t bit_offset = 0;
269
270 /// In case this field is folded into the storage
271 /// of a previous member's storage (for example
272 /// with [[no_unique_address]]), the effective field
273 /// end is the offset in bits from the beginning of
274 /// the containing struct where the field we were
275 /// folded into ended.
276 std::optional<uint64_t> effective_field_end;
277
278 /// Set to 'true' if this field is a bit-field.
279 bool is_bitfield = false;
280
281 /// Set to 'true' if this field is DW_AT_artificial.
282 bool is_artificial = false;
283
284 FieldInfo() = default;
285
286 void SetIsBitfield(bool flag) { is_bitfield = flag; }
287 bool IsBitfield() const { return is_bitfield; }
288
289 void SetIsArtificial(bool flag) { is_artificial = flag; }
290 bool IsArtificial() const { return is_artificial; }
291
292 bool NextBitfieldOffsetIsValid(const uint64_t next_bit_offset) const {
293 // Any subsequent bitfields must not overlap and must be at a higher
294 // bit offset than any previous bitfield + size.
295 return (bit_size + bit_offset) <= next_bit_offset;
296 }
297
298 /// Returns the offset in bits of where the storage this field
299 /// occupies ends.
300 uint64_t GetFieldEnd() const { return bit_size + bit_offset; }
301
302 void SetEffectiveFieldEnd(uint64_t val) { effective_field_end = val; }
303
304 /// If this field was folded into storage of a previous field,
305 /// returns the offset in bits of where that storage ends. Otherwise,
306 /// returns the regular field end (see \ref GetFieldEnd).
307 uint64_t GetEffectiveFieldEnd() const {
308 return effective_field_end.value_or(GetFieldEnd());
309 }
310 };
311
312 /// Parsed form of all attributes that are relevant for parsing type members.
314 explicit MemberAttributes(
317 lldb::ModuleSP module_sp);
318 const char *name = nullptr;
319 /// Indicates how many bits into the word (according to the host endianness)
320 /// the low-order bit of the field starts. Can be negative.
321 int64_t bit_offset = 0;
322 /// Indicates the size of the field in bits.
323 size_t bit_size = 0;
326 std::optional<uint64_t> byte_size;
327 std::optional<lldb_private::plugin::dwarf::DWARFFormValue> const_value_form;
329 /// Indicates the byte offset of the word from the base address of the
330 /// structure.
332 bool is_artificial = false;
333 bool is_declaration = false;
334 };
335
336 /// Returns 'true' if we should create an unnamed bitfield
337 /// and add it to the parser's current AST.
338 ///
339 /// \param[in] last_field_info FieldInfo of the previous DW_TAG_member
340 /// we parsed.
341 /// \param[in] last_field_end Offset (in bits) where the last parsed field
342 /// ended.
343 /// \param[in] this_field_info FieldInfo of the current DW_TAG_member
344 /// being parsed.
345 /// \param[in] layout_info Layout information of all decls parsed by the
346 /// current parser.
348 FieldInfo const &last_field_info, uint64_t last_field_end,
349 FieldInfo const &this_field_info,
350 lldb_private::ClangASTImporter::LayoutInfo const &layout_info) const;
351
352 /// Tries to detect whether \ref class_clang_type contained an unnamed
353 /// bit-field between \ref previous_field and \ref current_field, and if
354 /// so, adds a clang::FieldDecl representing that bit-field to
355 /// \ref class_clang_type.
356 ///
357 /// This is necessary because Clang (and GCC) doesn't emit a DW_TAG_member
358 /// entry for unnamed bit-fields. So we derive it (with some exceptions),
359 /// by checking whether there is a gap between where the storage of a
360 /// DW_TAG_member ended and the subsequent DW_TAG_member began.
361 ///
362 /// \param[in,out] layout_info Layout information of all decls parsed by the
363 /// current parser. Will contain an entry for
364 /// the unnamed bit-field if this function created
365 /// one.
366 ///
367 /// \param[in] class_clang_type The RecordType to which the unnamed bit-field
368 /// will be added (if any).
369 ///
370 /// \param[in] previous_field FieldInfo of the previous DW_TAG_member
371 /// we parsed.
372 ///
373 /// \param[in] current_field FieldInfo of the current DW_TAG_member
374 /// being parsed.
375 ///
378 const lldb_private::CompilerType &class_clang_type,
379 const FieldInfo &previous_field, const FieldInfo &current_field);
380
381 /// Parses a DW_TAG_APPLE_property DIE and appends the parsed data to the
382 /// list of delayed Objective-C properties.
383 ///
384 /// Note: The delayed property needs to be finalized to actually create the
385 /// property declarations in the module AST.
386 ///
387 /// \param die The DW_TAG_APPLE_property DIE that will be parsed.
388 /// \param parent_die The parent DIE.
389 /// \param class_clang_type The Objective-C class that will contain the
390 /// created property.
391 /// \param delayed_properties The list of delayed properties that the result
392 /// will be appended to.
393 void
396 const lldb_private::CompilerType &class_clang_type,
397 DelayedPropertyList &delayed_properties);
398
399 void
402 const lldb_private::CompilerType &class_clang_type,
403 lldb::AccessType default_accessibility,
405 FieldInfo &last_field_info);
406
407 /// If the specified 'die' represents a static data member, creates
408 /// a 'clang::VarDecl' for it and attaches it to specified parent
409 /// 'class_clang_type'.
410 ///
411 /// \param[in] die The member declaration we want to create a
412 /// clang::VarDecl for.
413 ///
414 /// \param[in] attrs The parsed attributes for the specified 'die'.
415 ///
416 /// \param[in] class_clang_type The parent RecordType of the static
417 /// member this function will create.
420 const MemberAttributes &attrs,
421 const lldb_private::CompilerType &class_clang_type);
422
424 const lldb_private::CompilerType &clang_type);
426 lldb_private::Type *type,
427 const lldb_private::CompilerType &clang_type);
428
437 const ParsedDWARFTypeAttributes &attrs);
438
439 /// Helper function called by \ref ParseSubroutine when parsing ObjC-methods.
440 ///
441 /// \param[in] objc_method Name of the ObjC method being parsed.
442 ///
443 /// \param[in] die The DIE that represents the ObjC method being parsed.
444 ///
445 /// \param[in] clang_type The CompilerType representing the function prototype
446 /// of the ObjC method being parsed.
447 ///
448 /// \param[in] attrs DWARF attributes for \ref die.
449 ///
450 /// \param[in] is_variadic Is true iff we're parsing a variadic method.
451 ///
452 /// \returns true on success
453 bool
457 const ParsedDWARFTypeAttributes &attrs, bool is_variadic);
458
459 /// Helper function called by \ref ParseSubroutine when parsing C++ methods.
460 ///
461 /// \param[in] die The DIE that represents the C++ method being parsed.
462 ///
463 /// \param[in] clang_type The CompilerType representing the function prototype
464 /// of the C++ method being parsed.
465 ///
466 /// \param[in] attrs DWARF attributes for \ref die.
467 ///
468 /// \param[in] decl_ctx_die The DIE representing the DeclContext of the C++
469 /// method being parsed.
470 ///
471 /// \param[in] is_static Is true iff we're parsing a static method.
472 ///
473 /// \param[out] ignore_containing_context Will get set to true if the caller
474 /// should treat this C++ method as-if it was not a C++ method.
475 /// Currently used as a hack to work around templated C++ methods
476 /// causing class definitions to mismatch between CUs.
477 ///
478 /// \returns A pair of <bool, TypeSP>. The first element is 'true' on success.
479 /// The second element is non-null if we have previously parsed this
480 /// method (a null TypeSP does not indicate failure).
481 std::pair<bool, lldb::TypeSP>
484 const ParsedDWARFTypeAttributes &attrs,
485 const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die,
486 bool is_static, bool &ignore_containing_context);
487
489 const ParsedDWARFTypeAttributes &attrs);
492 const ParsedDWARFTypeAttributes &attrs);
493
494 /// Parses a DW_TAG_inheritance DIE into a base/super class.
495 ///
496 /// \param die The DW_TAG_inheritance DIE to parse.
497 /// \param parent_die The parent DIE of the given DIE.
498 /// \param class_clang_type The C++/Objective-C class representing parent_die.
499 /// For an Objective-C class this method sets the super class on success. For
500 /// a C++ class this will *not* add the result as a base class.
501 /// \param default_accessibility The default accessibility that is given to
502 /// base classes if they don't have an explicit accessibility set.
503 /// \param module_sp The current Module.
504 /// \param base_classes The list of C++ base classes that will be appended
505 /// with the parsed base class on success.
506 /// \param layout_info The layout information that will be updated for C++
507 /// base classes with the base offset.
508 void ParseInheritance(
511 const lldb_private::CompilerType class_clang_type,
512 const lldb::AccessType default_accessibility,
513 const lldb::ModuleSP &module_sp,
514 std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
516
517 /// Parses DW_TAG_variant_part DIE into a structure that encodes all variants
518 /// Note that this is currently being emitted by rustc and not Clang
519 /// \param die DW_TAG_variant_part DIE to parse
520 /// \param parent_die The parent DW_TAG_structure_type to parse
521 /// \param class_clang_type The Rust struct representing parent_die.
522 /// \param default_accesibility The default accessibility that is given to
523 /// base classes if they don't have an explicit accessibility set
524 /// \param layout_info The layout information that will be updated for
525 // base classes with the base offset
526 void
529 const lldb_private::CompilerType &class_clang_type,
530 const lldb::AccessType default_accesibility,
532};
533
534/// Parsed form of all attributes that are relevant for type reconstruction.
535/// Some attributes are relevant for all kinds of types (declaration), while
536/// others are only meaningful to a specific type (is_virtual)
540
542 bool is_artificial = false;
544 bool is_explicit = false;
546 bool is_inline = false;
547 bool is_scoped_enum = false;
548 bool is_vector = false;
549 bool is_virtual = false;
551 bool exports_symbols = false;
552 clang::StorageClass storage = clang::SC_None;
553 const char *mangled_name = nullptr;
563 std::optional<uint64_t> byte_size;
564 std::optional<uint64_t> alignment;
565 size_t calling_convention = llvm::dwarf::DW_CC_normal;
566 uint32_t bit_stride = 0;
567 uint32_t byte_stride = 0;
568 uint32_t encoding = 0;
569 clang::RefQualifierKind ref_qual =
570 clang::RQ_None; ///< Indicates ref-qualifier of
571 ///< C++ member function if present.
572 ///< Is RQ_None otherwise.
573};
574
575#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)
void ParseRustVariantPart(lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, const lldb_private::CompilerType &class_clang_type, const lldb::AccessType default_accesibility, 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::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)
clang::DeclContext * GetDeclContextForBlock(const lldb_private::plugin::dwarf::DWARFDIE &die)
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::AccessType default_accessibility, 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.
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, const lldb::AccessType default_accessibility, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
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.
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
lldb::TypeSP ParseStructureLikeDIE(const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
Parse a structure, class, or union type DIE.
size_t ParseChildParameters(clang::DeclContext *containing_decl_ctx, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, bool &is_static, bool &is_variadic, bool &has_template_params, std::vector< lldb_private::CompilerType > &function_args, std::vector< clang::ParmVarDecl * > &function_param_decls, unsigned &type_quals)
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)
~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.
clang::DeclContext * GetCachedClangDeclContextForDIE(const lldb_private::plugin::dwarf::DWARFDIE &die)
DIEToModuleMap m_die_to_module
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::AccessType default_accessibility, lldb_private::ClangASTImporter::LayoutInfo &layout_info, FieldInfo &last_field_info)
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 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...
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, bool is_static, bool &ignore_containing_context)
Helper function called by ParseSubroutine when parsing C++ methods.
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)
bool ParseObjCMethod(const lldb_private::ObjCLanguage::MethodName &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.
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)
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)
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.
Definition: CompilerDecl.h:28
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
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:399
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:34
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
Definition: lldb-defines.h:23
#define UINT32_MAX
Definition: lldb-defines.h:19
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
Definition: lldb-forward.h:461
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:373
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
Parsed form of all attributes that are relevant for type reconstruction.
lldb_private::Declaration decl
lldb_private::ConstString name
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
lldb_private::plugin::dwarf::DWARFDIE object_pointer
clang::RefQualifierKind ref_qual
Indicates ref-qualifier of C++ member function if present.
lldb_private::plugin::dwarf::DWARFFormValue specification
lldb_private::plugin::dwarf::DWARFFormValue abstract_origin
lldb_private::plugin::dwarf::DWARFFormValue containing_type