LLVM: include/llvm/DebugInfo/LogicalView/Core/LVElement.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVELEMENT_H

15#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVELEMENT_H

16

22#include

23#include

24#include

25

26namespace llvm {

28

29

65

70

71

72

74

76 enum class Property {

77 IsLine,

78 IsScope,

79 IsSymbol,

80 IsType,

81 IsEnumClass,

82 IsExternal,

83 HasType,

84 HasAugmentedName,

85 IsTypedefReduced,

86 IsArrayResolved,

87 IsMemberPointerResolved,

88 IsTemplateResolved,

89 IsInlined,

90 IsInlinedAbstract,

91 InvalidFilename,

92 HasReference,

93 HasReferenceAbstract,

94 HasReferenceExtension,

95 HasReferenceSpecification,

96 QualifiedResolved,

97 IncludeInPrint,

98 IsStatic,

99 TransformName,

100 IsScoped,

101 IsNested,

102 IsScopedAlready,

103 IsArtificial,

104 IsReferencedType,

105 IsSystem,

106 OffsetFromTypeIndex,

107 IsAnonymous,

108 LastEntry

109 };

111

112

113 size_t NameIndex = 0;

114 size_t QualifiedNameIndex = 0;

115 size_t FilenameIndex = 0;

116

117

119

121

122 uint16_t AccessibilityCode : 2;

123 uint16_t InlineCode : 2;

124 uint16_t VirtualityCode : 2;

125

126

127

128 void setFileLine(LVElement *Specification);

129

130

131 void resolveQualifiedName();

132

133protected:

134

136

137

139

140public:

142 : LVObject(), SubclassID(ID), AccessibilityCode(0), InlineCode(0),

143 VirtualityCode(0) {}

147

149

160 PROPERTY(Property, IsMemberPointerResolved);

166 PROPERTY(Property, HasReferenceAbstract);

167 PROPERTY(Property, HasReferenceExtension);

168 PROPERTY(Property, HasReferenceSpecification);

181

182 bool isNamed() const override { return NameIndex != 0; }

184 bool isFiled() const override { return FilenameIndex != 0; }

185

186

191

195 void setName(StringRef ElementName) override;

196

197

201

202

204

205

212

215

218

219

221

224

227

229 virtual bool isRoot() const { return false; }

230

235

239

246

247

249

250 virtual bool isBase() const { return false; }

252

258

259 virtual int64_t getCount() const { return 0; }

265 virtual std::pair<unsigned, unsigned> getBounds() const { return {}; }

267

268

271

272

276

277

282

283

287 AccessibilityCode = Code.value();

288 }

289

290

294

295

299 virtualityString(uint32_t Virtuality = dwarf::DW_VIRTUALITY_none) const;

300

301

305 VirtualityCode = Code.value();

306 }

307

308

309 StringRef externalString() const;

310

312 LVType *getTypeAsType() const;

313 LVScope *getTypeAsScope() const;

314

318 setHasType();

319 Element->setIsReferencedType();

320 }

321 }

322

323

324 void setGenericType(LVElement *Element);

325

329

331 std::string typeOffsetAsString() const;

332 std::string discriminatorAsString() const;

333

335

336 LVScope *getFunctionParent() const;

337 virtual LVScope *getCompileUnitParent() const;

338

339

341

342

346

347

349

350

351 void generateName(std::string &Prefix) const;

352 void generateName();

353

355 virtual void updateLevel(LVScope *Parent, bool Moved = false);

356

357

358

359

360

361

362

363 virtual void resolve();

365 virtual void resolveName();

367 void resolveParents();

368

369 bool referenceMatch(const LVElement *Element) const;

370

371

372 bool equals(const LVElement *Element) const;

373

374

376

378};

379

380}

381}

382

383#endif

static std::string getTypeName(OverloadKind Kind, Type *Ty)

static StringRef getName(Value *V)

BaseType

A given derived pointer can have multiple base pointers through phi/selects.

Pass interface - Implemented by all 'passes'.

StringRef - Represent a constant reference to a string, i.e.

The instances of the Type class are immutable: once they are created, they are never changed.

LLVM Value Representation.

Definition LVElement.h:75

PROPERTY(Property, IsTypedefReduced)

virtual void setCount(int64_t Value)

Definition LVElement.h:260

size_t getNameIndex() const

Definition LVElement.h:213

PROPERTY(Property, IsEnumClass)

void setAccessibilityCode(codeview::MemberAccess Access)

Definition LVElement.h:285

PROPERTY(Property, IsScoped)

virtual void setCallLineNumber(uint32_t Number)

Definition LVElement.h:241

PROPERTY(Property, HasReferenceSpecification)

void setInnerComponent()

Definition LVElement.h:216

virtual bool isTemplateParam() const

Definition LVElement.h:251

StringRef getQualifiedName() const

Definition LVElement.h:209

virtual void setReference(LVScope *Scope)

Definition LVElement.h:232

PROPERTY(Property, IsType)

~LVElement() override=default

virtual void setReference(LVSymbol *Symbol)

Definition LVElement.h:233

PROPERTY(Property, IsMemberPointerResolved)

virtual void setBitSize(uint32_t Size)

Definition LVElement.h:257

PROPERTY(Property, IsInlinedAbstract)

virtual void setLinkageName(StringRef LinkageName)

Definition LVElement.h:236

virtual void setProducer(StringRef ProducerName)

Definition LVElement.h:223

static LVElementDispatch & getDispatch()

Definition LVElement.h:377

virtual void setUpperBound(int64_t Value)

Definition LVElement.h:264

virtual void setDiscriminator(uint32_t Value)

Definition LVElement.h:270

virtual bool isRoot() const

Definition LVElement.h:229

virtual size_t getCallFilenameIndex() const

Definition LVElement.h:242

virtual void setLowerBound(int64_t Value)

Definition LVElement.h:262

LVElement(LVSubclassID ID)

Definition LVElement.h:141

virtual int64_t getCount() const

Definition LVElement.h:259

LVElement(const LVElement &)=delete

bool isFiled() const override

Definition LVElement.h:184

uint32_t getInlineCode() const

Definition LVElement.h:291

virtual uint32_t getDiscriminator() const

Definition LVElement.h:269

virtual StringRef getValue() const

Definition LVElement.h:273

virtual bool isBase() const

Definition LVElement.h:250

virtual void setValue(StringRef Value)

Definition LVElement.h:274

void setInlineCode(uint32_t Code)

Definition LVElement.h:292

void setQualifiedName(StringRef Name)

Definition LVElement.h:206

PROPERTY(Property, InvalidFilename)

virtual void setReference(LVElement *Element)

Definition LVElement.h:231

bool getIsKindScope() const

Definition LVElement.h:188

PROPERTY(Property, IsLine)

PROPERTY(Property, HasAugmentedName)

virtual StringRef getLinkageName() const

Definition LVElement.h:237

virtual bool isCompileUnit() const

Definition LVElement.h:228

virtual size_t getValueIndex() const

Definition LVElement.h:275

PROPERTY(Property, IsSymbol)

PROPERTY(Property, HasReferenceExtension)

StringRef getName() const override

Definition LVElement.h:192

virtual int64_t getUpperBound() const

Definition LVElement.h:263

PROPERTY(Property, HasReference)

LVElement & operator=(const LVElement &)=delete

LVElement * getType() const

Definition LVElement.h:311

PROPERTY(Property, IsStatic)

PROPERTY(Property, IsArrayResolved)

virtual StringRef getProducer() const

Definition LVElement.h:222

PROPERTY(Property, IsAnonymous)

PROPERTY(Property, IsInlined)

void setAccessibilityCode(uint32_t Access)

Definition LVElement.h:279

virtual uint32_t getCallLineNumber() const

Definition LVElement.h:240

uint32_t getAccessibilityCode() const

Definition LVElement.h:278

PROPERTY(Property, IsNested)

virtual uint32_t getBitSize() const

Definition LVElement.h:256

PROPERTY(Property, HasType)

void setVirtualityCode(uint32_t Virtuality)

Definition LVElement.h:297

virtual void setReference(LVType *Type)

Definition LVElement.h:234

void setType(LVElement *Element=nullptr)

Definition LVElement.h:315

StringRef getTypeQualifiedName() const

Definition LVElement.h:326

PROPERTY(Property, IsReferencedType)

virtual void report(LVComparePass Pass)

Definition LVElement.h:375

PROPERTY(Property, IsSystem)

virtual int64_t getLowerBound() const

Definition LVElement.h:261

PROPERTY(Property, IsArtificial)

bool getIsKindType() const

Definition LVElement.h:187

void setFilenameIndex(size_t Index)

Definition LVElement.h:245

PROPERTY(Property, IncludeInPrint)

LVElement * ElementType

Definition LVElement.h:135

virtual std::pair< unsigned, unsigned > getBounds() const

Definition LVElement.h:265

uint32_t getVirtualityCode() const

Definition LVElement.h:296

PROPERTY(Property, QualifiedResolved)

size_t getFilenameIndex() const

Definition LVElement.h:244

bool isTyped() const override

Definition LVElement.h:183

void printFileIndex(raw_ostream &OS, bool Full=true) const override

virtual void setSourceLanguage(LVSourceLanguage SL)

Definition LVElement.h:226

PROPERTY(Property, HasReferenceAbstract)

virtual void setCallFilenameIndex(size_t Index)

Definition LVElement.h:243

StringRef getPathname() const

Definition LVElement.h:198

PROPERTY(Property, IsScope)

size_t getQualifiedNameIndex() const

Definition LVElement.h:214

virtual bool removeElement(LVElement *Element)

Definition LVElement.h:354

PROPERTY(Property, IsExternal)

void setVirtualityCode(codeview::MethodKind Virtuality)

Definition LVElement.h:303

virtual LVSourceLanguage getSourceLanguage() const

Definition LVElement.h:225

PROPERTY(Property, OffsetFromTypeIndex)

virtual size_t getLinkageNameIndex() const

Definition LVElement.h:238

PROPERTY(Property, TransformName)

PROPERTY(Property, IsScopedAlready)

uint32_t getStorageSizeInBytes() const

Definition LVElement.h:253

LVSubclassID getSubclassID() const

Definition LVElement.h:148

bool isNamed() const override

Definition LVElement.h:182

virtual void resolveExtra()

Definition LVElement.h:364

virtual void setBounds(unsigned Lower, unsigned Upper)

Definition LVElement.h:266

PROPERTY(Property, IsTemplateResolved)

virtual void resolveReferences()

Definition LVElement.h:366

This class implements an extremely fast bulk output stream that can only output to a stream.

MethodKind

Part of member attribute flags. (CV_methodprop_e)

MemberAccess

Source-level access specifier. (CV_access_e)

LLVM_ABI LVStringPool & getStringPool()

bool(LVScope::*)() const LVScopeGetFunction

std::vector< LVElementGetFunction > LVElementRequest

Definition LVElement.h:69

LVElementKind

Definition LVElement.h:66

@ Global

Definition LVElement.h:66

@ Discarded

Definition LVElement.h:66

@ Optimized

Definition LVElement.h:66

@ LastEntry

Definition LVElement.h:66

LLVM_ABI StringRef emptyString()

constexpr unsigned int DWARF_CHAR_BIT

Definition LVElement.h:73

LVSubclassID

Definition LVElement.h:30

@ LV_SCOPE_FORMAL_PACK

Definition LVElement.h:44

@ LV_SCOPE_ARRAY

Definition LVElement.h:41

@ LV_TYPE_SUBRANGE

Definition LVElement.h:62

@ LV_TYPE_DEFINITION

Definition LVElement.h:58

@ LV_TYPE_IMPORT

Definition LVElement.h:60

@ lV_SCOPE_FIRST

Definition LVElement.h:37

@ LV_SCOPE

Definition LVElement.h:38

@ LV_TYPE_FIRST

Definition LVElement.h:56

@ LV_SYMBOL_LAST

Definition LVElement.h:55

@ LV_SCOPE_COMPILE_UNIT

Definition LVElement.h:42

@ LV_TYPE

Definition LVElement.h:57

@ LV_SCOPE_ALIAS

Definition LVElement.h:40

@ LV_SCOPE_MODULE

Definition LVElement.h:48

@ LV_SCOPE_TEMPLATE_PACK

Definition LVElement.h:51

@ LV_SYMBOL

Definition LVElement.h:54

@ LV_LINE_LAST

Definition LVElement.h:36

@ LV_SCOPE_NAMESPACE

Definition LVElement.h:49

@ LV_TYPE_PARAM

Definition LVElement.h:61

@ LV_SCOPE_ROOT

Definition LVElement.h:50

@ LV_LINE_DEBUG

Definition LVElement.h:34

@ LV_SCOPE_FUNCTION_INLINED

Definition LVElement.h:46

@ LV_ELEMENT

Definition LVElement.h:31

@ LV_SCOPE_AGGREGATE

Definition LVElement.h:39

@ LV_SCOPE_ENUMERATION

Definition LVElement.h:43

@ LV_SCOPE_FUNCTION

Definition LVElement.h:45

@ LV_LINE_ASSEMBLER

Definition LVElement.h:35

@ LV_SYMBOL_FIRST

Definition LVElement.h:53

@ LV_TYPE_ENUMERATOR

Definition LVElement.h:59

@ LV_LINE

Definition LVElement.h:33

@ LV_SCOPE_FUNCTION_TYPE

Definition LVElement.h:47

@ LV_LINE_FIRST

Definition LVElement.h:32

@ LV_TYPE_LAST

Definition LVElement.h:63

@ LV_SCOPE_LAST

Definition LVElement.h:52

std::map< LVElementKind, LVElementGetFunction > LVElementDispatch

Definition LVElement.h:68

std::set< LVElementKind > LVElementKindSet

Definition LVElement.h:67

This is an optimization pass for GlobalISel generic memory operations.

constexpr T divideCeil(U Numerator, V Denominator)

Returns the integer ceil(Numerator / Denominator).

A source language supported by any of the debug info representations.