added MV_CFF, MV_OMIT_CFF & MV_OMIT_VM macros
This commit is contained in:
31
content/docs/macros/MV_CFF.md
Normal file
31
content/docs/macros/MV_CFF.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
weight: 100
|
||||
title: "MV_CFF"
|
||||
description: "Force a CFF pass"
|
||||
icon: "code_blocks"
|
||||
date: "2025-05-01T18:47:58-05:00"
|
||||
lastmod: "2025-05-01T18:47:58-05:00"
|
||||
---
|
||||
|
||||
`declare function MV_CFF<A..., R...>(vmFunction: (A...) -> R..., enableExpressionDecomposition?: boolean): (A...) -> R...`
|
||||
|
||||
will force the [CFF](/docs/options/flatten-control-flow) pass onto the passed function. Expression decomposition is enabled by default, but can be disabled with the second argument.
|
||||
|
||||
## Valid Usage
|
||||
|
||||
```lua
|
||||
MV_CFF(function()
|
||||
for i = 0, 10 do
|
||||
print('this is flattened!', i)
|
||||
end
|
||||
MV_OMIT_CFF(function() print('this isnt') end)()
|
||||
end)()
|
||||
|
||||
-- passing false as a second argument will disable expression decomposition, leading to much smaller output
|
||||
MV_CFF(function()
|
||||
for i = 0, 10 do
|
||||
print('this is flattened!', i)
|
||||
end
|
||||
MV_OMIT_CFF(function() print('this isnt') end)()
|
||||
end, false)()
|
||||
```
|
Reference in New Issue
Block a user