{"id":15398664,"url":"https://github.com/lancern/llvm-covmap","last_synced_at":"2025-04-16T01:47:16.547Z","repository":{"id":112300410,"uuid":"326382007","full_name":"Lancern/llvm-covmap","owner":"Lancern","description":"Profiling for code coverage via bitmap","archived":false,"fork":false,"pushed_at":"2021-01-14T06:30:22.000Z","size":63,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T22:54:25.251Z","etag":null,"topics":["code-coverage","llvm","llvm-ir","llvm-pass","profiling"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lancern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-01-03T10:38:49.000Z","updated_at":"2024-03-28T18:40:59.000Z","dependencies_parsed_at":"2023-05-12T15:45:17.500Z","dependency_job_id":null,"html_url":"https://github.com/Lancern/llvm-covmap","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"1639e67367626d463b33405fce6780e0e67bc53b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lancern%2Fllvm-covmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lancern%2Fllvm-covmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lancern%2Fllvm-covmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lancern%2Fllvm-covmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lancern","download_url":"https://codeload.github.com/Lancern/llvm-covmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182966,"owners_count":21226123,"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":["code-coverage","llvm","llvm-ir","llvm-pass","profiling"],"created_at":"2024-10-01T15:45:01.579Z","updated_at":"2025-04-16T01:47:16.527Z","avatar_url":"https://github.com/Lancern.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# llvm-covmap\n\n![Build Passing](https://img.shields.io/badge/build-passing-brightgree)\n![LLVM 10.0.0](https://img.shields.io/badge/llvm-10.0.0-blue)\n\nLLVM passes and utilities that instruments code to profile for **function-level** \ncode coverage via bitmap during program runtime.\n\n## Build\n\n### Build Prerequisites\n\n- CMake version \u003e= 3.12\n- LLVM\n\nTo install LLVM on your platform, execute the following command:\n\n```shell\nsudo apt install llvm-dev\n```\n\nIt's recommended to use LLVM version 10.0.0. Other versions of LLVM might work\nas well, but they are not tested. To check the LLVM version on your system, execute\nthe following command:\n\n```shell\nllvm-config --version\n```\n\n### Build Steps\n\nClone the repository:\n\n```shell\ngit clone https://github.com/Lancern/llvm-covmap.git\ncd llvm-covmap\n```\n\nCreate a build directory:\n\n```shell\nmkdir build\ncd build\n```\n\nBuild the project using the familiar two-step build:\n\n```shell\ncmake ..\ncmake --build .\n```\n\nThe output files are generated in the `lib/` directory in the build tree.\n\n## Usage\n\n\u003e For advanced usage of `llvm-covmap`, please refer to [docs](./docs).\n\nTo simplify examples, we assume that the `LLVM_COVMAP_BUILD_DIR` environment is set\nto the root of the build tree.\n\nInstrument LLVM modules by hand:\n\n```shell\nopt -load $LLVM_COVMAP_BUILD_DIR/lib/libLLVMCoverageMapPass.so -covmap \\\n  -o=instrumented-module.bc \\\n  input-module.bc\n```\n\nEnd-to-end build using the drop-in replacement of `clang` and `clang++`:\n\n```shell\n# Compile only, do not link\n$LLVM_COVMAP_BUILD_DIR/bin/llvm-covmap-clang -c -o example.o example.c\n\n# End-to-end compile is supported\n# All necessary runtime libraries required by llvm-covmap will be linked automatically\n$LLVM_COVMAP_BUILD_DIR/bin/llvm-covmap-clang -o example example.c\n$LLVM_COVMAP_BUILD_DIR/bin/llvm-covmap-clang++ -o example example.cpp\n```\n\nOne-shot run an **instrumented** program and dump the coverage information:\n\n```shell\n$LLVM_COVMAP_BUILD_DIR/bin/llvm-covmap-shell ls\n```\n\n## Contribute\n\nThis project is built for private use so we don't accept any feature requests or\npull requests. But you're free to fork your own copy of this project and add\nmodifications to fit your need.\n\n## License\n\nThis repository is open-sourced under the [MIT license](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancern%2Fllvm-covmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flancern%2Fllvm-covmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancern%2Fllvm-covmap/lists"}