Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • S sysycreforged7
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • 弘深保研队
  • sysycreforged7
  • Merge requests
  • !4

Llvm ir

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged 弘深保研队 requested to merge llvm-ir into main Jul 06, 2025
  • Overview 5
  • Commits 8
  • Pipelines 0
  • Changes 37

Created by: HugoPhi

This pull request introduces several significant changes to improve code organization, functionality, and debugging capabilities. The most notable updates include the consolidation of IR-related structures into tca_ir.h, the addition of LLVM IR generation functionality, and enhancements to debugging options. Below is a categorized summary of the key changes:

Code Organization and Refactoring

  • Consolidated IR-related definitions (Type, Operand, Instruction, Function, etc.) into a new file, tca_ir.h, replacing the previous scattered definitions in multiple files (ir.h, ir_function.h, ir_instruction.h, ir_operand.h, ir_operator.h, ir_program.h). This simplifies the structure and improves maintainability.
  • Updated all references to the old IR-related files to use the new tca_ir.h across multiple files (generator.h, ast.h, semantic.h, syntax.h, token.h, ir_executor.h, ir_reader.h). [1] [2] [3] [4] [5] [6] [7]

LLVM IR Generation

  • Introduced a new LLVMIRGenerator class in tca2llvm.h to handle the conversion of TCA IR to LLVM IR. This includes functionality for type conversion, instruction translation, and module generation.
  • Added support for generating LLVM IR in the main.cpp file, including a new command-line flag --llvm-ir to enable this feature. The generated IR is output to a .ll file. [1] [2] [3] [4] [5]

Debugging Enhancements

  • Added new debugging macros (DEBUG_EXEC_BRIEF, DEBUG_EXEC_DETAIL, DEBUG_HYM_SEE_VAR2OFFSET_TABLE, DEBUG_TCA_2_LLVM) to debug.h for more granular control of debug output during execution and IR conversion processes.

Cleanup and Removal of Deprecated Code

  • Removed outdated and unused IR-related files (ir.h, ir_function.h, ir_instruction.h, ir_operand.h, ir_operator.h, ir_program.h). These files were replaced by the new tca_ir.h. [1] [2] [3] [4] [5] [6]
  • Removed redundant debug output in src/backend/generator.cpp to streamline register allocation logic.

Miscellaneous Improvements

  • Added a helper function in main.cpp to check if a file contains specific code snippets, with optimizations for early exit and reduced memory usage.

These changes collectively improve the project's structure, functionality, and usability, paving the way for more efficient development and debugging workflows.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: llvm-ir