comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Refactoring for error: cannot inline "X" (forward instance within enclosing body)
Date: Tue, 26 Jun 2012 10:44:11 +0000 (UTC)
Date: 2012-06-26T10:44:11+00:00	[thread overview]
Message-ID: <jsc3pr$iap$1@dont-email.me> (raw)
In-Reply-To: d651e7c9-e091-42a9-b56b-2502e6fab091@googlegroups.com

On Tue, 26 Jun 2012 00:51:59 -0700, Keean Schupke wrote:

> On Monday, 25 June 2012 20:47:21 UTC+1, Brian Drummond  wrote:
>> On Mon, 25 Jun 2012 06:02:21 -0700, Keean Schupke wrote:
>> 
>> > Hi,
>> > 
>> > 
>> > I am forcing the inlining of some procedures using:
>> > pragma Inline_Always(X);
>> > and I am getting the error:
>> > cannot inline "X" (forward instance within enclosing body)

> Here's the minimal test example (as minimal as I can make it so far...):

This reveals that "some procedures" are (a) generic, and (b) declared in 
a package, and implemented in its body. Neither of these points was clear 
originally.

Now the package is visible while compiling the outer level, but the 
package body is hidden, so it seems reasonable that the implementation of 
the procedure (to be inlined) is not visible. Presumably the "forward 
instance" is an empty space where the implementation has not yet been 
filled in.

Georg points out a workaround : -gnatN performs inline expansion in the 
Gnat front end, which CAN see the package body while compiling the outer 
module. It is not clear to me : is that allowed by the LRM, or is Gnat 
being a little naughty here?

Or has this little example caught a corner case involving generics and 
Inline_Always where Gnat gets it wrong?

- Brian



  parent reply	other threads:[~2012-06-26 10:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 13:02 Refactoring for error: cannot inline "X" (forward instance within enclosing body) Keean Schupke
2012-06-25 13:03 ` Keean Schupke
2012-06-25 19:47 ` Brian Drummond
2012-06-26  7:51   ` Keean Schupke
2012-06-26  9:49     ` Georg Bauhaus
2012-06-26 11:53       ` Keean Schupke
2012-06-26 15:42         ` Keean Schupke
2012-06-26 20:06           ` Keean Schupke
2012-06-26 10:44     ` Brian Drummond [this message]
2012-06-26 22:43       ` Randy Brukardt
2012-06-27 10:04         ` Keean Schupke
2012-06-27 17:26       ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox