21#define DEBUG_TYPE "Type"
24const char *
const KindBaseType =
"BaseType";
25const char *
const KindConst =
"Const";
26const char *
const KindEnumerator =
"Enumerator";
27const char *
const KindImport =
"Import";
28const char *
const KindPointer =
"Pointer";
29const char *
const KindPointerMember =
"PointerMember";
30const char *
const KindReference =
"Reference";
31const char *
const KindRestrict =
"Restrict";
32const char *
const KindRvalueReference =
"RvalueReference";
33const char *
const KindSubrange =
"Subrange";
34const char *
const KindTemplateTemplate =
"TemplateTemplate";
35const char *
const KindTemplateType =
"TemplateType";
36const char *
const KindTemplateValue =
"TemplateValue";
37const char *
const KindTypeAlias =
"TypeAlias";
38const char *
const KindUndefined =
"Undefined";
39const char *
const KindUnaligned =
"Unaligned";
40const char *
const KindUnspecified =
"Unspecified";
41const char *
const KindVolatile =
"Volatile";
49 const char *
Kind = KindUndefined;
52 else if (getIsConst())
54 else if (getIsEnumerator())
55 Kind = KindEnumerator;
56 else if (getIsImport())
58 else if (getIsPointerMember())
59 Kind = KindPointerMember;
60 else if (getIsPointer())
62 else if (getIsReference())
64 else if (getIsRestrict())
66 else if (getIsRvalueReference())
67 Kind = KindRvalueReference;
68 else if (getIsSubrange())
70 else if (getIsTemplateTypeParam())
71 Kind = KindTemplateType;
72 else if (getIsTemplateValueParam())
73 Kind = KindTemplateValue;
74 else if (getIsTemplateTemplateParam())
75 Kind = KindTemplateTemplate;
76 else if (getIsTypedef())
78 else if (getIsUnaligned())
80 else if (getIsUnspecified())
81 Kind = KindUnspecified;
82 else if (getIsVolatile())
123 if (getIsResolvedName())
158 if (!
isNamed() && !getIsTemplateParam())
175 if (!(References && Targets))
179 dbgs() <<
"\n[LVType::markMissingParents]\n";
181 dbgs() <<
"References: "
185 dbgs() <<
"Targets : "
192 dbgs() <<
"Search Reference: Name = "
205 dbgs() <<
"\n[LVType::findIn]\n"
211 dbgs() <<
"Target : "
212 <<
"Level = " <<
Target->getLevel() <<
", "
227 if (!References && !Targets)
229 if (References && Targets) {
232 getParameters(References, &ReferenceTypes, &ReferenceScopes);
253 if (!
Type->getIsTemplateParam())
255 if (
options().getAttributeArgument()) {
256 if (
Type->getIsKindType())
258 else if (
Type->getIsKindScope())
270 if (!References && !Targets)
272 if (References && Targets && References->
size() == Targets->
size()) {
286 if (getIncludeInPrint() &&
287 (getIsReference() ||
getReader().doPrintType(
this))) {
309 assert(
Type &&
"Type definition does not have a type.");
312 while (
Type->getIsTypedef()) {
335 if (
options().getAttributeUnderlying()) {
337 setIsTypedefReduced();
348 if (Aggregate && Aggregate->getIsAnonymous())
393 options().getAttributeTypename() ? setIncludeInPrint()
394 : resetIncludeInPrint();
415 if (getIsTemplateTypeParam()) {
426 if (ArgType->getIsTypedef()) {
437 if (ArgScope->getIsTemplate())
456 if (getIsTemplateTypeParam() &&
Type->getIsTemplateTypeParam())
459 if ((getIsTemplateValueParam() &&
Type->getIsTemplateValueParam()) ||
460 (getIsTemplateTemplateParam() &&
Type->getIsTemplateTemplateParam()))
472 if (getIsTemplateTypeParam()) {
476 if (getIsTemplateValueParam()) {
480 if (getIsTemplateTemplateParam())
505 if (getIsSubrangeCount())
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Pass interface - Implemented by all 'passes'.
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
Target - Wrapper for Target specific information.
const char * getName() const
getName - Get the target name.
The instances of the Type class are immutable: once they are created, they are never changed.
void printItem(LVElement *Element, LVComparePass Pass)
void resolveFullname(LVElement *BaseType, StringRef Name=emptyString())
virtual void resolveName()
StringRef virtualityString(uint32_t Virtuality=dwarf::DW_VIRTUALITY_none) const
bool getIsKindScope() const
void setName(StringRef ElementName) override
StringRef getName() const override
LVType * getTypeAsType() const
LVElement * getType() const
void setFile(LVElement *Reference=nullptr)
StringRef getTypeName() const
StringRef getTypeQualifiedName() const
bool getIsKindType() const
StringRef accessibilityString(uint32_t Access=dwarf::DW_ACCESS_private) const
bool equals(const LVElement *Element) const
std::string typeOffsetAsString() const
bool isNamed() const override
LVScope * getTypeAsScope() const
virtual void print(raw_ostream &OS, bool Full=true) const
void resolvePatternMatch(LVLine *Line)
void incrementPrintedTypes()
void encodeTemplateArguments(std::string &Name) const
virtual bool equals(const LVScope *Scope) const
void setUnderlyingType(LVElement *Element) override
bool equals(const LVType *Type) const override
void resolveExtra() override
void printExtra(raw_ostream &OS, bool Full=true) const override
LVElement * getUnderlyingType() override
void printExtra(raw_ostream &OS, bool Full=true) const override
StringRef getValue() const override
bool equals(const LVType *Type) const override
void printExtra(raw_ostream &OS, bool Full=true) const override
bool equals(const LVType *Type) const override
size_t getValueIndex() const override
void printExtra(raw_ostream &OS, bool Full=true) const override
void encodeTemplateArgument(std::string &Name) const override
bool equals(const LVType *Type) const override
StringRef getValue() const override
void resolveExtra() override
int64_t getUpperBound() const override
void printExtra(raw_ostream &OS, bool Full=true) const override
int64_t getCount() const override
bool equals(const LVType *Type) const override
int64_t getLowerBound() const override
void resolveReferences() override
virtual bool equals(const LVType *Type) const
void report(LVComparePass Pass) override
void printExtra(raw_ostream &OS, bool Full=true) const override
static bool parametersMatch(const LVTypes *References, const LVTypes *Targets)
StringRef resolveReferencesChain()
void resolveName() override
const char * kind() const override
static void getParameters(const LVTypes *Types, LVTypes *TypesParam, LVScopes *ScopesParam)
virtual LVElement * getUnderlyingType()
void print(raw_ostream &OS, bool Full=true) const override
static void markMissingParents(const LVTypes *References, const LVTypes *Targets)
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
std::string formattedNames(StringRef Name1, StringRef Name2)
@ IsTemplateTemplateParam
std::string formattedKind(StringRef Kind)
LVScopeCompileUnit * getReaderCompileUnit()
std::string formattedName(StringRef Name)
std::string formatAttributes(const StringRef First, Args... Others)
LVCompare & getComparator()
std::map< LVTypeKind, LVTypeGetFunction > LVTypeDispatch
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.