<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Writing an LLVM Pass</title><linkrel="stylesheet"href="llvm.css"type="text/css"></head><body><divclass="doc_title">
Writing an LLVM Pass
</div><ol><li><ahref="#introduction">Introduction - What is a pass?</a></li><li><ahref="#quickstart">Quick Start - Writing hello world</a><ul><li><ahref="#makefile">Setting up the build environment</a></li><li><ahref="#basiccode">Basic code required</a></li><li><ahref="#running">Running a pass with <tt>opt</tt>
or <tt>analyze</tt></a></li></ul></li><li><ahref="#passtype">Pass classes and requirements</a><ul><li><ahref="#ImmutablePass">The <tt>ImmutablePass</tt> class</a></li><li><ahref="#Pass">The <tt>Pass</tt> class</a><ul><li><ahref="#run">The <tt>run</tt> method</a></li