[Bug 73] Functions used to initialize variables are not inlined.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Mar 25 10:01:12 PST 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=73
------- Comment #2 from godaves at yahoo.com 2006-03-25 12:01 -------
(In reply to comment #1)
> There's a comment in inline.c for DeclarationExp's saying:
>
> // Should scan variable initializers
>
> But it isn't happening right now. Adding a basic scan of the ExpInitializer
> (if present) the same way DeclarationExp::inlineCost works seems to resolve
> this, but considering how trivial that is... I can't help but expect that
> there's more to it than just that.
>
I've noticed that too and agree there must be more to it for some cases. But
couldn't that just be re-written by the compiler as two expressions and then
inlined?
int i = foo(); => int i; i = foo(); => doInline();
Are there cases where that wouldn't be semantically identical?
Thanks,
- Dave
> -[Unknown]
--
More information about the Digitalmars-d-bugs
mailing list