MyFirstTypoFix#
Introduction#
This tutorial will guide you through the process of making a change to LLVM, and contributing it back to the LLVM project.
Note
The code changes presented here are only an example and not something you should actually submit to the LLVM project. For your first real change to LLVM, the code will be different but the rest of the guide will still apply.
We’ll be making a change to Clang, but the steps for other parts of LLVM are the same. Even though the change we’ll be making is simple, we’re going to cover steps like building LLVM, running the tests, and code review. This is good practice, and you’ll be prepared for making larger changes.
We’ll assume you:
know how to use an editor,
have basic C++ knowledge,
know how to install software on your system,
are comfortable with the command line,
have basic knowledge of git.
The change we’re making#
Clang has a warning for infinite recursion:
$ echo "void foo() { foo(); }" > ~/test.cc
$ clang -c -Wall ~/test.cc
test.cc:1:12: warning: all paths through this function will call itself [-Winfinite-recursion]
This is clear enough, but not exactly catchy. Let’s improve the wording a little:
test.cc:1:12: warning: to understand recursion, you must first understand recursion [-Winfinite-recursion]
Dependencies#
We’re going to need some tools: