From 5594044cae1421301992d04a2272ed809d647982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=BCck?= Date: Sat, 4 Jan 2025 12:52:44 +0100 Subject: [PATCH 1/2] Update readme and version number --- CMakeLists.txt | 4 +++- README.md | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4016615..06007d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.20) -PROJECT(irprinter) +PROJECT(irprinter + VERSION 0.3 +) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_VERBOSE_MAKEFILE ON) diff --git a/README.md b/README.md index 945db89..9c6a7cb 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -# irprinter +# irprinter · ![License](https://img.shields.io/github/license/ahueck/irprinter) -*irprinter* is a small commandline-based tool developed to explore LLVM IR code. -The tool can print IR code of only specific functions, when dumping of the whole translation unit would produce too much output. +*irprinter* is a command-line tool for exploring LLVM Intermediate Representation (IR) code. +It allows users to print IR code for specific functions, which is particularly useful when dumping the entire translation unit would result in excessive output. -## Main features -Print LLVM IR code of a translation unit (C/C++) to a console. - - Ability to modify and add compiler flags (e.g., replace `-g` with `-O2`) and re-generate the (modified) IR - - Regex matching of (demangled) function names, with the ability to print - 1) Function signatures only, and, - 2) Functions including body - - Dump whole IR code of the TU +## Features +* Print LLVM IR code for a translation unit (C/C++) to the console. +* Modify and add compiler flags (e.g., replace -g with -O2) and regenerate the (modified) IR. +* Regex matching of (demangled) function names, with options to print: + 1. Function signatures only. + 2. Functions including their bodies. +* Dump the entire IR code of the translation unit. ## Usage -See [main.cpp](src/main.cpp) for all possible commandline arguments. +See [main.cpp](src/main.cpp) for all possible command-line arguments. ### Example of using *irprinter* Assume *test.c* contains the code: @@ -72,13 +72,13 @@ define i32 @main() local_unnamed_addr #1 { ## How to build ###### Requirements -- cmake >= 3.14 -- Clang/LLVM 10.0 (cmake needs to find the installation, see - the [LLVM cmake documentation](https://llvm.org/docs/CMake.html#id14)) -- C++ compiler with support for the C++17 standard, e.g., Clang 10 +- CMake >= 3.20 +- Clang/LLVM 12, 14, 18 (CMake needs to find the installation, see + the [LLVM CMake documentation](https://llvm.org/docs/CMake.html) or the [CI workflow](.github/workflows/basic-ci.yml)) +- C++17 compiler ###### Build steps -In the root project folder, execute the following commands +In the root project folder, execute the following commands (see also [CI workflow](.github/workflows/basic-ci.yml)) ``` cmake -B build -DCMAKE_INSTALL_PREFIX=*your path* From 2ae9016228248ea63d460364010d9051cb26eb5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=BCck?= Date: Sat, 4 Jan 2025 12:55:39 +0100 Subject: [PATCH 2/2] License year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 14fc897..5b632af 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Alexander Hück +Copyright (c) 2018-2025 Alexander Hück Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal