Middleend: IRGenerator and Optimizer#22
Conversation
|
@copilot please shut the fuck up during the PR thank you |
|
@TsukimotoX I've opened a new pull request, #23, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Pull request overview
This PR begins wiring LLVM into the Neoluma compilation pipeline by exposing LLVM types from the AST layer and adjusting CMake so Core code can include LLVM headers.
Changes:
- Add a direct LLVM
Valueinclude to the frontend AST header and introduce anASTNode::generateCode()entrypoint returningllvm::Value*. - Update CMake to add LLVM include directories and definitions to the
NeolumaCoretarget.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/Core/Frontend/Nodes.hpp |
Introduces LLVM dependency and a new virtual generateCode() API on AST nodes. |
CMakeLists.txt |
Extends LLVM include/definition setup to the NeolumaCore library target. |
| target_include_directories(NeolumaCore PRIVATE ${LLVM_INCLUDE_DIRS}) | ||
| target_compile_definitions(NeolumaCore PRIVATE ${LLVM_DEFINITIONS}) |
There was a problem hiding this comment.
NeolumaCore is a library with public headers under src/ (e.g., Nodes.hpp) that now include LLVM headers. LLVM include dirs/definitions are added as PRIVATE here, which means consumers of NeolumaCore won't automatically get the required LLVM include path/defines if they include those headers. Prefer making the LLVM include dirs/compile defs PUBLIC on NeolumaCore, or (better) avoid including LLVM headers from public Core headers via forward declarations.
| target_include_directories(NeolumaCore PRIVATE ${LLVM_INCLUDE_DIRS}) | |
| target_compile_definitions(NeolumaCore PRIVATE ${LLVM_DEFINITIONS}) | |
| target_include_directories(NeolumaCore PUBLIC ${LLVM_INCLUDE_DIRS}) | |
| target_compile_definitions(NeolumaCore PUBLIC ${LLVM_DEFINITIONS}) |
| target_include_directories(NeolumaCore PRIVATE ${LLVM_INCLUDE_DIRS}) | ||
| target_compile_definitions(NeolumaCore PRIVATE ${LLVM_DEFINITIONS}) |
There was a problem hiding this comment.
PR description/title mention adding an IRGenerator, Optimizer, and a first stdlib iteration (I/O + filesystem), but the repository state only shows placeholder filler files under src/Core/Middleend/{IRGenerator,Optimizer} and no corresponding implementation/types are present. Either the PR description should be updated to reflect the actual scope, or the missing middleend/stdlib changes should be included before merging.
…zer' into middleend-irgenerator-and-optimizer
…com/TsukimotoX/neoluma into middleend-irgenerator-and-optimizer # Conflicts: # src/Core/Frontend/Lexer/Lexer.cpp # src/Core/Frontend/Parser/Parser.cpp # src/Core/Frontend/Parser/Parser.hpp
2d4bb03 to
9b5ae9a
Compare
Bumps the npm_and_yarn group with 1 update in the /src/Installer directory: [picomatch](https://github.com/micromatch/picomatch). Updates `picomatch` from 4.0.3 to 4.0.4 - [Release notes](https://github.com/micromatch/picomatch/releases) - [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md) - [Commits](micromatch/picomatch@4.0.3...4.0.4) --- updated-dependencies: - dependency-name: picomatch dependency-version: 4.0.4 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…com/TsukimotoX/neoluma into middleend-irgenerator-and-optimizer # Conflicts: # src/Core/Frontend/Lexer/Lexer.cpp # src/Core/Frontend/Parser/Parser.cpp # src/Core/Frontend/Parser/Parser.hpp
…zer' into middleend-irgenerator-and-optimizer
…zer' into middleend-irgenerator-and-optimizer
…have a world-beating architecture. The mainframe systems... have power to perform many more tasks concurrently. Unlimited flexibility...
We are finally done with the Frontend of Neoluma programming language, so it's time to move on to something more sweeter, juicier: LLVM IR Generation!
Goals for this Pull Request are simple:
After the pull request, Neoluma should compile to LLVM IR, which allows us to get closer to executable generation.