# arm/arm-toolchain architecture

> Architecture diagram of the GitHub repository arm/arm-toolchain, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arm/arm-toolchain
- Repository: https://github.com/arm/arm-toolchain

## Overview

This is an LLVM-based Arm toolchain fork for building C and C++ toolchains targeting bare-metal Arm and native AArch64 Linux. The tree also contains substantial LLVM products such as BOLT and Clang tooling. The graph highlights these product areas and the sampled Static Analyzer workflow; source excerpts are limited, so relationships between unsampled subsystems are not inferred.

Main entry points: [`arm-software/embedded`](https://github.com/arm/arm-toolchain/tree/arm-software/arm-software/embedded) (Embedded toolchain), [`clang/lib/StaticAnalyzer/Core/ExprEngine.cpp`](https://github.com/arm/arm-toolchain/blob/arm-software/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp) (Path analysis), [`clang-tools-extra/clang-query/Query.cpp`](https://github.com/arm/arm-toolchain/blob/arm-software/clang-tools-extra/clang-query/Query.cpp) (AST query tool), [`clang/include/clang/AST/Decl.h`](https://github.com/arm/arm-toolchain/blob/arm-software/clang/include/clang/AST/Decl.h) (AST model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clang["Clang frontend and analysis"]
  node_clang_ast["AST model<br/>[Decl.h]"]
  node_clang_preprocessor["Preprocessor<br/>[Preprocessor.h]"]
  node_analyzer_engine["Path analysis<br/>[ExprEngine.cpp]"]
  node_checker_manager["Checker dispatch<br/>[CheckerManager.h]"]
  node_bug_reports["Bug reporting<br/>[BugReporter.h]"]
end

subgraph group_bolt["BOLT binary optimization"]
  node_bolt_driver["BOLT driver<br/>[llvm-bolt.cpp]"]
  node_bolt_pass_manager["Binary pass manager"]
  node_bolt_profiles["Profile processing<br/>[DataAggregator.cpp]"]
  node_bolt_rewriter["Binary rewriting"]
end

subgraph group_tooling["Clang developer tools"]
  node_clang_query["AST query tool<br/>[Query.cpp]"]
  node_include_fixer["Include fixer<br/>[IncludeFixer.cpp]"]
  node_clang_tidy["Lint framework<br/>[ClangTidy.cpp]"]
end

subgraph group_embedded["Embedded support"]
  node_embedded_product["Embedded toolchain"]
  node_embedded_startup["Startup support<br/>[bootcode.cpp]"]
  node_embedded_semihost["Semihosting<br/>[semihost.cpp]"]
  node_elf_converter["ELF conversion<br/>[elf2bin.cpp]"]
end

subgraph group_linux["Linux runtime support"]
  node_linux_product["Linux toolchain"]
  node_libc_types["libc interfaces"]
  node_compiler_runtime["Compiler runtime<br/>[ubsan_handlers.cpp]"]
end

node_engineer(("Toolchain user"))

node_engineer -->|"targets"| node_embedded_product
node_engineer -->|"targets"| node_linux_product
node_analyzer_engine -->|"dispatches checks"| node_checker_manager
node_clang_query -->|"queries ASTs"| node_clang_ast
node_embedded_product -.->|"includes startup support"| node_embedded_startup
node_embedded_product -.->|"offers semihosting"| node_embedded_semihost
node_embedded_product -.->|"offers ELF conversion"| node_elf_converter

click node_embedded_product "https://github.com/arm/arm-toolchain/tree/arm-software/arm-software/embedded"
click node_linux_product "https://github.com/arm/arm-toolchain/tree/arm-software/arm-software/linux"
click node_clang_ast "https://github.com/arm/arm-toolchain/blob/arm-software/clang/include/clang/AST/Decl.h"
click node_clang_preprocessor "https://github.com/arm/arm-toolchain/blob/arm-software/clang/include/clang/Lex/Preprocessor.h"
click node_analyzer_engine "https://github.com/arm/arm-toolchain/blob/arm-software/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp"
click node_checker_manager "https://github.com/arm/arm-toolchain/blob/arm-software/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h"
click node_bug_reports "https://github.com/arm/arm-toolchain/blob/arm-software/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
click node_bolt_driver "https://github.com/arm/arm-toolchain/blob/arm-software/bolt/tools/driver/llvm-bolt.cpp"
click node_bolt_pass_manager "https://github.com/arm/arm-toolchain/blob/arm-software/bolt/lib/Rewrite/BinaryPassManager.cpp"
click node_bolt_profiles "https://github.com/arm/arm-toolchain/blob/arm-software/bolt/lib/Profile/DataAggregator.cpp"
click node_bolt_rewriter "https://github.com/arm/arm-toolchain/blob/arm-software/bolt/lib/Rewrite/RewriteInstance.cpp"
click node_clang_query "https://github.com/arm/arm-toolchain/blob/arm-software/clang-tools-extra/clang-query/Query.cpp"
click node_include_fixer "https://github.com/arm/arm-toolchain/blob/arm-software/clang-tools-extra/clang-include-fixer/IncludeFixer.cpp"
click node_clang_tidy "https://github.com/arm/arm-toolchain/blob/arm-software/clang-tools-extra/clang-tidy/ClangTidy.cpp"
click node_embedded_startup "https://github.com/arm/arm-toolchain/blob/arm-software/arm-software/embedded/llvmlibc-support/crt0/bootcode.cpp"
click node_embedded_semihost "https://github.com/arm/arm-toolchain/blob/arm-software/arm-software/embedded/llvmlibc-support/semihost/semihost.cpp"
click node_elf_converter "https://github.com/arm/arm-toolchain/blob/arm-software/arm-software/shared/elf2bin/elf2bin.cpp"
click node_libc_types "https://github.com/arm/arm-toolchain/blob/arm-software/libc/include/llvm-libc-types/struct_sockaddr_storage.h"
click node_compiler_runtime "https://github.com/arm/arm-toolchain/blob/arm-software/compiler-rt/lib/ubsan/ubsan_handlers.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_clang_ast,node_clang_preprocessor,node_analyzer_engine,node_checker_manager,node_bug_reports,node_engineer toneBlue
class node_bolt_driver,node_bolt_pass_manager,node_bolt_profiles,node_bolt_rewriter toneAmber
class node_clang_query,node_include_fixer,node_clang_tidy toneMint
class node_embedded_product,node_embedded_startup,node_embedded_semihost,node_elf_converter toneRose
class node_linux_product,node_libc_types,node_compiler_runtime toneIndigo
```

## Components

### Clang frontend and analysis

- [AST model](https://github.com/arm/arm-toolchain/blob/arm-software/clang/include/clang/AST/Decl.h): `clang/include/clang/AST/Decl.h`
- [Preprocessor](https://github.com/arm/arm-toolchain/blob/arm-software/clang/include/clang/Lex/Preprocessor.h): `clang/include/clang/Lex/Preprocessor.h`
- [Path analysis](https://github.com/arm/arm-toolchain/blob/arm-software/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp): `clang/lib/StaticAnalyzer/Core/ExprEngine.cpp`
- [Checker dispatch](https://github.com/arm/arm-toolchain/blob/arm-software/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h): `clang/include/clang/StaticAnalyzer/Core/CheckerManager.h`
- [Bug reporting](https://github.com/arm/arm-toolchain/blob/arm-software/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h): `clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h`

### BOLT binary optimization

- [BOLT driver](https://github.com/arm/arm-toolchain/blob/arm-software/bolt/tools/driver/llvm-bolt.cpp): `bolt/tools/driver/llvm-bolt.cpp`
- [Binary pass manager](https://github.com/arm/arm-toolchain/blob/arm-software/bolt/lib/Rewrite/BinaryPassManager.cpp): `bolt/lib/Rewrite/BinaryPassManager.cpp`
- [Profile processing](https://github.com/arm/arm-toolchain/blob/arm-software/bolt/lib/Profile/DataAggregator.cpp): `bolt/lib/Profile/DataAggregator.cpp`
- [Binary rewriting](https://github.com/arm/arm-toolchain/blob/arm-software/bolt/lib/Rewrite/RewriteInstance.cpp): `bolt/lib/Rewrite/RewriteInstance.cpp`

### Clang developer tools

- [AST query tool](https://github.com/arm/arm-toolchain/blob/arm-software/clang-tools-extra/clang-query/Query.cpp): `clang-tools-extra/clang-query/Query.cpp`
- [Include fixer](https://github.com/arm/arm-toolchain/blob/arm-software/clang-tools-extra/clang-include-fixer/IncludeFixer.cpp): `clang-tools-extra/clang-include-fixer/IncludeFixer.cpp`
- [Lint framework](https://github.com/arm/arm-toolchain/blob/arm-software/clang-tools-extra/clang-tidy/ClangTidy.cpp): `clang-tools-extra/clang-tidy/ClangTidy.cpp`

### Embedded support

- [Embedded toolchain](https://github.com/arm/arm-toolchain/tree/arm-software/arm-software/embedded): `arm-software/embedded`
- [Startup support](https://github.com/arm/arm-toolchain/blob/arm-software/arm-software/embedded/llvmlibc-support/crt0/bootcode.cpp): `arm-software/embedded/llvmlibc-support/crt0/bootcode.cpp`
- [Semihosting](https://github.com/arm/arm-toolchain/blob/arm-software/arm-software/embedded/llvmlibc-support/semihost/semihost.cpp): `arm-software/embedded/llvmlibc-support/semihost/semihost.cpp`
- [ELF conversion](https://github.com/arm/arm-toolchain/blob/arm-software/arm-software/shared/elf2bin/elf2bin.cpp): `arm-software/shared/elf2bin/elf2bin.cpp`

### Linux runtime support

- [Linux toolchain](https://github.com/arm/arm-toolchain/tree/arm-software/arm-software/linux): `arm-software/linux`
- [libc interfaces](https://github.com/arm/arm-toolchain/blob/arm-software/libc/include/llvm-libc-types/struct_sockaddr_storage.h): `libc/include/llvm-libc-types/struct_sockaddr_storage.h`
- [Compiler runtime](https://github.com/arm/arm-toolchain/blob/arm-software/compiler-rt/lib/ubsan/ubsan_handlers.cpp): `compiler-rt/lib/ubsan/ubsan_handlers.cpp`

### Other components

- **Toolchain user**

## Connections

- Toolchain user → Embedded toolchain: targets
- Toolchain user → Linux toolchain: targets
- Path analysis → Checker dispatch: dispatches checks (evidence: `clang/lib/StaticAnalyzer/Core/ExprEngine.cpp`)
- AST query tool → AST model: queries ASTs
- Embedded toolchain → Startup support: includes startup support
- Embedded toolchain → Semihosting: offers semihosting
- Embedded toolchain → ELF conversion: offers ELF conversion
