Question about 'isUnsignedDIType' function on DwarfUnit.cpp

Hi All,

I have question about 'isUnsignedDIType' function on

When we want to generate object file with dwarf debug format, clang
can generates 'DW_ATE_lo_user' encoding for complex integer type as

llvm::DIType *CGDebugInfo::CreateType(const ComplexType *Ty) {
  if (Ty->isComplexIntegerType())
    Encoding = llvm::dwarf::DW_ATE_lo_user;

There is a assert for DIBasicType's enconding in the
'isUnsignedDIType' function and it generates assertion for
'DW_ATE_lo_user'. Is it intended? I think it should not generate
assertion for 'DW_ATE_lo_user' because it comes from complex integer
type. How do you think about it? If I missed something, please let me

JinGu Kang

+llvm-dev which got lost somehow

Hi Paul,

Ah... You are right! It is my mistake. I am implementing new backend
on llvm and clang 3.7.0. I thought the mechanism of debugging
information is same between 3.7.0 and trunk. When I look at trunk, it
seems to pass the problem.

I used following example.

int err;

__complex__ int ctest_int (__complex__ int x)
   __complex__ int res;
   res = ~x;
   return res;

void test_int (void)
  __complex__ int res, x;
  x = 1.0 + 2.0i;
  res = ctest_int (x);
  if (res != 1.0 - 2.0i) {
    printf ("test_" "int" " failed\n");

When above example is compiled with '-g' option and my target, Codeden
constructs VariableDIE with following DBG_VALUE and DIBasicType.

DBG_VALUE 1, 0, !"res", <!32>; line no:12
!DIBasicType(name: "complex", size: 64, align: 32, encoding: 128)

llvm-3.7.0 tried to add constant value directly and it generated
assertion on 'isUnsignedDIType' function as I mentioned on previous
e-mail. But trunk checks whether there is DBG_VALUE or not. Therefore,
I think trunk could pass the problem.

JinGu Kang