<html>

<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Clangify2010.html - Usage</title>
</head>

<body>

<div id="content">

<h1>Clangify2010.py - Usage</h1>

<h2>You should use this script if:</h2>

<ul>
<li>You have a C or C++ Visual Studio 2010 project.</li>
<li>You have Python 3.x (Get the latest version <a href="http://python.org/download/">here</a>) in your PATH.</li>
<li>You have clang + llvm (Get the latest version <a href="http://clang.llvm.org/get_started.html">here</a>) in your PATH.</li>
<li>Your project does not have automatically generated intermediate files as part of the build step. This can be worked around by adding a custom pre_analysis function.</li>
<li>Source files don’t take different compiler flags.</li>
</ul>

<br />

<h2>You’re still here!</h2>

<p>
That’s excellent. Assuming you’ve met all of the above requirements, you should
download and copy clangify2010.py to wherever your project resides. Or,
alternatively, put it in a global location and add it to your PATH.
Let’s say you have a project file called Foo.vcxproj, holding 300 .cpp files
for your company’s latest project - Foo. To run clang on all these files, just type:
</p>

<p align=center><span style='font-family:Consolas'>
Clangify2010.py Foo.vcxproj
</span></p>

<p>
...in command prompt. This will automatically scan your project file for all your C++
files, and run clang’s analysis engine on them. For bonus points, you could run
it as a post-build step to your project and make sure everyone’s committing
bug-free code.
</p>

<h2>Caveats</h2>

<ol>
<li>
Clang is working hard to emulate gcc as much as possible, so there’s a chance your code
won’t work with it. For example, using Microsoft extensions like intrin.h will
be sure to screw up the analysis. You shouldn’t have to worry about this if you
write cross-platform code, but even if you don’t, it’s a good idea to fix the
errors anyhow. You never know when you’ll need to port to a different platform.
</li>

<li>
Clangify2010.py strives to be as easy to read and modify as possible. If it doesn’t <i>quite</i>
suit your needs, you can always tweak it to make it work the way you want it to
work.
</li>
</ol>

</div>
</body>
</html>