[llvm] r186634 - Debug Info: enable verifying by default and disable testing cases that fail.

Duncan Sands baldrick at free.fr
Sat Jul 20 00:18:06 PDT 2013


Hi Eric,

> Swear I've mentioned this before, but no entity requires a DW_AT_name.
> That said, are we sure we should be generating an entity for a
> constant? What's the source look like here?

@0 = internal constant i32 77

...

   call void @build.1554(i32* noalias @0) #3, !dbg !69

...

!41 = metadata !{i32 786484, i32 0, metadata !28, metadata !"", metadata !"", 
metadata !"", metadata !5, i32 4, metadata !9, i32 1, i32 1, i32* @0, null}


from


program main
   implicit none
   call build (77)
contains
   subroutine build (order)
     integer :: order, i, j


     call test (1, order, 3,  (/ (i, i = 1, order, 3) /))
     call test (order, 1, -3, (/ (i, i = order, 1, -3) /))

     do j = -10, 10
       call test (order + j, order, 5,  (/ (i, i = order + j, order, 5) /))
       call test (order + j, order, -5, (/ (i, i = order + j, order, -5) /))
     end do

   end subroutine build

   subroutine test (from, to, step, values)
     integer, dimension (:) :: values
     integer :: from, to, step, last, i

     last = 0
     do i = from, to, step
       last = last + 1
       if (values (last) .ne. i) call abort
     end do
     if (size (values, dim = 1) .ne. last) call abort
   end subroutine test
end program main


Notice "call build (77)" right at the start.  I think the point here is that
Fortran passes everything by reference, so a pointer to 77 has to be passed,
causing this constant to be created.  I have no idea if having debug info for
this constant would be useful when debugging.

Ciao, Duncan.



More information about the llvm-commits mailing list