<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><linkrel="stylesheet"href="llvm.css"type="text/css"><title>LLVM Coding Standards</title></head><body><divclass="doc_title">
LLVM Coding Standards
</div><ol><li><ahref="#introduction">Introduction</a></li><li><ahref="#mechanicalissues">Mechanical Source Issues</a><ol><li><ahref="#sourceformating">Source Code Formatting</a><ol><li><ahref="#scf_commenting">Commenting</a></li><li><ahref="#scf_commentformat">Comment Formatting</a></li><li><ahref="#scf_includes"><tt>#include</tt> Style</a></li><li><ahref="#scf_codewidth">Source Code Width</a></li><li><ahref="#scf_spacestabs">Use Spaces Instead of Tabs</a></li><li><ahref="#scf_indentation">Indent Code Consistently</a></li></ol></li><li><ahref="#compilerissues">Compiler Issues</a><ol><li><ahref="#ci_warningerrors">Treat Compiler Warnings Like
Errors</a></li><li><ahref="#ci_portable_code">Write Portable Code</a></li><li><ahref="#ci_class_struct">Use of class/struct Keywords</a></li></ol></li></ol></li><li><ahref="#styleissues">Style Issues</a><ol><li><ahref="#macro">The High Level Issues</a><ol><li><ahref="#hl_module">A Public Header File <b>is</b> a
Module</a></li><li><ahref="#hl_dontinclude">#include as Little as Possible</a></li><li><ahref="#hl_privateheaders">Keep "internal" Headers
Private</a></li><li><ahref="#hl_earlyexit">Use Early Exits and 'continue' to Simplify
Code</a></li><li><ahref="#hl_predicateloops">Turn Predicate Loops into Predicate
Functions</a></li></ol></li><li><ahref="#micro">The Low Level Issues</a><ol><li><ahref="#ll_assert">Assert Liberally</a></li><li><ahref="#ll_ns_std">Do not use 'using namespace std'</a></li><li