Morpheus is a refactoring engine for C, providing refactoring such as "renaming identifier", "extract function", and "inline function", in the presence of variability induced by #ifdefs and build-system variability.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Implementation of a variability-aware refactoring engine for C. Supports three standard refactorings (Rename Identifier, Extract Function, and Inlie Function). In contrast to existing refactoring engines such as Eclipse/CDT, Morpheus can handle varibility in source code induced by #ifdefs. That is all three refactorings are applied in all variants (with respect to #ifdef directives) in the source code. The engine relies on the variability-aware parsing and analysis infrastructure TypeChef.

Installation and Usage

Morpheus requires a modified version of TypeChef. To install it simply run:

git clone
cd TypeChef
git checkout master

To install the last version of Morpheus simply run:

git clone
cd Morpheus
git checkout master

The commands create a run-script ( for the project. Morpheus comes with a simplified GUI (parameter: --showGui) and a command line interface for evaluation of the refactorings. The simplified GUI is intended for testing and presentation only. To apply Morpheus in a real setting, a proper project setup has to be passed to the engine. Since the project setup of existing software systems is difficult to integrate with Morpheus, we currently support only three systems. The systems, including the proper setup to run with Morpheus, are available on github, too: Busybox, OpenSSL, and SQLite.


Morpheus is published as open source under LGPL 3.0. See LICENSE.