diff options
Diffstat (limited to 'compiler/transf.nim')
-rwxr-xr-x | compiler/transf.nim | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/transf.nim b/compiler/transf.nim index 4e799a11f..284958e77 100755 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -244,7 +244,16 @@ proc transformConstSection(c: PTransf, v: PNode): PTransNode = result[i] = PTransNode(b) else: result[i] = PTransNode(it) - + +proc trivialBody(s: PSym): PNode = + # a routine's body is trivially inlinable if marked as 'inline' and its + # body consists of only 1 statement. It is important that we perform this + # optimization here as 'distinct strings' may cause string copying otherwise: + # proc xml(s: string): TXmlString = return xmlstring(s) + # We have to generate a ``nkLineTracking`` node though to not lose + # debug information: + # XXX to implement + nil proc hasContinue(n: PNode): bool = case n.kind |