Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Callgraph #185

Merged
merged 58 commits into from
Nov 6, 2024
Merged

Add Callgraph #185

merged 58 commits into from
Nov 6, 2024

Conversation

Esorat
Copy link
Member

@Esorat Esorat commented Oct 17, 2024

Closes #91

  • I have updated CHANGELOG.md
  • I have added tests to demonstrate the contribution is correctly implemented
  • No test failures were reported when running yarn test-all
  • I did not do unrelated and/or undiscussed refactorings

Copy link
Member

@jubnzv jubnzv left a comment

Choose a reason for hiding this comment

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

I think, that's a good start. Please add an entry to CHANGELOG, and merge the master branch to your PR in order to simplify the test suite.

src/internals/ir/callGraph.ts Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
callgraph.dot Outdated Show resolved Hide resolved
src/detectors/builtin/sendInLoop.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
@jubnzv jubnzv changed the title fix: Draft Pr for check CallGraph Add Callgraph Oct 18, 2024
@jubnzv jubnzv marked this pull request as draft October 18, 2024 07:37
…pdate constructor and make astStore public

- Refactored `getFunctionName` to use a switch statement for better type safety.
- Introduced `forEachExpression` helper function to handle expression processing recursively and improve code maintainability.
- Updated constructor to remove `astStore` and pass it via the `build()` method, while making `astStore` a public property.
- Updated Ir constructor add CallGraph
- Remove from git .dot output file
Copy link
Member

@jubnzv jubnzv left a comment

Choose a reason for hiding this comment

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

It is much better now. We need to:

  • update the changelog
  • introduce some tests in test/tactIR.spec.ts
  • write a separate tool to dump the callgraph in the supported formats

src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
Add tests.  create Dump callgraph ( in detectors can add this line (    DumpCallGraph.run(cu); )
src/internals/ir/builders/astStore.ts Outdated Show resolved Hide resolved
src/detectors/detector.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/tools/dumpCallgraph.ts Outdated Show resolved Hide resolved
@Esorat Esorat marked this pull request as ready for review October 20, 2024 07:33
test/all/syntax.expected.callgraph.dot Outdated Show resolved Hide resolved
src/tools/dumpCallgraph.ts Outdated Show resolved Hide resolved
src/tools/dumpCallgraph.ts Outdated Show resolved Hide resolved
src/tools/dumpCallgraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
Copy link
Member

@jubnzv jubnzv left a comment

Choose a reason for hiding this comment

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

Overall looks good. Let's fix minor issues before merging it.

src/internals/ir/builders/ir.ts Outdated Show resolved Hide resolved
src/internals/ir/builders/ir.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Show resolved Hide resolved
src/internals/ir/callGraph.ts Show resolved Hide resolved
@jubnzv
Copy link
Member

jubnzv commented Nov 6, 2024

We also need an entry in CHANGELOG.md

CHANGELOG.md Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
src/internals/ir/callGraph.ts Outdated Show resolved Hide resolved
Copy link
Member

@jubnzv jubnzv left a comment

Choose a reason for hiding this comment

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

LGTM!

@jubnzv jubnzv merged commit a26986c into nowarp:master Nov 6, 2024
1 check passed
@nowarp nowarp deleted a comment Nov 28, 2024
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.

Add Callgraph
2 participants