Overview
Explore automated C++ refactoring using Clang in this 44-minute CppNow conference talk. Learn about the infrastructure built on top of Clang for recognizing and transforming specific C++ patterns. Discover the process of creating a source-to-source translation tool for updating from old APIs to new ones. Delve into topics such as refactoring goals, automation tools, cross-translation barriers, integration layers, and standalone tools. Gain insights into the framework's architecture, including predicate libraries, primitive matchers, and bound matchers. Watch a live demo of the refactoring tool in action and understand how to leverage open-source data tools for effective C++ code transformation.
Syllabus
Introduction
The goal of refactoring
Tools and automation
Crosstranslation barrier
Integration
Architecture
Libraries
Integration Layers
Questions
Standalone Tools
Stroman Interface
The Problem
The First Step
The Framework
Refactoring Tool
The Magic
The predicate library
Building a primitive matcher
Restricting the matcher
Adding a predicate
Adding a class
namespace matches
Combining predicates
Source code example
Match Finder
Renamer
Bound Matchers
Replace Object
Match Methods
Live Demo
RealMatcher
Open Source
Data Tool
Taught by
CppNow