[Flang-dev] [llvm-dev] RFC: Adding debug information to LLVM to support Fortran
Eric Schweitz (PGI)
eric.schweitz at pgroup.com
Fri Nov 2 15:03:20 EDT 2018
Thanks for your thoughts. You can find the patch here, and I believe it is rather close to what you suggest.
From: Sohail Somani (Fizz Buzz Inc.) via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
Date: Thu, Nov 1, 2018 at 3:35 PM
Subject: Re: [llvm-dev] RFC: Adding debug information to LLVM to support Fortran
To: <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
On Thu, Nov 1, 2018, at 6:27 PM, via llvm-dev wrote:
Regarding flags, I was just thinking that maybe we should invent a new DISubprogramFlags type. DISubprogram already has a few bitfields for subprogram-specific things, Fortran will want 3 more, and there's no reason to fill up the generic DIFlags with more bits that are used in only one class.
I agree that the array stuff needs to be designed with an eye to handling how other languages do arrays, and leverage the common aspects. Several languages have runtime-sized arrays and it would be nice to handle them all the same way.
However the CHARACTER type probably does want to be DW_TAG_string_type rather than an array. COBOL also has strings as a fundamental type.
I guess we'll have to learn what all the Fortran array stuff actually means now…
May I suggest changing DIFlags from an enum to a simple int wrapper that behaves like an enum and can implement encoding? It is true that a lot of the bits are left unused in everyday contexts, so there is a possibility to encode more data.
DIFlags flags = FortranRelatedContext;
flags |= SomeFortranFlag;
So when assigning SomeFortranFlag the appropriate DIFlags operator would assert that the specific context is active.
I’ve had to extend DIFlags and in the end, just increased the size of the data type, but a clever encoding with a non-clever interface would halve memory usage currently used for DIFlags in my circumstance.
Fizz Buzz Inc.
Booking schedule: https://sohailsomani.youcanbook.me
LLVM Developers mailing list
llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the flang-dev