Skip to content

Commit

Permalink
pragma inline: always
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Oct 6, 2023
1 parent c867aaa commit 6ed2b11
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Juvix.Compiler.Core.Transformation.Optimize.MandatoryInlining where

import Juvix.Compiler.Core.Extra
import Juvix.Compiler.Core.Transformation.Base

convertNode :: InfoTable -> Node -> Node
convertNode tab = dmap go
where
go :: Node -> Node
go node = case node of
NIdt Ident {..}
| Just InlineAlways <- lookupIdentifierInfo tab _identSymbol ^. identifierPragmas . pragmasInline ->
lookupIdentifierNode tab _identSymbol
_ ->
node

mandatoryInlining :: InfoTable -> InfoTable
mandatoryInlining tab = mapAllNodes (convertNode tab) tab

0 comments on commit 6ed2b11

Please sign in to comment.