setPreservesCFG

Dear All,

Does the setPreservesCFG() call for passes indicate that the CFG in the
local function does not change or that the global CFG does not change?

In other words, can a pass call setPreservesCFG() if it adds call
instructions to a function?

Thanks in advance.

-- John T.

Dear All,

Does the setPreservesCFG() call for passes indicate that the CFG in the
local function does not change or that the global CFG does not change?

The CFG in this context is just the per-function CFG. "setPreservesCFG" can only be used meaninfully for FunctionPasses.

In other words, can a pass call setPreservesCFG() if it adds call
instructions to a function?

Adding a call does not modify the per-function CFG. Adding an invoke does.

-Chris

Dear Chris,

Thanks!

-- John T.