| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 8 | 3 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 0 | 3 | 1 | 0% |
What each file covers
Sections
0 shared · 8 only in A · 3 only in B- − Compiler Architecture
- − Intro
- − Two Frontends
- − FIR Compilation Phases
- − IR (Intermediate Representation)
- − Inference
- − Commit Guidelines
- − Testing
- + CLAUDE.md - Guidelines for Kotlin Development
- + Project Guidelines
- + Individual Preferences
Commands
neither file has anySection tags
0 shared · 3 only in A · 1 only in B- − build
- − test
- − git-pr
- + agent-behaviour
Line diff
JetBrains/kotlin · compiler/AGENTS.md
@@ −1 @@
1# Compiler Architecture
2
3## Intro
4
5Consider reading [fir-basics.md](../docs/fir/fir-basics.md).
6
7## Two Frontends
8
91. **K1/FE 1.0 (Legacy)**: Located in `compiler/frontend/` - uses PSI and BindingContext
102. **K2/FIR (Current)**: Located in `compiler/fir/` - Frontend IR, the new compiler frontend
11
12## FIR Compilation Phases
13
14FIR processes code through sequential phases (see `FirResolvePhase.kt`).
15
16Key invariant: In phase B following phase A, all FIR elements visible in B are resolved to phase A.
17
18## IR (Intermediate Representation)
19
20Located in `compiler/ir/`. Backend IR is used by all targets for:
21- Lowering (transforming code to target-friendly form)
22- Optimization
23- Serialization to klibs
24
25Backend implementations:
26- `compiler/ir/backend.jvm/` - JVM backend
27- `compiler/ir/backend.js/` - JavaScript backend
28- `compiler/ir/backend.wasm/` - WebAssembly backend
29- `kotlin-native/backend.native/`, `native/` - Native backend
30
31## Inference
32
33For type inference implementation details, read [inference.md](../docs/fir/inference.md).
34
35## Commit Guidelines
36
37- **FIR prefix**: When changes are mostly related to FIR (`compiler/fir/`), use `FIR: ` prefix in the commit subject line.
38- **Test-before-fix**: When fixing an issue and adding a test, commit the test data as a separate commit **before** the fix. This helps reviewers see how the fix actually changes semantics (the test will show diagnostic differences in the fix commit).
39
40## Testing
41
42For FIR analysis test data format (directives, diagnostic markers, file structure), see [analysis-tests/AGENTS.md](fir/analysis-tests/AGENTS.md).
JetBrains/kotlin · CLAUDE.md
@@ +1 @@
1---
2project: Kotlin
3languages: [Kotlin, Java]
4build-system: Gradle
5repository: monorepo
6---
7
8# CLAUDE.md - Guidelines for Kotlin Development
9
10## Project Guidelines
11
12**CRITICAL: @./.ai/guidelines.md guidelines MUST be followed at all times.**
13
14## Individual Preferences
15
16**Local Preferences:** @./.claude/local.md
17
18When asked to update memory, you must update `./.claude/CLAUDE.md` if it is not specified that another file should be modified.
19
@@ −1 +1 @@
1−# Compiler Architecture
1+---
2+project: Kotlin
3+languages: [Kotlin, Java]
4+build-system: Gradle
5+repository: monorepo
6+---
27
3−## Intro
8+# CLAUDE.md - Guidelines for Kotlin Development
49
5−Consider reading [fir-basics.md](../docs/fir/fir-basics.md).
10+## Project Guidelines
611
7−## Two Frontends
12+**CRITICAL: @./.ai/guidelines.md guidelines MUST be followed at all times.**
813
9−1. **K1/FE 1.0 (Legacy)**: Located in `compiler/frontend/` - uses PSI and BindingContext
10−2. **K2/FIR (Current)**: Located in `compiler/fir/` - Frontend IR, the new compiler frontend
14+## Individual Preferences
1115
12−## FIR Compilation Phases
16+**Local Preferences:** @./.claude/local.md
1317
14−FIR processes code through sequential phases (see `FirResolvePhase.kt`).
18+When asked to update memory, you must update `./.claude/CLAUDE.md` if it is not specified that another file should be modified.
1519
16−Key invariant: In phase B following phase A, all FIR elements visible in B are resolved to phase A.
17−
18−## IR (Intermediate Representation)
19−
20−Located in `compiler/ir/`. Backend IR is used by all targets for:
21−- Lowering (transforming code to target-friendly form)
22−- Optimization
23−- Serialization to klibs
24−
25−Backend implementations:
26−- `compiler/ir/backend.jvm/` - JVM backend
27−- `compiler/ir/backend.js/` - JavaScript backend
28−- `compiler/ir/backend.wasm/` - WebAssembly backend
29−- `kotlin-native/backend.native/`, `native/` - Native backend
30−
31−## Inference
32−
33−For type inference implementation details, read [inference.md](../docs/fir/inference.md).
34−
35−## Commit Guidelines
36−
37−- **FIR prefix**: When changes are mostly related to FIR (`compiler/fir/`), use `FIR: ` prefix in the commit subject line.
38−- **Test-before-fix**: When fixing an issue and adding a test, commit the test data as a separate commit **before** the fix. This helps reviewers see how the fix actually changes semantics (the test will show diagnostic differences in the fix commit).
39−
40−## Testing
41−
42−For FIR analysis test data format (directives, diagnostic markers, file structure), see [analysis-tests/AGENTS.md](fir/analysis-tests/AGENTS.md).
