# LLVM in the IDE

This page describes what the IDE shows when a project is compiled with LLVM: where the options are, the licence banners, the progress box and the cache. What LLVM is, which options to choose and what the LLVM compiler does not support are in [Getting Started with LLVM](/twinBASIC-docs/LLVM/Getting-Started.md).

## Where the options are

The options are two settings of the **Optimization** group of [Project Settings](/twinBASIC-docs/tB/IDE/Project-Settings.md): [*Compiler Options (BUILD)*](/twinBASIC-docs/tB/IDE/Project-Settings.md#compiler-options-build) and [*Compiler Options (DEBUG)*](/twinBASIC-docs/tB/IDE/Project-Settings.md#compiler-options-debug). Each is a column of tick boxes: **Enable LLVM Compilation**, two for optimization and one for each CPU feature.

- **Build** compiles with the *BUILD* options. The file that it writes is the one compiled with LLVM.
- **Start** (<kbd>F5</kbd>) runs the project with the *DEBUG* options. The IDE cannot debug code that LLVM compiled, so the description of this setting advises against turning LLVM on there.

The IDE has no **Build with LLVM** button. No box of either setting is ticked in a new project.

The **Compiler** group of IDE Options has three more, which belong to the compiler and its cache and are not part of any project: **LLVM - Maximum number of threads**, **LLVM - Complex procedure reporting threshold (milliseconds)**, and **LLVM - Keep cache process alive after exiting the IDE**. A change to any of them restarts the compiler. See [Compiler and LLVM](/twinBASIC-docs/tB/IDE/Customising/IDE-Options.md#compiler-and-llvm).

## The licence banners

LLVM compilation depends on the licence. When the settings dialog is drawn, each of the two settings shows a banner next to the licence badge, if the licence limits it:

- With a **Personal** licence, the banner says that the optimizations apply only to the built-in packages (VB, VBA, VBRUN) and not to your own code, and advises an upgrade to a Professional licence.
- With a **Community** licence, the banner says that the optimizations are not applied, and advises an upgrade to a paid licence.
- With a **Professional** or **Ultimate** licence there is no banner.

The banner follows the licence badge at the moment the dialog opens. [Getting Started with LLVM](/twinBASIC-docs/LLVM/Getting-Started.md#availability) says what each edition gets.

## The progress box
{: #the-progress-box }

When the compiler reports progress, the IDE opens a box titled **Compiling...** with a progress bar, and the compiler can also fill an item of the status bar with the percentage, such as **LLVM: n%**. The box is modal: the IDE cannot be used until it closes, and it closes by itself when the build ends. Which builds report progress is the compiler's choice. A small project compiled with LLVM takes a fraction of a second, so the box is gone almost at once.

![The Compiling... box of an LLVM build, its progress bar at the start.](/twinBASIC-docs/IDE/Building/Images/Compiling.png){:width="302" height="74"}

> [!NOTE] BETA 1045
> If another box opens while **Compiling...** is on screen, the end of the build closes that box instead of the progress box, so the other box is lost. The **Compiling...** box stays, with no button, and the IDE cannot be used. Restart the IDE.

## The cache

The compiler keeps a cache of LLVM code, in a process of its own, so that a later build is faster. **Tools → Flush the LLVM compiler cache** ends that process and restarts the compiler from the project in memory, as the console says with `restarting from MEMORY`. The next build compiles everything again and takes longer. **Restart the compiler**, with <kbd>Alt</kbd> held, restarts the cache process too.

## See Also

- [Getting Started with LLVM](/twinBASIC-docs/LLVM/Getting-Started.md) -- turning LLVM on, the options and what the LLVM compiler does not support
- [Project Settings](/twinBASIC-docs/tB/IDE/Project-Settings.md#compiler-options-build) -- the *Compiler Options* sections
- [IDE Options](/twinBASIC-docs/tB/IDE/Customising/IDE-Options.md#compiler-and-llvm) -- the three LLVM options of the IDE
- [Build and Clean](/twinBASIC-docs/tB/IDE/Building/Build-and-Clean.md) -- the commands that compile
