Skip to content
Open
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
9fde1cf
Adapt to changes in lara-framework
lm-sousa Oct 2, 2024
7674b22
Remove dead code
lm-sousa Oct 2, 2024
cd1331c
Rename tests
lm-sousa Oct 3, 2024
4ee2104
Refactor tests
lm-sousa Oct 3, 2024
0b7a6c5
Rename test files
lm-sousa Oct 3, 2024
a87153e
Refactor tests
lm-sousa Oct 3, 2024
f0106b1
Fix bug introduced in parser
lm-sousa Oct 3, 2024
ec71334
Refactor tests
lm-sousa Oct 3, 2024
0f11abb
Refactor test files
lm-sousa Oct 5, 2024
d66a78d
Rename test files
lm-sousa Oct 5, 2024
c8d2bf6
Refactor tests
lm-sousa Oct 5, 2024
0735227
Refactor tests
lm-sousa Oct 5, 2024
bc19294
Fix test names
lm-sousa Oct 5, 2024
ae72c85
Refactor tests
lm-sousa Oct 5, 2024
8c2dbb8
Refactor tests
lm-sousa Oct 5, 2024
8fd78db
Refactor tests
lm-sousa Oct 5, 2024
3271f24
Refactor tests
lm-sousa Oct 5, 2024
80ec04f
Refactor tests
lm-sousa Oct 5, 2024
cba4f6a
Fix tests
lm-sousa Oct 5, 2024
ee7cc39
Remove Eclipse and Ivy specific files
lm-sousa Oct 6, 2024
bb1915d
Refactor test
lm-sousa Oct 6, 2024
7109f57
Refactor tests
lm-sousa Oct 12, 2024
892e93e
Bug related test fixes
lm-sousa Oct 12, 2024
9004e3c
Refactor autopar tests (broken)
lm-sousa Oct 12, 2024
e04f895
Delete extraneous files
lm-sousa Oct 12, 2024
a624ece
Fix test syntax errors for strict mode
lm-sousa Oct 12, 2024
5939485
Replace laraImport with ES6 imports
lm-sousa Oct 13, 2024
bc02e5f
Replace println with console.log in tests
lm-sousa Oct 13, 2024
033ffd9
Prune imports in tests
lm-sousa Oct 13, 2024
ad3191a
Remove reference to LARA DSL stack trace
lm-sousa Oct 15, 2024
6674eea
Remove LARA DSL report fields
lm-sousa Oct 15, 2024
340837a
Fix tests now that js scripts are no longer auto imported
lm-sousa Oct 16, 2024
9933b34
Remove usage of deleted lara-framework method
lm-sousa Oct 16, 2024
24f3193
Reorganize build.gradle
lm-sousa Oct 16, 2024
c65182f
Remove te legacy LaraCommonLanguage experiment from the project
lm-sousa Oct 19, 2024
96c5e88
Remove LCL from Clava
lm-sousa Oct 20, 2024
afaf6ee
Remove Autopar from Clava
lm-sousa Oct 20, 2024
23855fa
New ClavaOptionsManager GUI to manage Classic-style configuration files
lm-sousa Oct 26, 2024
e7aaeec
Remove deleted method from CxxWeaver
lm-sousa Oct 26, 2024
2388587
Add new Java interface to Clava apis
lm-sousa Oct 27, 2024
990d60c
Clava-JS now also runs the legacy integration tests
lm-sousa Oct 27, 2024
0dcb3f0
Fix some tests in running in JS
lm-sousa Mar 1, 2025
70beb8d
Modify how we run tests
lm-sousa Mar 1, 2025
c89adb8
Fix a bunch of tests
lm-sousa Mar 1, 2025
945b6c1
Delete commented out code
lm-sousa Mar 1, 2025
1a2f854
Add vscode extension information
lm-sousa Mar 1, 2025
4806bdf
Reduce eslint agresiveness
lm-sousa Mar 1, 2025
0a4f97b
[ClavaLaraApi] Changes webresource to use https
joaobispo Feb 11, 2025
5738771
[ClangAstParser] Updates links to https instead of http
joaobispo Feb 5, 2025
b4b89eb
Merge 'staging' into 'lara-dsl-deprecation'
lm-sousa Mar 10, 2025
4e7668b
Remove JS api files from Java resources
lm-sousa Mar 10, 2025
bee8e14
[ClavaWeaver] Remove Junit test runner for API tests
lm-sousa Mar 10, 2025
aad4490
Remove reference to deleted classes
lm-sousa Mar 10, 2025
467569d
Merge remote-tracking branch 'origin/staging' into lara-dsl-deprecation
lm-sousa Mar 10, 2025
f342630
[Clava-JS] Bump dependency versions
lm-sousa Mar 11, 2025
302e122
Make projects compatible with Gradle 9
lm-sousa Mar 11, 2025
d1bb3e0
Remove duplicate job on pull_requests
lm-sousa Mar 11, 2025
c5c9c89
Delete old eclipse runner scripts and enable Clava WeaverGenerator ta…
lm-sousa Mar 14, 2025
a31cb8f
Remove LaraApi dependency
lm-sousa Mar 14, 2025
8d240b1
Update all dependencies
lm-sousa Mar 16, 2025
67e38ac
Re generate weaver abstract with recent lara-framework changes
lm-sousa Mar 18, 2025
abf7000
Remove or modify tests related to features removed from the weaver
lm-sousa Mar 18, 2025
854ed21
[Clava-JS] Use sideeffects loader to apply clava-specific options to …
lm-sousa Mar 18, 2025
86ef1be
Update workflow to test project using Node v22
lm-sousa Mar 22, 2025
299e62d
Delete Eclipse project remnants
lm-sousa Apr 23, 2025
17cafc7
Make cytoscape a proper dependency
lm-sousa Apr 24, 2025
e9c52cb
Rename Clava files
lm-sousa Apr 29, 2025
433c432
Fix test result that is clearly erroneous
lm-sousa Apr 29, 2025
1f7a116
Fix test
lm-sousa Apr 29, 2025
587e581
Remove references to API resources
lm-sousa Apr 30, 2025
f930318
Move useSpecsLogger option to the Logger class constructor
lm-sousa Apr 30, 2025
0a68c7f
Fix uservalues test
lm-sousa Apr 30, 2025
535020b
Fix test
lm-sousa Apr 30, 2025
4698c11
Minor cleanups
lm-sousa May 5, 2025
0c6714d
Bug fixes in tests
lm-sousa May 5, 2025
572a7da
Refactor ClavaWeaver: Remove deprecated classes and unused dependencies
lm-sousa Jun 13, 2025
316d2e8
Add g++ installation step for macOS in nightly workflow
lm-sousa Jun 13, 2025
5057f3a
Enhance macOS setup: Install Xcode Command-Line Tools and GCC in nigh…
lm-sousa Jun 13, 2025
f2154d1
Refactor Clava and ClavaWeaver: Implement error handling for unimplem…
lm-sousa Jun 14, 2025
fe296af
Remove verbose logging setting from ClavaWeaverTester
lm-sousa Jun 14, 2025
7c0f675
Merge branch 'staging' into lara-dsl-deprecation
lm-sousa Jun 15, 2025
23fc291
Refactor build.gradle and settings.gradle files: Add 'java' plugin, c…
lm-sousa Jun 15, 2025
76139c9
Refactor array handling in joinpoint implementations: Replace calls t…
lm-sousa Jun 15, 2025
dcdecd3
Remove unused JsEngine dependency and clean up HighLevelSynthesisAPI …
lm-sousa Jun 15, 2025
fc37181
Remove commented-out code and unused report fields in CxxSelects for …
lm-sousa Jun 16, 2025
378a036
Reconfigure gradle to automatically generate the abstracts.
lm-sousa Jun 17, 2025
9ee2ec9
Remove unused AClavaWeaver and ClavaWeaverException classes to enhanc…
lm-sousa Jun 17, 2025
6605a5b
Fix dependency configuration and update main class reference in Clava…
lm-sousa Jun 26, 2025
264376f
Add Copilot instructions and update VSCode settings and extensions fo…
lm-sousa Jul 2, 2025
c1b214e
Fix resource location
lm-sousa Jul 21, 2025
057fd7d
Refactor imports in CxxWeaver and AstFactory for improved clarity and…
lm-sousa Jul 21, 2025
0eb9b3d
[Clava-JS] Re-enable execution of CUDA tests in JS.
lm-sousa Jul 25, 2025
da884c4
Add option to generate weaver event triggers in abstracts
lm-sousa Jul 30, 2025
e9a0497
Refactor test cases in LegacyIntegrationTests and ClavaDataStoreTest …
lm-sousa Aug 3, 2025
55f861e
Remove InsideApplyGear class and its references from CxxWeaver
lm-sousa Aug 3, 2025
cce2d26
Refactor build.gradle and remove unused Clava icon resource from CxxW…
lm-sousa Aug 3, 2025
e07fa9a
Remove deprecated High-Level Synthesis (HLS) related classes and APi …
lm-sousa Aug 3, 2025
3c9a649
Remove ClavaPlatforms interface and related launch configurations
lm-sousa Aug 3, 2025
a57d606
Remove commented-out code and unused variables from ClavaContext and …
lm-sousa Aug 3, 2025
766ee2a
Decouple integration testing from Clava-specific weaver methods.
lm-sousa Aug 3, 2025
e1c9460
Update Clava to reflect recent lara-framework changes to the LaraWeav…
lm-sousa Aug 3, 2025
42f1626
Refactor ClavaWeaverTester to extend WeaverLegacyTester and remove un…
lm-sousa Aug 4, 2025
126db0e
Move ClavaLegacyTester to a separate folder and update integration te…
lm-sousa Aug 4, 2025
781c2e1
Merge branch 'staging' into lara-dsl-deprecation
lm-sousa Aug 16, 2025
c919d10
Refactor code formatting and remove commented-out variable in ClangAs…
lm-sousa Aug 16, 2025
bf60576
Move the Copilot instructions for the Clava repository to the proper …
lm-sousa Aug 17, 2025
25cfe92
Remove artifact images from version control
lm-sousa Aug 17, 2025
8a2b5b9
Remove unused EnumHelperProvider from LanguageId and clean up CxxWeav…
lm-sousa Aug 19, 2025
d3cdc33
Fix import statement and replace println with console.log in IncludeL…
lm-sousa Aug 26, 2025
ad63624
Merge branch 'staging' into lara-dsl-deprecation
lm-sousa Aug 26, 2025
6f4f371
Refactor ClangResources to use version() method for resource version …
lm-sousa Sep 4, 2025
e712a28
Refactor null checks to use Objects.requireNonNull
lm-sousa Sep 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
100 changes: 100 additions & 0 deletions .github/instructions/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Copilot Instructions for the Clava Repository

## Project Overview

Clava is a modular source-to-source compiler for C, C++, CUDA, and OpenCL, supporting advanced code analysis and transformation. It is implemented using a combination of TypeScript/JavaScript (Node.js), Java, and C++. Clava is designed for composability and reusability, and integrates with the LARA DSL for custom code transformations.

## Development Environment & Setup

- **Node.js Version:** 20 or 22 (required for Clava-JS)
- **Java Version:** 17+ (required for Java components)
- **Build System:** Gradle for Java modules, npm for TypeScript/JavaScript
- **IDE:** VSCode is recommended for development

## Architecture

- **Frontend (C++):**
The `ClangAstDumper` component extracts AST information from Clang-based codebases.
- **Middle-end (Java):**
Components like `ClangAstParser` and `ClavaWeaver` process ASTs and apply transformations.
- **API Layer (TypeScript/JavaScript):**
The `Clava-JS` module provides the main user-facing API and runtime, exposing Clava's features to Node.js environments.
- **Build Integration:**
The `CMake` package enables integration with CMake-based build systems.

### Related Projects
- **lara-framework**: Core framework providing weaver infrastructure and JavaScript APIs
- **specs-java-libs**: Java utility libraries used throughout the project

## Key Directories

- `Clava-JS/`: TypeScript/JavaScript API and runtime.
- `ClavaWeaver/`: Java-based weaving engine.
- `ClangAstDumper/`: C++ AST dumper using Clang.
- `ClangAstParser/`: Java AST parser.
- `ClavaAst/`, `ClavaHls/`, `ClavaLaraApi/`, `AntarexClavaApi/`: Supporting modules for AST, HLS, LARA API, and Antarex integration.
- `CMake/`: CMake integration scripts and utilities.
- `docs/`: Documentation, tutorials, and common issues.

## Build and Development

- **Java Components:** Use Gradle (`gradle installDist`) to build Java modules (e.g., ClavaWeaver).
- **TypeScript/JavaScript:** Use npm scripts (`npm install`, `npm run build`) in `Clava-JS`.
- **C++ Components:** Use CMake for building and integrating the Clang AST dumper.
- **Integration:** Copy built Java binaries into `Clava-JS/java-binaries` for full functionality.

## Usage

- **NPM Package:**
Install globally or as a project dependency:
`npm install -g @specs-feup/clava`
- **CLI:**
Run transformations via `npx clava classic <scriptfile.js> -p "<source files>"`
- **CMake Integration:**
Use the `clava_weave` CMake command to apply LARA scripts to targets.

## Code Patterns and Conventions

- **Visitor Patterns:**
Used extensively in AST processing (see `ClangAstDumper.h`).
- **TypeScript API:**
Modular, with clear separation between API (`src-api/`) and code (`src-code/`).
- **Java:**
Follows standard Gradle project structure.
- **C++:**
Integrates with Clang/LLVM for AST extraction.

## Common Development Tasks

- Add new AST node support in `ClangAstDumper` and propagate through Java and JS layers.
- Extend the TypeScript API in `Clava-JS/src-api/`.
- Create new code transformations as LARA scripts or TypeScript modules.
- Use provided test scripts and npm/Gradle test commands.

## Dependencies

- **Node.js 20 or 22** and **Java 17+** required.
- **Clang/LLVM** for AST extraction.
- **NPM** for JS/TS dependencies.
- **Gradle** for Java builds.
- **CMake** for build system integration.

## Troubleshooting

- See `docs/common_issues.md` for frequently encountered problems.
- Use the GitHub issue tracker for unresolved issues.

## References

- [Clava Documentation](https://specs-feup.github.io/modules/_specs_feup_clava.html)
- [Clava Project Template](https://github.com/specs-feup/clava-project-template)
- [Online Demo](https://specs.fe.up.pt/tools/clava/)
- [Main Repository](https://github.com/specs-feup/clava)

---

**For LLMs:**
- Respect the modular structure and language boundaries.
- When adding features, ensure changes propagate through C++, Java, and JS layers as needed.
- Follow existing patterns for AST traversal and transformation.
- Use the provided build and test scripts for validation.
17 changes: 12 additions & 5 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name: nightly

on:
push:
pull_request:

# Daily at midnight
schedule:
Expand Down Expand Up @@ -81,8 +80,7 @@ jobs:
with:
repository: specs-feup/specs-java-libs
path: specs-java-libs
# This is causing problems in PRs, for now it will always be the default branch
#ref: ${{ steps.Branch-specs-java-libs.outputs.value == '1' && env.BRANCH_NAME || env.DEFAULT_BRANCH }}
ref: ${{ steps.Branch-specs-java-libs.outputs.value == '1' && env.BRANCH_NAME || env.DEFAULT_BRANCH }}

- name: Build with Gradle
run: |
Expand Down Expand Up @@ -121,7 +119,7 @@ jobs:
strategy:
fail-fast: false
matrix:
#node-version: ['latest', '20.x', '18.x']
#node-version: ['latest', '22.x', '20.x']
node-version: ['22.x', '20.x']
os: [ubuntu-latest, windows-latest, macos-latest]

Expand All @@ -140,6 +138,15 @@ jobs:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org/'

# Install Xcode Command-Line Tools and GCC on macOS
- name: Install C SDK and GCC
if: matrix.os == 'macos-latest'
run: |
sudo xcode-select --install || true
sudo xcode-select -s /Library/Developer/CommandLineTools
brew install gcc
echo 'export PATH="$(brew --prefix gcc)/bin:$PATH"' >> $GITHUB_ENV

- name: Checkout Clava
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -202,4 +209,4 @@ jobs:
echo "Not a push event, skipping publish."
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ sf.eclipse.javacc.prefs
MatisseOptions.lara
Matisse.lara

# Eclipse settings folder
**/.settings/**

#output/
.idea/
.gradle/
Expand Down
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"recommendations": [
"sonarsource.sonarlint-vscode",
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"orta.vscode-jest",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"redhat.java",
"vscjava.vscode-gradle",
"vscjava.vscode-java-debug"
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cmake.ignoreCMakeListsMissing": true,
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic",
"jest.runMode": {
"type": "on-demand"
},
}
10 changes: 0 additions & 10 deletions AntarexClavaApi/.classpath

This file was deleted.

28 changes: 0 additions & 28 deletions AntarexClavaApi/.project

This file was deleted.

40 changes: 16 additions & 24 deletions AntarexClavaApi/build.gradle
Original file line number Diff line number Diff line change
@@ -1,43 +1,35 @@
plugins {
id 'distribution'
id 'distribution'
id 'java'
}

// Java project
apply plugin: 'java'

java {
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}


// Repositories providers
repositories {
mavenCentral()
}

dependencies {
testImplementation "junit:junit:4.13.1"
implementation ':SpecsUtils'
implementation ':LaraUtils'
implementation ':SpecsUtils'
implementation ':LaraUtils'
}

java {
withSourcesJar()
}


// Project sources
sourceSets {
main {
java {
srcDir 'src-java'
}

resources {
srcDir 'src-lara'
srcDir 'src-js'
}
}

main {
java {
srcDir 'src-java'
}

resources {
srcDir 'src-lara'
srcDir 'src-js'
}
}
}
19 changes: 0 additions & 19 deletions ClangAstParser/.classpath

This file was deleted.

29 changes: 0 additions & 29 deletions ClangAstParser/.project

This file was deleted.

Loading
Loading