Skip to content

Commit

Permalink
Add experimental cli flag to generate lifetime markers
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer committed Jun 16, 2024
1 parent e4de7f8 commit e74dacd
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .run/spice run.run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="spice run" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="run -O0 -d -ir ../../media/test-project/test.spice" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Spice" TARGET_NAME="spice" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="Spice" RUN_TARGET_NAME="spice">
<configuration default="false" name="spice run" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="run -O1 -d -ir ../../media/test-project/test.spice" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Spice" TARGET_NAME="spice" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="Spice" RUN_TARGET_NAME="spice">
<envs>
<env name="LLVM_ADDITIONAL_FLAGS" value="-lole32 -lws2_32" />
<env name="LLVM_BUILD_INCLUDE_DIR" value="$PROJECT_DIR$/../llvm-project-latest/build/include" />
Expand Down
47 changes: 24 additions & 23 deletions docs/docs/cli/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,27 @@ The `build` subcommand can be used to compile your Spice project to an executabl
## Options
You can apply following options to the `build` subcommand:

| Option | Long | Description |
|--------------|----------------------|-----------------------------------------------------------------------------------------------------------------|
| `-d` | `--debug-output` | Print compiler output for debugging. |
| `-cst` | `--dump-cst` | Dump CST as serialized string and SVG image |
| `-ast` | `--dump-ast` | Dump AST as serialized string and SVG image |
| `-symtab` | `--dump-symtab` | Dump serialized symbol tables |
| `-types` | `--dump-types` | Dump all used types |
| `-ir` | `--dump-ir` | Dump LLVM-IR |
| `-s`, `-asm` | `--dump-assembly` | Dump Assembly code |
| `-b`, `-obj` | `--dump-object-file` | Dump object files |
| - | `--dump-to-files` | Redirect all dumps to files instead of printing them to the screen |
| - | `--abort-after-dump` | Abort the compilation process after dumping the first requested resource |
| `-j <n>` | `--jobs <n>` | Set number of jobs to parallelize compilation (default is auto) |
| `-t` | `--target` | Target triple for the emitted executable (for cross-compiling). <br> Format: `<arch><sub>-<vendor>-<sys>-<abi>` |
| `-o` | `--output` | Set path for executable output. |
| `-O<n>` | - | Set optimization level. <br> Valid options: `-O0`, `-O1`, `-O2`, `-O3`, `-Os`, `-Oz` |
| `-m` | `--build-mode` | Controls the build mode. Valid values are `debug`, `release` and `test`. |
| `-lto` | - | Enable link-time-optimization |
| `-g` | `--debug-info` | Generate debug info to debug the executable in GDB, etc. |
| - | `--static` | Produce stand-alone executable by linking statically |
| - | `--no-entry` | Do not require or generate main function (useful for web assembly target) |
| - | `--disable-verifier` | Disable LLVM module and function verification (only recommended for debugging the compiler) |
| - | `--ignore-cache` | Compile always and ignore the compile cache |
| Option | Long | Description |
|--------------|----------------------------|-----------------------------------------------------------------------------------------------------------------|
| `-d` | `--debug-output` | Print compiler output for debugging. |
| `-cst` | `--dump-cst` | Dump CST as serialized string and SVG image |
| `-ast` | `--dump-ast` | Dump AST as serialized string and SVG image |
| `-symtab` | `--dump-symtab` | Dump serialized symbol tables |
| `-types` | `--dump-types` | Dump all used types |
| `-ir` | `--dump-ir` | Dump LLVM-IR |
| `-s`, `-asm` | `--dump-assembly` | Dump Assembly code |
| `-b`, `-obj` | `--dump-object-file` | Dump object files |
| - | `--dump-to-files` | Redirect all dumps to files instead of printing them to the screen |
| - | `--abort-after-dump` | Abort the compilation process after dumping the first requested resource |
| `-j <n>` | `--jobs <n>` | Set number of jobs to parallelize compilation (default is auto) |
| `-t` | `--target` | Target triple for the emitted executable (for cross-compiling). <br> Format: `<arch><sub>-<vendor>-<sys>-<abi>` |
| `-o` | `--output` | Set path for executable output. |
| `-O<n>` | - | Set optimization level. <br> Valid options: `-O0`, `-O1`, `-O2`, `-O3`, `-Os`, `-Oz` |
| `-m` | `--build-mode` | Controls the build mode. Valid values are `debug`, `release` and `test`. |
| `-lto` | - | Enable link-time-optimization |
| `-g` | `--debug-info` | Generate debug info to debug the executable in GDB, etc. |
| - | `--static` | Produce stand-alone executable by linking statically |
| - | `--no-entry` | Do not require or generate main function (useful for web assembly target) |
| - | `--disable-verifier` | Disable LLVM module and function verification (only recommended for debugging the compiler) |
| - | `--ignore-cache` | Compile always and ignore the compile cache |
| - | `--use-lifetime-markers` | Generate lifetime markers to enhance optimizations |
33 changes: 17 additions & 16 deletions docs/docs/cli/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ The `install` subcommand can be used to compile your Spice project to an executa
## Options
You can apply following options to the `install` subcommand:

| Option | Long | Description |
|--------------|----------------------|--------------------------------------------------------------------------------------|
| `-d` | `--debug-output` | Print compiler output for debugging. |
| `-cst` | `--dump-cst` | Dump CST as serialized string and SVG image |
| `-ast` | `--dump-ast` | Dump AST as serialized string and SVG image |
| `-symtab` | `--dump-symtab` | Dump serialized symbol tables |
| `-types` | `--dump-types` | Dump all used types |
| `-ir` | `--dump-ir` | Dump LLVM-IR |
| `-s`, `-asm` | `--dump-assembly` | Dump Assembly code |
| `-b`, `-obj` | `--dump-object-file` | Dump object files |
| `-d` | `--debug-output` | Print compiler output for debugging. |
| `-j <n>` | `--jobs <n>` | Set number of jobs to parallelize compilation (Default is auto) |
| `-o` | `--output` | Set path for executable output. |
| `-O<n>` | - | Set optimization level. <br> Valid options: `-O0`, `-O1`, `-O2`, `-O3`, `-Os`, `-Oz` |
| `-m` | `--build-mode` | Controls the build mode. Valid values are `debug` and `release` |
| - | `--ignore-cache` | Compile always and ignore the compile cache |
| Option | Long | Description |
|--------------|----------------------------|--------------------------------------------------------------------------------------|
| `-d` | `--debug-output` | Print compiler output for debugging. |
| `-cst` | `--dump-cst` | Dump CST as serialized string and SVG image |
| `-ast` | `--dump-ast` | Dump AST as serialized string and SVG image |
| `-symtab` | `--dump-symtab` | Dump serialized symbol tables |
| `-types` | `--dump-types` | Dump all used types |
| `-ir` | `--dump-ir` | Dump LLVM-IR |
| `-s`, `-asm` | `--dump-assembly` | Dump Assembly code |
| `-b`, `-obj` | `--dump-object-file` | Dump object files |
| `-d` | `--debug-output` | Print compiler output for debugging. |
| `-j <n>` | `--jobs <n>` | Set number of jobs to parallelize compilation (Default is auto) |
| `-o` | `--output` | Set path for executable output. |
| `-O<n>` | - | Set optimization level. <br> Valid options: `-O0`, `-O1`, `-O2`, `-O3`, `-Os`, `-Oz` |
| `-m` | `--build-mode` | Controls the build mode. Valid values are `debug` and `release` |
| - | `--ignore-cache` | Compile always and ignore the compile cache |
| - | `--use-lifetime-markers` | Generate lifetime markers to enhance optimizations |
35 changes: 18 additions & 17 deletions docs/docs/cli/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ The `run` subcommand can be used to compile your Spice project to an executable
## Options
You can apply following options to the `run` subcommand:

| Option | Long | Description |
|--------------|----------------------|---------------------------------------------------------------------------------------------|
| `-d` | `--debug-output` | Print compiler output for debugging. |
| `-cst` | `--dump-cst` | Dump CST as serialized string and SVG image |
| `-ast` | `--dump-ast` | Dump AST as serialized string and SVG image |
| `-symtab` | `--dump-symtab` | Dump serialized symbol tables |
| `-types` | `--dump-types` | Dump all used types |
| `-ir` | `--dump-ir` | Dump LLVM-IR |
| `-s`, `-asm` | `--dump-assembly` | Dump Assembly code |
| `-b`, `-obj` | `--dump-object-file` | Dump object files |
| `-j <n>` | `--jobs <n>` | Set number of jobs to parallelize compilation (default is auto) |
| `-o` | `--output` | Set path for executable output. |
| `-O<x>` | - | Set optimization level. <br> Valid options: `-O0`, `-O1`, `-O2`, `-O3`, `-Os`, `-Oz` |
| `-m` | `--build-mode` | Controls the build mode. Valid values are `debug` and `release` |
| `-g` | `--debug-info` | Generate debug info to debug the executable in GDB, etc. |
| - | `--disable-verifier` | Disable LLVM module and function verification (only recommended for debugging the compiler) |
| - | `--ignore-cache` | Compile always and ignore the compile cache |
| Option | Long | Description |
|--------------|----------------------------|---------------------------------------------------------------------------------------------|
| `-d` | `--debug-output` | Print compiler output for debugging. |
| `-cst` | `--dump-cst` | Dump CST as serialized string and SVG image |
| `-ast` | `--dump-ast` | Dump AST as serialized string and SVG image |
| `-symtab` | `--dump-symtab` | Dump serialized symbol tables |
| `-types` | `--dump-types` | Dump all used types |
| `-ir` | `--dump-ir` | Dump LLVM-IR |
| `-s`, `-asm` | `--dump-assembly` | Dump Assembly code |
| `-b`, `-obj` | `--dump-object-file` | Dump object files |
| `-j <n>` | `--jobs <n>` | Set number of jobs to parallelize compilation (default is auto) |
| `-o` | `--output` | Set path for executable output. |
| `-O<x>` | - | Set optimization level. <br> Valid options: `-O0`, `-O1`, `-O2`, `-O3`, `-Os`, `-Oz` |
| `-m` | `--build-mode` | Controls the build mode. Valid values are `debug` and `release` |
| `-g` | `--debug-info` | Generate debug info to debug the executable in GDB, etc. |
| - | `--disable-verifier` | Disable LLVM module and function verification (only recommended for debugging the compiler) |
| - | `--ignore-cache` | Compile always and ignore the compile cache |
| - | `--use-lifetime-markers` | Generate lifetime markers to enhance optimizations |

0 comments on commit e74dacd

Please sign in to comment.