mirror of
https://github.com/verilator/verilator.git
synced 2026-09-04 08:33:38 +02:00
Internals: Add cloneTreePure to prepare for side effect check.
Use cloneTreePure when what is being cloned must be side-effect free. Use cloneTree when safe to contain side effects (e.g. cloning module).
This commit is contained in:
@@ -767,6 +767,8 @@ protected:
|
||||
// Clone this if into its set of split blocks
|
||||
AstSplitPlaceholder* const if_placeholderp = makePlaceholderp();
|
||||
AstSplitPlaceholder* const else_placeholderp = makePlaceholderp();
|
||||
// We check for condition isPure earlier, but may still clone a
|
||||
// non-pure to separate from other pure statements.
|
||||
AstIf* const clonep = new AstIf{nodep->fileline(), nodep->condp()->cloneTree(true),
|
||||
if_placeholderp, else_placeholderp};
|
||||
const AstIf* const origp = VN_CAST(nodep, If);
|
||||
|
||||
Reference in New Issue
Block a user