Advanced code transformation techniques using LLVM's Clang plugin infrastructure
Start Refactoring TutorialUse Clang's AST to traverse and modify code structure with precise transformations.
Learn AST Techniques →Implement refactoring operations through Clang's rewrite engine for source code changes.
View Passes →Build IDE-integrated refactoring tools using clang-tidy and clang-format APIs.
Tooling Guide →// clang-refactor.cpp #include "clang/Tooling/Tooling.h" #include "clang/Refactoring/RefactoringActions.h" using namespace clang::tooling; using namespace clang::refactor; class ExtractMethod : public RefactoringAction { protected: int runAction() override { // Implementation return 0; } }; int main(int argc, const char** argv) { CommonOptionsParser options(argc, argv); return runToolOnCode(<Extractor>, options.getCompilations(), options.getSourcePathList()); }
Learn to create plugins that refactor large code bodies into smaller functions.
View TutorialBuild rename tools that handle cross-file name propagation and semantic validation.
View TutorialHelp expand Clang's refactoring capabilities with your code transformation ideas.
Submit Your Plugin