xaizek / gcc-plugins (License: GPLv3+) (since 2018-12-07)
Some GCC plugins (actually only one was uploaded so far, and its functionality is not unique).
<root> / inc-tree /
File Mode Size
IncTree.cpp 100644 2,943B
IncTree.hpp 100644 2,113B
Makefile 100644 529B
README.md 100644 1,456B
TODO.md 100644 289B
inc-tree.cpp 100644 3,636B
tree.hpp 100644 86KiB
version.map 100644 104B

/README.md

inc-tree, 0.1, 2015

Brief Description

The purpose of this plugin is to display tree of includes per compilation unit. With its help one can answer from which place some particular include comes from.

Turns out there is already -H option for that.

Supported Environment

Tested with GCC 4.9.3, should work with 4.9 and maybe with newer versions.

Prerequisites

  • C++11 compatible compiler.
  • GCC installation with plugin support.
  • GNU Make.

Building

make

Usage example

Invocation:

g++ -std=c++11 -fplugin=./inc-tree.so test.c

Output:

test.c
    /usr/include/stdc-predef.h
    /usr/include/stdio.h
        /usr/include/features.h
            /usr/include/sys/cdefs.h
                /usr/include/bits/wordsize.h
            /usr/include/gnu/stubs.h
                /usr/include/gnu/stubs-64.h
        /usr/lib64/gcc/x86_64-slackware-linux/4.9.3/include/stddef.h
        /usr/include/bits/types.h
            /usr/include/bits/wordsize.h
            /usr/include/bits/typesizes.h
        /usr/include/libio.h
            /usr/include/_G_config.h
                /usr/lib64/gcc/x86_64-slackware-linux/4.9.3/include/stddef.h
                /usr/include/wchar.h
            /usr/lib64/gcc/x86_64-slackware-linux/4.9.3/include/stdarg.h
        /usr/include/bits/stdio_lim.h
        /usr/include/bits/sys_errlist.h

License

GNU General Public License, version 3 or later

Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/gcc-plugins

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/gcc-plugins

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master