@@ -2131,9 +2131,11 @@ class DIModule : public DIScope {
21312131// / Base class for template parameters.
21322132class DITemplateParameter : public DINode {
21332133protected:
2134+ bool IsDefault;
2135+
21342136 DITemplateParameter (LLVMContext &Context, unsigned ID, StorageType Storage,
2135- unsigned Tag, ArrayRef<Metadata *> Ops)
2136- : DINode(Context, ID, Storage, Tag, Ops) {}
2137+ unsigned Tag, bool IsDefault, ArrayRef<Metadata *> Ops)
2138+ : DINode(Context, ID, Storage, Tag, Ops), IsDefault(IsDefault) {}
21372139 ~DITemplateParameter () = default ;
21382140
21392141public:
@@ -2142,6 +2144,7 @@ class DITemplateParameter : public DINode {
21422144
21432145 MDString *getRawName () const { return getOperandAs<MDString>(0 ); }
21442146 Metadata *getRawType () const { return getOperand (1 ); }
2147+ bool isDefault () const { return IsDefault; }
21452148
21462149 static bool classof (const Metadata *MD) {
21472150 return MD->getMetadataID () == DITemplateTypeParameterKind ||
@@ -2154,30 +2157,35 @@ class DITemplateTypeParameter : public DITemplateParameter {
21542157 friend class MDNode ;
21552158
21562159 DITemplateTypeParameter (LLVMContext &Context, StorageType Storage,
2157- ArrayRef<Metadata *> Ops)
2160+ bool IsDefault, ArrayRef<Metadata *> Ops)
21582161 : DITemplateParameter(Context, DITemplateTypeParameterKind, Storage,
2159- dwarf::DW_TAG_template_type_parameter, Ops) {}
2162+ dwarf::DW_TAG_template_type_parameter, IsDefault,
2163+ Ops) {}
21602164 ~DITemplateTypeParameter () = default ;
21612165
21622166 static DITemplateTypeParameter *getImpl (LLVMContext &Context, StringRef Name,
2163- DIType *Type, StorageType Storage,
2167+ DIType *Type, bool IsDefault,
2168+ StorageType Storage,
21642169 bool ShouldCreate = true ) {
2165- return getImpl (Context, getCanonicalMDString (Context, Name), Type, Storage,
2166- ShouldCreate);
2170+ return getImpl (Context, getCanonicalMDString (Context, Name), Type,
2171+ IsDefault, Storage, ShouldCreate);
21672172 }
21682173 static DITemplateTypeParameter *getImpl (LLVMContext &Context, MDString *Name,
2169- Metadata *Type, StorageType Storage,
2174+ Metadata *Type, bool IsDefault,
2175+ StorageType Storage,
21702176 bool ShouldCreate = true );
21712177
21722178 TempDITemplateTypeParameter cloneImpl () const {
2173- return getTemporary (getContext (), getName (), getType ());
2179+ return getTemporary (getContext (), getName (), getType (), isDefault () );
21742180 }
21752181
21762182public:
2177- DEFINE_MDNODE_GET (DITemplateTypeParameter, (StringRef Name, DIType *Type),
2178- (Name, Type))
2179- DEFINE_MDNODE_GET (DITemplateTypeParameter, (MDString * Name, Metadata *Type),
2180- (Name, Type))
2183+ DEFINE_MDNODE_GET (DITemplateTypeParameter,
2184+ (StringRef Name, DIType *Type, bool IsDefault),
2185+ (Name, Type, IsDefault))
2186+ DEFINE_MDNODE_GET (DITemplateTypeParameter,
2187+ (MDString *Name, Metadata *Type, bool IsDefault),
2188+ (Name, Type, IsDefault))
21812189
21822190 TempDITemplateTypeParameter clone () const { return cloneImpl (); }
21832191
@@ -2191,36 +2199,40 @@ class DITemplateValueParameter : public DITemplateParameter {
21912199 friend class MDNode ;
21922200
21932201 DITemplateValueParameter (LLVMContext &Context, StorageType Storage,
2194- unsigned Tag, ArrayRef<Metadata *> Ops)
2202+ unsigned Tag, bool IsDefault,
2203+ ArrayRef<Metadata *> Ops)
21952204 : DITemplateParameter(Context, DITemplateValueParameterKind, Storage, Tag,
2196- Ops) {}
2205+ IsDefault, Ops) {}
21972206 ~DITemplateValueParameter () = default ;
21982207
21992208 static DITemplateValueParameter *getImpl (LLVMContext &Context, unsigned Tag,
22002209 StringRef Name, DIType *Type,
2201- Metadata *Value, StorageType Storage,
2210+ bool IsDefault, Metadata *Value,
2211+ StorageType Storage,
22022212 bool ShouldCreate = true ) {
22032213 return getImpl (Context, Tag, getCanonicalMDString (Context, Name), Type,
2204- Value, Storage, ShouldCreate);
2214+ IsDefault, Value, Storage, ShouldCreate);
22052215 }
22062216 static DITemplateValueParameter *getImpl (LLVMContext &Context, unsigned Tag,
22072217 MDString *Name, Metadata *Type,
2208- Metadata *Value, StorageType Storage,
2218+ bool IsDefault, Metadata *Value,
2219+ StorageType Storage,
22092220 bool ShouldCreate = true );
22102221
22112222 TempDITemplateValueParameter cloneImpl () const {
22122223 return getTemporary (getContext (), getTag (), getName (), getType (),
2213- getValue ());
2224+ isDefault (), getValue ());
22142225 }
22152226
22162227public:
22172228 DEFINE_MDNODE_GET (DITemplateValueParameter,
2218- (unsigned Tag, StringRef Name, DIType *Type,
2229+ (unsigned Tag, StringRef Name, DIType *Type, bool IsDefault,
22192230 Metadata *Value),
2220- (Tag, Name, Type, Value))
2221- DEFINE_MDNODE_GET (DITemplateValueParameter, (unsigned Tag, MDString *Name,
2222- Metadata *Type, Metadata *Value),
2223- (Tag, Name, Type, Value))
2231+ (Tag, Name, Type, IsDefault, Value))
2232+ DEFINE_MDNODE_GET (DITemplateValueParameter,
2233+ (unsigned Tag, MDString *Name, Metadata *Type,
2234+ bool IsDefault, Metadata *Value),
2235+ (Tag, Name, Type, IsDefault, Value))
22242236
22252237 TempDITemplateValueParameter clone () const { return cloneImpl (); }
22262238
0 commit comments