[Dwarf-Discuss] name lookup w/ using directives
eager at eagercon.com
Thu Aug 21 14:23:49 PDT 2008
Kendrick Wong wrote:
> I'm not trying to beat a dead horse. :-) Okay, maybe a little, taking it a step further, what about cross compilation
> unit inlining? i.e. something in Fortran compilation unit is inlined into C++ compilation unit, then the language
> for the compilation unit becomes mixed, what is going to happen then? What is the correct way to interpret the
> DW_TAG_imported_module then?
I'm completely in the dark about the semantics of this.
Inlining in languages I'm familiar with (and those supported by DWARF)
are all based on the source. The body of a function is inserted (at
least, conceptually) at the point of the call, with all of the formal
parameters bound to the actual parameters. As a result, there are no
mixed language issues.
Inlining from Fortran into C++ clearly isn't going to be based on the
source. Given the differences in how Fortran and C++ pass parameters,
I'm unclear how parameter binding might occur. What do you do with
C++ references or Fortran value returns.
> Is it the intention to have DW_TAG_imported_module carry DW_AT_language, so that consumer can decide which semantic
> to use?
The short answer is no, there is no intention to do that.
But the longer answer is that DWARF is a permissive and extendable
specification. If you need to extend DWARF by using an attribute
on a TAG DIE which would not normally have that attribute, you are
free to do so. It you need to create a new attribute, you can add
a new one. The only restriction is that you should not create an
extension which duplicates existing DWARF functionality.
Michael Eager eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
More information about the Dwarf-Discuss