Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using clang-based tools beyond loplugin

Miklos V
September 09, 2016
92

Using clang-based tools beyond loplugin

LibreOffice Conference 2016, Brno

Miklos V

September 09, 2016
Tweet

Transcript

  1. Using clang-based tools
    beyond loplugin
    By Miklos Vajna
    Senior Software Engineer at Collabora Productivity
    2016-09-09
    @CollaboraOffice www.CollaboraOffice.com

    View Slide

  2. 2 / 5
    LibreOffice Conference 2016, Brno | Miklos Vajna
    Beyond loplugin

    Compiler plugins

    Libtooling:

    Existing tools in clang-tools-extra

    Your own libtooling-based tools

    Libclang

    View Slide

  3. 3 / 5
    LibreOffice Conference 2016, Brno | Miklos Vajna
    Existing tools
    in clang-tools-extra

    clang-apply-replacements

    clang-format

    clang-include-fixer

    clang-rename

    clang-tidy
    … and this is not the complete list

    View Slide

  4. 4 / 5
    LibreOffice Conference 2016, Brno | Miklos Vajna
    Own tools
    in dev-tools.git

    Analyzer example: find-unused-prefixes

    m_nFooBar in core.git

    _fooBar in online.git

    FooBar in online.git for statics

    Rewriter example: rename

    Works from a CSV file

    Generated from… wait for it… find-unused-
    prefixes

    Obsoleted by clang-rename now

    View Slide

  5. 5 / 5
    LibreOffice Conference 2016, Brno | Miklos Vajna
    Editor support via libclang

    YouCompleteMe, libclang-vim

    Precise:

    Inspect comment

    Jump to declaration

    Get (member) function name

    Referenced (member) function name

    Jump to include

    Rename

    Infer auto

    Autocomplete

    View Slide