Skip to content

Compiler

John Wilkes edited this page Jun 21, 2020 · 10 revisions

Introduction

The compiler executable is wip.

Usage: wip <filename> [options]

The following options are supported:

-h, --help             Print help message
--arch <value>         Assembly architecture
-d, --debug-info       Generate debug info
--llvm                 Output LLVM IR
--out-type <value>     Type of output: assembly, c-header, tokens, tree
-O <value>             Optimization level: 0, 1, 2
-o, --output <file>    Specify name of output file
-S                     Output assembly as text

The -O option is used to specify one of the following optimization levels:

  • 0 - No optimization (the default)
  • 1 - Basic optimization
  • 2 - Aggressive optimization

Examples

Compile test.wip to an object file:

wip test.wip

Compile test.wip to an object file with optimization enabled:

wip test.wip -O 2

Compile test.wip to an object file with debug info:

wip test.wip -d

Output a C/C++ header for test.wip:

wip test.wip --out-type c-header

Output LLVM IR for test.wip:

wip test.wip --llvm

Clone this wiki locally