[llvm-bugs] [Bug 36328] New: [DebugInfo] pointless pointer_type

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 9 13:48:49 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36328

            Bug ID: 36328
           Summary: [DebugInfo] pointless pointer_type
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: paul_robinson at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org

It looks like Clang will add 'void *' to the retainedTypes even if
there are no references to it elsewhere in the metadata.

######################
$ cat t.c
void k(void *);
void g() {
  int count = 2;
  k((void *)&count);
}
$ clang -c -g t.c -S -emit-llvm
######################

In the IR, I see:

!0 = distinct !DICompileUnit(..., retainedTypes: !3)
!3 = !{!4}
!4 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)

But there are no other uses of !4.
If I change 'void *' to 'int *' the pointer_type goes away.

Note that k() is not described in the metadata, regardless.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180209/83ff185e/attachment.html>


More information about the llvm-bugs mailing list