.. code-block:: c++
#include "llvm/Pass.h"
- #include "llvm/Function.h"
+ #include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
Which are needed because we are writing a `Pass
struct Hello : public FunctionPass {
-This declares a "``Hello``" class that is a subclass of `FunctionPass
+This declares a "``Hello``" class that is a subclass of :ref:`FunctionPass
<writing-an-llvm-pass-FunctionPass>`. The different builtin pass subclasses
are described in detail :ref:`later <writing-an-llvm-pass-pass-classes>`, but
for now, know that ``FunctionPass`` operates on a function at a time.
.. code-block:: c++
#include "llvm/Pass.h"
- #include "llvm/Function.h"
+ #include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-hello - Hello World Pass
-indvars - Induction Variable Simplification
-inline - Function Integration/Inlining
- -insert-edge-profiling - Insert instrumentation for edge profiling
...
The pass name gets added as the information string for your pass, giving some