{"id":15101401,"url":"https://github.com/dancing4am/llvm-assignment","last_synced_at":"2026-01-08T16:52:12.318Z","repository":{"id":250785814,"uuid":"835324384","full_name":"dancing4am/llvm-assignment","owner":"dancing4am","description":"A basic LLVM pass for learning","archived":false,"fork":false,"pushed_at":"2024-08-05T15:22:12.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T05:35:13.727Z","etag":null,"topics":["llvm","llvm-ir","llvm-pass","llvm-plugins"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dancing4am.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-29T15:46:25.000Z","updated_at":"2024-08-05T15:22:15.000Z","dependencies_parsed_at":"2024-08-05T16:47:09.150Z","dependency_job_id":null,"html_url":"https://github.com/dancing4am/llvm-assignment","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":0.3157894736842105,"last_synced_commit":"7cd61e2e18fc641a3d312f6794e1848b023a19a3"},"previous_names":["dancing4am/llvm-assignment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancing4am%2Fllvm-assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancing4am%2Fllvm-assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancing4am%2Fllvm-assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancing4am%2Fllvm-assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dancing4am","download_url":"https://codeload.github.com/dancing4am/llvm-assignment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246516791,"owners_count":20790295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llvm","llvm-ir","llvm-pass","llvm-plugins"],"created_at":"2024-09-25T18:22:18.007Z","updated_at":"2026-01-08T16:52:12.254Z","avatar_url":"https://github.com/dancing4am.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# llvm-assignment\n\n## Overview\nThis is an out-of-tree LLVM plugin example, that uses bogus conditional branch by command line argument `--bogus=\u003cBOOLEAN\u003e`.\n\n## Development Environment\n### Platform Support And Requirements\n\nThis project has been tested on **Ubuntu 22.04.4 LTS**.\nIn order to build **llvm-assignment** you will need:\n\n- LLVM 18\n- C++ compiler that supports C++17\n- CMake 3.20 or higher\n\nIn order to run the passes, you will need:\n\n- **clang-18** (to generate input LLVM files)\n- [opt](https://llvm.org/docs/CommandGuide/opt.html) (to run the passes)\n\nThere are additional requirements for tests (these will be satisfied by installing LLVM 18):\n\n- [lit](https://llvm.org/docs/CommandGuide/lit.html) (aka **llvm-lit**, LLVM tool for executing the tests)\n- [FileCheck](https://llvm.org/docs/CommandGuide/FileCheck.html) (LIT requirement, it's used to check whether tests generate the expected output)\n\n\n## Building \u0026 Testing\n\n### Building\nYou can build **llvm-assignment** (and all the provided pass plugins) as follows:\n\n```\ncd \u003cbuild/dir\u003e\ncmake -DLT_LLVM_INSTALL_DIR=\u003cinstallation/dir/of/llvm/18\u003e \u003csource/dir/llvm/assignment\u003e\nmake\n```\n\nThe `LT_LLVM_INSTALL_DIR` variable should be set to the root of either the installation or build directory of LLVM 18. It is used to locate the corresponding `LLVMConfig.cmake` script that is used to set the include and library paths.\n\n### Testing\nIn order to run **llvm-assignment** tests, you need to install **llvm-lit** (aka **lit**). It's not bundled with LLVM 18 packages, but you can install it with **pip**:\n```\n# Install lit - note that this installs lit globally\npip install lit\n```\nRunning the tests is as simple as:\n```\n$ lit \u003cbuild_dir\u003e/test\n```\n\n## Running\n\n### Generating Input\n\nBefore you can test it, you need to prepare an input file:\n```\n# Generate an LLVM test file\n$LLVM_DIR/bin/clang -O1 -S -emit-llvm \u003csource/dir/llvm/assignment\u003e/inputs/input_for_obfuscator.cpp -o input_for_obfuscator.ll\n```\n\n### Generating Output\n\n```\n# Watch out '\u003e' between input and output\n$LLVM_DIR/bin/opt -load-pass-plugin \u003cBUILD_DIR\u003e/lib/libObfuscator.{so|dylib} --bogus=\u003cBOOLEAN\u003e -passes=obfuscator\n-S \u003cINPUT_LLVM_FILE\u003e \u003e \u003cOUTPUT_LLVM_FILE\u003e\n```\n\n### Without Output\n\n```\n$LLVM_DIR/bin/opt -load-pass-plugin \u003cBUILD_DIR\u003e/lib/libObfuscator.{so|dylib} --bogus=\u003cBOOLEAN\u003e -passes=obfuscator\n-disable-output \u003cINPUT_LLVM_FILE\u003e\n```\n\n\u003eAbove description is mostly copied from [llvm-tutor README](https://github.com/banach-space/llvm-tutor?tab=readme-ov-file) for convenience.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdancing4am%2Fllvm-assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdancing4am%2Fllvm-assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdancing4am%2Fllvm-assignment/lists"}