{"id":18932541,"url":"https://github.com/adrianherrera/llvm-cfg-to-json","last_synced_at":"2025-04-15T16:33:50.422Z","repository":{"id":85069581,"uuid":"214039563","full_name":"adrianherrera/llvm-cfg-to-json","owner":"adrianherrera","description":"Exports an LLVM control flow graph (CFG) (including function calls) to JSON","archived":false,"fork":false,"pushed_at":"2021-11-26T09:42:55.000Z","size":148,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T23:43:34.335Z","etag":null,"topics":["fuzzing","llvm","llvm-cfg"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adrianherrera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.jsoncpp","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":"2019-10-09T22:54:42.000Z","updated_at":"2024-09-25T23:55:12.000Z","dependencies_parsed_at":"2023-03-03T01:00:32.459Z","dependency_job_id":null,"html_url":"https://github.com/adrianherrera/llvm-cfg-to-json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianherrera%2Fllvm-cfg-to-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianherrera%2Fllvm-cfg-to-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianherrera%2Fllvm-cfg-to-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianherrera%2Fllvm-cfg-to-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrianherrera","download_url":"https://codeload.github.com/adrianherrera/llvm-cfg-to-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249108581,"owners_count":21214018,"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":["fuzzing","llvm","llvm-cfg"],"created_at":"2024-11-08T11:49:39.859Z","updated_at":"2025-04-15T16:33:50.417Z","avatar_url":"https://github.com/adrianherrera.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLVM CFG to JSON\n\nExports an LLVM control flow graph (CFG) to JSON. This pass is different from\nLLVM's standard CFG printer in that it captures both *intra* and *inter*\nprocedural edges (i.e., function calls).\n\n## Building\n\n```bash\ngit clone https://github.com/adrianherrera/llvm-cfg-to-json.git\ncd llvm-cfg-to-json\n\nmkdir build\ncd build\n\n# If you have multiple LLVM versions installed, specify the one you want by\n# setting LLVM_DIR; e.g., -DLLVM_DIR=`llvm-config-12 --cmakedir`\n#\n# This probably also requires setting CC/CXX\nCC=clang CXX=clang++ cmake ..\n```\n\n## Running\n\n```bash\nclang -fplugin=/path/to/build/libLLVMCFGToJSON.so /path/to/src.c\n```\n\nIf using autotools/make/etc., do\n\n```bash\nCFLAGS=\"-fplugin=/path/to/build/libLLVMCFGToJSON.so\" CXXFLAGS=\"-fplugin=/path/to/build/libLLVMCFGToJSON.so\" ./configure\nmake\n```\n\nOr CMake:\n\n```bash\ncmake -DCMAKE_C_FLAGS=\"-fplugin=/path/to/build/libLLVMCFGToJSON.so\" -DCMAKE_CXX_FLAGS=\"-fplugin=/path/to/build/libLLVMCFGToJSON.so\" ...\nmake\n```\n\n## `cfg_stats.py`\n\nUsing the results produced by the LLVM pass, calculate some interesting graph\nstatistics (e.g., number of basic blocks, number of edges, and the graph\neccentricity from the CFG's entry point). The script can also (optionally)\nproduce a DOT graph of the CFG.\n\n### Running\n\n```bash\nclang -fplugin=/path/to/build/libLLVMCFGToJSON.so /path/to/src.c\npython cfg_stats.py `pwd`/cfg.*.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianherrera%2Fllvm-cfg-to-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrianherrera%2Fllvm-cfg-to-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianherrera%2Fllvm-cfg-to-json/lists"}