@@ -241,17 +241,20 @@ DIBasicType *DIBuilder::createBasicType(StringRef Name, uint64_t SizeInBits,
241
241
242
242
DIDerivedType *DIBuilder::createQualifiedType (unsigned Tag, DIType *FromTy) {
243
243
return DIDerivedType::get (VMContext, Tag, " " , nullptr , 0 , nullptr , FromTy, 0 ,
244
- 0 , 0 , DINode::FlagZero);
244
+ 0 , 0 , None, DINode::FlagZero);
245
245
}
246
246
247
- DIDerivedType *DIBuilder::createPointerType (DIType *PointeeTy,
248
- uint64_t SizeInBits,
249
- uint32_t AlignInBits,
250
- StringRef Name) {
247
+ DIDerivedType *DIBuilder::createPointerType (
248
+ DIType *PointeeTy,
249
+ uint64_t SizeInBits,
250
+ uint32_t AlignInBits,
251
+ Optional<unsigned > DWARFAddressSpace,
252
+ StringRef Name) {
251
253
// FIXME: Why is there a name here?
252
254
return DIDerivedType::get (VMContext, dwarf::DW_TAG_pointer_type, Name,
253
255
nullptr , 0 , nullptr , PointeeTy, SizeInBits,
254
- AlignInBits, 0 , DINode::FlagZero);
256
+ AlignInBits, 0 , DWARFAddressSpace,
257
+ DINode::FlagZero);
255
258
}
256
259
257
260
DIDerivedType *DIBuilder::createMemberPointerType (DIType *PointeeTy,
@@ -261,38 +264,41 @@ DIDerivedType *DIBuilder::createMemberPointerType(DIType *PointeeTy,
261
264
DINode::DIFlags Flags) {
262
265
return DIDerivedType::get (VMContext, dwarf::DW_TAG_ptr_to_member_type, " " ,
263
266
nullptr , 0 , nullptr , PointeeTy, SizeInBits,
264
- AlignInBits, 0 , Flags, Base);
267
+ AlignInBits, 0 , None, Flags, Base);
265
268
}
266
269
267
- DIDerivedType *DIBuilder::createReferenceType (unsigned Tag, DIType *RTy,
268
- uint64_t SizeInBits,
269
- uint32_t AlignInBits) {
270
+ DIDerivedType *DIBuilder::createReferenceType (
271
+ unsigned Tag, DIType *RTy,
272
+ uint64_t SizeInBits,
273
+ uint32_t AlignInBits,
274
+ Optional<unsigned > DWARFAddressSpace) {
270
275
assert (RTy && " Unable to create reference type" );
271
276
return DIDerivedType::get (VMContext, Tag, " " , nullptr , 0 , nullptr , RTy,
272
- SizeInBits, AlignInBits, 0 , DINode::FlagZero);
277
+ SizeInBits, AlignInBits, 0 , DWARFAddressSpace,
278
+ DINode::FlagZero);
273
279
}
274
280
275
281
DIDerivedType *DIBuilder::createTypedef (DIType *Ty, StringRef Name,
276
282
DIFile *File, unsigned LineNo,
277
283
DIScope *Context) {
278
284
return DIDerivedType::get (VMContext, dwarf::DW_TAG_typedef, Name, File,
279
285
LineNo, getNonCompileUnitScope (Context), Ty, 0 , 0 ,
280
- 0 , DINode::FlagZero);
286
+ 0 , None, DINode::FlagZero);
281
287
}
282
288
283
289
DIDerivedType *DIBuilder::createFriend (DIType *Ty, DIType *FriendTy) {
284
290
assert (Ty && " Invalid type!" );
285
291
assert (FriendTy && " Invalid friend type!" );
286
292
return DIDerivedType::get (VMContext, dwarf::DW_TAG_friend, " " , nullptr , 0 , Ty,
287
- FriendTy, 0 , 0 , 0 , DINode::FlagZero);
293
+ FriendTy, 0 , 0 , 0 , None, DINode::FlagZero);
288
294
}
289
295
290
296
DIDerivedType *DIBuilder::createInheritance (DIType *Ty, DIType *BaseTy,
291
297
uint64_t BaseOffset,
292
298
DINode::DIFlags Flags) {
293
299
assert (Ty && " Unable to create inheritance" );
294
300
return DIDerivedType::get (VMContext, dwarf::DW_TAG_inheritance, " " , nullptr ,
295
- 0 , Ty, BaseTy, 0 , 0 , BaseOffset, Flags);
301
+ 0 , Ty, BaseTy, 0 , 0 , BaseOffset, None, Flags);
296
302
}
297
303
298
304
DIDerivedType *DIBuilder::createMemberType (DIScope *Scope, StringRef Name,
@@ -303,7 +309,7 @@ DIDerivedType *DIBuilder::createMemberType(DIScope *Scope, StringRef Name,
303
309
DINode::DIFlags Flags, DIType *Ty) {
304
310
return DIDerivedType::get (VMContext, dwarf::DW_TAG_member, Name, File,
305
311
LineNumber, getNonCompileUnitScope (Scope), Ty,
306
- SizeInBits, AlignInBits, OffsetInBits, Flags);
312
+ SizeInBits, AlignInBits, OffsetInBits, None, Flags);
307
313
}
308
314
309
315
static ConstantAsMetadata *getConstantOrNull (Constant *C) {
@@ -320,7 +326,7 @@ DIDerivedType *DIBuilder::createBitFieldMemberType(
320
326
return DIDerivedType::get (
321
327
VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
322
328
getNonCompileUnitScope (Scope), Ty, SizeInBits, /* AlignInBits */ 0 ,
323
- OffsetInBits, Flags,
329
+ OffsetInBits, None, Flags,
324
330
ConstantAsMetadata::get (ConstantInt::get (IntegerType::get (VMContext, 64 ),
325
331
StorageOffsetInBits)));
326
332
}
@@ -333,7 +339,8 @@ DIBuilder::createStaticMemberType(DIScope *Scope, StringRef Name, DIFile *File,
333
339
Flags |= DINode::FlagStaticMember;
334
340
return DIDerivedType::get (VMContext, dwarf::DW_TAG_member, Name, File,
335
341
LineNumber, getNonCompileUnitScope (Scope), Ty, 0 ,
336
- AlignInBits, 0 , Flags, getConstantOrNull (Val));
342
+ AlignInBits, 0 , None, Flags,
343
+ getConstantOrNull (Val));
337
344
}
338
345
339
346
DIDerivedType *
@@ -343,7 +350,7 @@ DIBuilder::createObjCIVar(StringRef Name, DIFile *File, unsigned LineNumber,
343
350
DIType *Ty, MDNode *PropertyNode) {
344
351
return DIDerivedType::get (VMContext, dwarf::DW_TAG_member, Name, File,
345
352
LineNumber, getNonCompileUnitScope (File), Ty,
346
- SizeInBits, AlignInBits, OffsetInBits, Flags,
353
+ SizeInBits, AlignInBits, OffsetInBits, None, Flags,
347
354
PropertyNode);
348
355
}
349
356
0 commit comments