opt_dead_code {rco}R Documentation

Optimizer: Dead Code Elimination.

Description

Performs one dead code elimination pass. Carefully examine the results after running this function!

Usage

opt_dead_code(texts)

Arguments

texts

A list of character vectors with the code to optimize.

Examples

code <- paste(
  "while (TRUE) {",
  "  break",
  "  dead_code()",
  "}",
  sep = "\n"
)
cat(opt_dead_code(list(code))$codes[[1]])

[Package rco version 1.0.2 Index]