Skip to content

fix: Move runtime codes to own separate header file#859

Open
aniruddhaadak80 wants to merge 1 commit intocompiler-research:mainfrom
aniruddhaadak80:fix-697-runtime-header
Open

fix: Move runtime codes to own separate header file#859
aniruddhaadak80 wants to merge 1 commit intocompiler-research:mainfrom
aniruddhaadak80:fix-697-runtime-header

Conversation

@aniruddhaadak80
Copy link
Copy Markdown

Fixes #697

Description

This addresses #697, which required extracting the dynamically declared code block inside CppInterOp.cpp (the __internal_CppInterOp wrapper signatures) out into its own dedicated header file.

Changes Made

  • Created include/CppInterOp/CppInterOpRuntime.h to house the runtime code signatures.
  • Replaced the string literal I->declare payload in CppInterOp.cpp with a standard runtime #include <CppInterOp/CppInterOpRuntime.h> preprocessor directive.

This cleans up the interpreter startup code and makes extending the runtime capabilities much easier.

Copy link
Copy Markdown
Collaborator

@Vipul-Cariappa Vipul-Cariappa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the folder structure change, this is fine, I guess.
But I am now worried about starting the interpreter with the correct include paths.
This is currently running fine, because we are doing a source build with the env var CPLUS_INCLUDE_PATH set to point to the necessary things.
But what happens when we do a conda install? I don't think this will work out of the box without modifications to CreateInterpreter logic to include this directory.

@@ -0,0 +1,22 @@
//===--- CppInterOpRuntime.h - Runtime codes for language interoperability ---*- C++ -*-===//
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this file go to include/CppInterOp/runtime/CppInterOpRuntime.h.

@aaronj0
Copy link
Copy Markdown
Collaborator

aaronj0 commented Mar 25, 2026

I'd like to point out that a PR addressing this was already opened: #761 that wasn't reviewed. cc @Vipul-Cariappa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Move codes needed at runtime to own separate header file

3 participants