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

LLVM Loader PoC #109

Closed
wants to merge 12 commits into from
Closed

LLVM Loader PoC #109

wants to merge 12 commits into from

Conversation

yashtazor
Copy link

@yashtazor yashtazor commented Mar 27, 2021

Description

Trying out a PoC for LLVM Loader.

Start (29th March)

So far, I've been able to extract the LLVM IR from the C code.

Update (1st April)

Currently, I've found a way to extract functions in LLVM bit code (.bc) format. We can even have this in human-readable form for interpretation purposes. If we can somehow utilize these extracted methods to extract the names, arguments and return types, PoC is almost done.

Another way is to expose the LLVM IR module in the C code itself and then pass it as parameters in various methods of LLVM API to do the extraction work for us or we can even do it manually by iterating through various blocks of the LLVM IR code. This option hasn't been explored as of now and I plan on doing it in coming days.

Finally, after extraction (introspection/reflection) is done, we can move on to working with Metacall and implementing it inside the core.

Type of change

  • New Feature (PoC)

Checklist:

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.

jfblomgren and others added 5 commits March 20, 2021 20:23
`[ -z "${CLANG_FORMAT+x}" ]` checks if CLANG_FORMAT is unset, but the
variable will be set even if `which` fails, so we have to check if it is
empty instead.
`MEMORYCHECK_SUPPRESSIONS_FILE` can only take a single path and treats
the entire semicolon-separated string as such. To pass multiple files,
one has to pass each of them in as an individual command option.
Fix clang-format fallback check in pre-commit hook
Fix paths for memcheck suppressions files
@viferga viferga mentioned this pull request Mar 30, 2021
@yashtazor yashtazor mentioned this pull request Mar 31, 2021
6 tasks
@viferga
Copy link
Member

viferga commented May 4, 2021

This should not be merged into the project, the updated version of the PoC can be found here: https://github.com/yashtazor/LLVM-Loader-POC

I am leaving here the zip version:
LLVM-Loader-POC-main.zip

@viferga viferga closed this May 4, 2021
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.

4 participants