mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 08:30:47 +03:00
Merge pull request #1813 from rainers/cv11
DI: display typeof(null) as void*
This commit is contained in:
commit
ba180bbde2
2 changed files with 31 additions and 29 deletions
|
@ -658,15 +658,15 @@ ldc::DIType ldc::DIBuilder::CreateTypeDescription(Type *type, bool derefclass) {
|
|||
t = type->toBasetype();
|
||||
}
|
||||
|
||||
#if LDC_LLVM_VER >= 309
|
||||
if (t->ty == Tnull)
|
||||
return DBuilder.createNullPtrType();
|
||||
if (t->ty == Tvoid)
|
||||
#if LDC_LLVM_VER >= 309
|
||||
return nullptr;
|
||||
#else
|
||||
if (t->ty == Tvoid || t->ty == Tnull)
|
||||
return DBuilder.createUnspecifiedType(t->toChars());
|
||||
#endif
|
||||
if (t->ty == Tnull) // display null as void*
|
||||
return DBuilder.createPointerType(CreateTypeDescription(Type::tvoid, false),
|
||||
8, 8, "typeof(null)");
|
||||
if (t->ty == Tvector)
|
||||
return CreateVectorType(type);
|
||||
if (t->isintegral() || t->isfloating()) {
|
||||
|
|
|
@ -36,10 +36,11 @@ int basic_types()
|
|||
cfloat cf = 15 + 16i;
|
||||
cdouble cd = 17 + 18i;
|
||||
creal cr = 19 + 20i;
|
||||
typeof(null) np = null;
|
||||
|
||||
c = c;
|
||||
// CDB: ld basictypes_cdb*
|
||||
// CDB: bp `basictypes_cdb.d:39`
|
||||
// CDB: bp `basictypes_cdb.d:41`
|
||||
// CDB: g
|
||||
// CHECK: !basictypes_cdb.basic_types
|
||||
|
||||
|
@ -66,6 +67,7 @@ int basic_types()
|
|||
// CHECK: struct cfloat cf
|
||||
// CHECK: struct cdouble cd
|
||||
// CHECK: struct creal cr
|
||||
// CHECK: void * np = 0x{{[0`]+}}
|
||||
// CDB: ?? cf
|
||||
// CHECK: +0x000 re : 15
|
||||
// CHECK: +0x004 im : 16
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue