Skip to content

Multi weaver#224

Open
lm-sousa wants to merge 6 commits intostagingfrom
multi-weaver
Open

Multi weaver#224
lm-sousa wants to merge 6 commits intostagingfrom
multi-weaver

Conversation

@lm-sousa
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the Clava weaver architecture to support multiple concurrent weaver instances by eliminating static singleton patterns. The main change is threading a CxxWeaver instance through all joinpoint constructors and factory methods instead of relying on static getCxxWeaver() calls.

Changes:

  • Refactored all joinpoint classes to accept and store a CxxWeaver instance in their constructors
  • Updated CxxJoinpoints factory to use instance methods instead of static singleton access
  • Modified TypeScript API layer to pass weaver instance from Weaver.getWeaverEngine() to all factory methods
  • Updated GitHub workflows to use improved branch selection logic and updated dependencies

Reviewed changes

Copilot reviewed 115 out of 115 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
CxxWeaver.java Removed static getCxxWeaver() method, made factory methods non-static
CxxJoinpoints.java Changed from FunctionClassMap to BiFunctionClassMap to accept weaver parameter
ACxxWeaverJoinPoint.java Added constructor requiring weaver, updated to use instance methods
AstFactory.java All factory methods now require weaver as first parameter
CxxActions.java Updated to pass weaver instance through action methods
All Cxx* joinpoint classes Constructors updated to accept and pass weaver to parent classes
ClavaJoinPoints.ts All factory methods updated to pass Weaver.getWeaverEngine()
Clava.ts API calls updated to pass weaver instance
package.json Dependency versions updated
GitHub workflows Improved branch selection logic with fallback to PR target or default branch
core.ts Removed (legacy compatibility file)
AstNodes.js Removed unused Ast API test code

public static AExpression doubleLiteral(String floating) {
return doubleLiteral(Double.parseDouble(floating));
public static AExpression doubleLiteral(CxxWeaver weaver, String floating) {
return doubleLiteral(weaver, Double.parseDouble(floating));
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

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

Potential uncaught 'java.lang.NumberFormatException'.

Copilot uses AI. Check for mistakes.
public static AExpression integerLiteral(String integer) {
return integerLiteral(Integer.parseInt(integer));
public static AExpression integerLiteral(CxxWeaver weaver, String integer) {
return integerLiteral(weaver, Integer.parseInt(integer));
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

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

Potential uncaught 'java.lang.NumberFormatException'.

Copilot uses AI. Check for mistakes.
- Updated constructors in joinpoint classes to accept CxxWeaver as a parameter.
- Modified method calls to CxxJoinpoints.create to pass the weaver engine where necessary.
- Enhanced the integration of the weaver engine in the joinpoint creation process, ensuring better management of joinpoints in the Clava framework.
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.

1 participant

Comments