Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 591b907

Browse files
committed
Add skeleton files for new analyzer site.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73086 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 9c2f84e commit 591b907

10 files changed

+1134
-0
lines changed

www/analyzer/annotations.html

+383
Large diffs are not rendered by default.

www/analyzer/available_checks.html

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2+
"http://www.w3.org/TR/html4/strict.dtd">
3+
<html>
4+
<head>
5+
<title>Available Checks</title>
6+
<link type="text/css" rel="stylesheet" href="menu.css" />
7+
<link type="text/css" rel="stylesheet" href="content.css" />
8+
</head>
9+
<body>
10+
11+
<!--#include virtual="menu.html.incl"-->
12+
13+
<div id="content">
14+
15+
<h1>Available Checks</h1>
16+
17+
<p>This page is slated to contain a list of the current checks the analyzer
18+
performs along with some self-contained code examples. In the meantime, please
19+
check out any of the following writeups about the analyzer that contain examples
20+
of some of the bugs that it finds:</p>
21+
22+
<ul>
23+
<li><a href="http://www.mobileorchard.com/bug-finding-with-clang-5-resources-to-get-you-started/">Bug Finding With Clang: 5 Resources To Get You Started</a></li>
24+
<li><a href="http://fruitstandsoftware.com/blog/index.php/2008/08/finding-memory-leaks-with-the-llvmclang-static-analyzer/#comment-2">Finding Memory Leaks With The LLVM/Clang Static Analyzer</a></li>
25+
<li><a href="http://www.therareair.com/howto-static-analyze-your-objective-c-code-using-the-clang-static-analyzer-tool-gallery/">HOWTO: Static Analyze Your Objective-C Code Using the Clang Static Analyzer Tool Gallery</a></li>
26+
<li><a href="http://www.rogueamoeba.com/utm/2008/07/14/the-clang-static-analyzer/">Under the Microscope - The Clang Static Analyzer</a></li>
27+
<li><a href="http://www.mikeash.com/?page=pyblog/friday-qa-2009-03-06-using-the-clang-static-analyzer.html">Mike Ash - Using the Clang Static Analyzer</a></li>
28+
</ul>
29+
30+
31+
</div>
32+
</body>
33+
</html>
34+

www/analyzer/content.css

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
html, body {
2+
padding:0px;
3+
font-size:small; font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, Helvetica, sans-serif; background-color: #fff; color: #222;
4+
line-height:1.5;
5+
}
6+
7+
h1, h2, h3, tt { color: #000 }
8+
9+
h1 { padding-top:0px; margin-top:0px;}
10+
h2 { color:#333333; padding-top:0.5em; }
11+
h3 { padding-top: 0.5em; margin-bottom: -0.25em; color:#2d58b7 }
12+
h4 { color:#2d58b7 }
13+
li { padding-bottom: 0.5em }
14+
ul { padding-left:1.5em; }
15+
16+
.command { font-weight:bold }
17+
.code_highlight { font-weight:bold; color:#2d58b7 }
18+
.code_example { border-width:1px; border-style:solid; border-color:#cccccc;
19+
background-color:#eeeeee; padding:10px }
20+
21+
/* Slides */
22+
IMG.img_slide {
23+
display: block;
24+
margin-left: auto;
25+
margin-right: auto
26+
}
27+
28+
.itemTitle { color:#2d58b7 }
29+
30+
/* Tables */
31+
tr { vertical-align:top }

www/analyzer/filing_bugs.html

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2+
"http://www.w3.org/TR/html4/strict.dtd">
3+
<html>
4+
<head>
5+
<title>Filing Bugs and Feature Requests</title>
6+
<link type="text/css" rel="stylesheet" href="menu.css" />
7+
<link type="text/css" rel="stylesheet" href="content.css" />
8+
</head>
9+
<body>
10+
11+
<!--#include virtual="menu.html.incl"-->
12+
13+
<div id="content">
14+
15+
<h1>Filing Bugs and Feature Requests</h1>
16+
17+
<p>We encourage users to file bug reports for any problems that they encounter.
18+
We also welcome feature requests. When filing a bug report, please do the
19+
following:</p>
20+
21+
<ul>
22+
23+
<li>Include the checker build (for prebuilt Mac OS X binaries) or the SVN
24+
revision number.</li>
25+
26+
<li>Provide a self-contained, reduced test case that exhibits the issue you are
27+
experiencing.</li>
28+
29+
<li>Test cases don't tell us everything. Please briefly describe the problem you
30+
are seeing, including what you thought should have been the expected behavior
31+
and why.</li>
32+
33+
</ul>
34+
35+
<h2>Outside of Apple</h2>
36+
37+
<h3>Bugzilla</h3>
38+
39+
<p>Please <a href="http://llvm.org/bugs/enter_bug.cgi?product=clang">file
40+
bugs</a> in LLVM's Bugzilla database against the Clang <b>Static Analyzer</b>
41+
component.</p>
42+
43+
<h3>Bugreporter.apple.com</h3>
44+
45+
<p>If you are using the analyzer to analyze code associated with an Apple NDA
46+
(e.g., preview versions of SDKs or seed releases of Mac OS X) please file bug
47+
reports to Apple's <a href="http://bugreporter.apple.com">Bug Reporter</a> web
48+
site.</p>
49+
50+
<p>You are free to always file bugs through this website, but this option less
51+
attractive than filing bug reports through Bugzilla as not everyone who works on
52+
the analyzer has access to that bug database.</p>
53+
54+
<h2>Apple-internal Users</h2>
55+
56+
<p>Please file bugs in Radar against the <b>llvm - checker</b> component.</p>
57+
58+
59+
</div>
60+
</body>
61+
</html>
62+

www/analyzer/index.html

+186
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2+
"http://www.w3.org/TR/html4/strict.dtd">
3+
<html>
4+
<head>
5+
<title>Clang Static Analyzer</title>
6+
<link type="text/css" rel="stylesheet" href="menu.css" />
7+
<link type="text/css" rel="stylesheet" href="content.css" />
8+
</head>
9+
<body>
10+
11+
<!--#include virtual="menu.html.incl"-->
12+
13+
<div id="content">
14+
15+
<h1>Clang Static Analyzer</h1>
16+
17+
<p>The Clang Static Analyzer consists of both a source code analysis framework
18+
and a standalone tool that finds bugs in C and Objective-C programs. The
19+
standalone tool is invoked from the command-line, and is intended to run in
20+
tandem with a build of a project or code base.</p>
21+
22+
<p>Both are 100% open source and are part of the <a
23+
href="http://clang.llvm.org">Clang</a> project.</p>
24+
25+
<!-- Generated from: http://www.spiffycorners.com/index.php -->
26+
27+
<style type="text/css">
28+
.spiffy{display:block}
29+
.spiffy *{
30+
display:block;
31+
height:1px;
32+
overflow:hidden;
33+
font-size:.01em;
34+
background:#EBF0FA}
35+
.spiffy1{
36+
margin-left:3px;
37+
margin-right:3px;
38+
padding-left:1px;
39+
padding-right:1px;
40+
border-left:1px solid #f6f8fc;
41+
border-right:1px solid #f6f8fc;
42+
background:#f0f3fb}
43+
.spiffy2{
44+
margin-left:1px;
45+
margin-right:1px;
46+
padding-right:1px;
47+
padding-left:1px;
48+
border-left:1px solid #fdfdfe;
49+
border-right:1px solid #fdfdfe;
50+
background:#eef2fa}
51+
.spiffy3{
52+
margin-left:1px;
53+
margin-right:1px;
54+
border-left:1px solid #eef2fa;
55+
border-right:1px solid #eef2fa;}
56+
.spiffy4{
57+
border-left:1px solid #f6f8fc;
58+
border-right:1px solid #f6f8fc}
59+
.spiffy5{
60+
border-left:1px solid #f0f3fb;
61+
border-right:1px solid #f0f3fb}
62+
.spiffyfg{
63+
background:#EBF0FA}
64+
65+
.spiffyfg h2 {
66+
margin:0px; padding:10px;
67+
}
68+
</style>
69+
70+
<style type="text/css">
71+
#left { float:left; }
72+
#left h2 { margin:1px; padding-top:0px; }
73+
#right { float:left; margin-left:20px; margin-right:20px; padding:0px ;}
74+
#right h2 { padding:0px; margin:0px; }
75+
#wrappedcontent { padding:15px;}
76+
</style>
77+
78+
<div style="padding:0px">
79+
<b class="spiffy">
80+
<b class="spiffy1"><b></b></b>
81+
<b class="spiffy2"><b></b></b>
82+
<b class="spiffy3"></b>
83+
<b class="spiffy4"></b>
84+
<b class="spiffy5"></b></b>
85+
<div class="spiffyfg">
86+
<div style="padding:15px">
87+
<h2 style="padding:0px; margin:0px">Download</h2>
88+
<h3 style="margin-top:5px">Mac OS X</h3>
89+
<ul>
90+
<li>Latest build (Universal binary, 10.5+):
91+
<!--#include virtual="latest_checker.html.incl"-->
92+
</li>
93+
<li><a href="/installation.html">Installation</a> and <a
94+
href="/scan-build.html">usage</a></li>
95+
</ul>
96+
<h3>Other Platforms</h3>
97+
<p>For other platforms, please follow the instructions for <a
98+
href="/installation#OtherPlatforms">building the analyzer</a> from
99+
source code.<p>
100+
</div>
101+
</div>
102+
<b class="spiffy">
103+
<b class="spiffy5"></b>
104+
<b class="spiffy4"></b>
105+
<b class="spiffy3"></b>
106+
<b class="spiffy2"><b></b></b>
107+
<b class="spiffy1"><b></b></b></b>
108+
</div>
109+
110+
<h2 id="StaticAnalysis">What is Static Analysis?</h2>
111+
112+
<p>The term &quot;static analysis&quot; is conflated, but here we use it to mean
113+
a collection of algorithms and techniques used to analyze source code in order
114+
to automatically find bugs. The idea is similar in spirit to compiler warnings
115+
(which can be useful for finding coding errors) but to take that idea a step
116+
further and find bugs that are traditionally found using run-time debugging
117+
techniques such as testing.</p>
118+
119+
<p>Static analysis bug-finding tools have evolved over the last several decades
120+
from basic syntactic checkers to those that find deep bugs by reasoning about
121+
the semantics of code. The goal of the Clang Static Analyzer is to provide a
122+
industrial-quality static analysis framework for analyzing C and Objective-C
123+
programs that is freely available, extensible, and has a high quality of
124+
implementation.</p>
125+
126+
<h3 id="Clang">Part of Clang and LLVM</h3>
127+
128+
<p>As its name implies, the Clang Static Analyzer is built on top of <a
129+
href="http://clang.llvm.org">Clang</a> and <a href="http://llvm.org">LLVM</a>.
130+
Strictly speaking, the analyzer is part of Clang, as Clang consists of a set of
131+
reusable C++ libraries for building powerful source-level tools. The static
132+
analysis engine used by the Clang Static Analyzer is a Clang library, and has
133+
the capability to be reused in different contexts and by different clients.</p>
134+
135+
<h2>Important Points to Consider</h2>
136+
137+
<p>While we believe that the static analyzer is already very useful for finding
138+
bugs, we ask you to bear in mind a few points when using it.</p>
139+
140+
<h3>Work-in-Progress</h3>
141+
142+
<p>The analyzer is a continuous work-in-progress.
143+
There are many planned enhancements to improve both the precision and scope of
144+
its analysis algorithms as well as the kinds bugs it will find. While there are
145+
fundamental limitations to what static analysis can do, we have a long way to go
146+
before hitting that wall.</p>
147+
148+
<h3>Slower than Compilation</h3>
149+
150+
<p>Operationally, using static analysis to
151+
automatically find deep program bugs is about trading CPU time for the hardening
152+
of code. Because of the deep analysis performed by state-of-the-art static
153+
analysis tools, static analysis can be much slower than compilation.</p>
154+
155+
<p>While the Clang Static Analyzer is being designed to be as fast and
156+
light-weight as possible, please do not expect it to be as fast as compiling a
157+
program (even with optimizations enabled). Some of the algorithms needed to find
158+
bugs require in the worst case exponential time.</p>
159+
160+
<p>The Clang Static Analyzer runs in a reasonable amount of time by both
161+
bounding the amount of checking work it will do as well as using clever
162+
algorithms to reduce the amount of work it must do to find bugs.</p></li>
163+
164+
<h3>False Positives</h3>
165+
166+
<p>Static analysis is not perfect. It can falsely flag bugs in a program where
167+
the code behaves correctly. Because some code checks require more analysis
168+
precision than others, the frequency of false positives can vary widely between
169+
different checks. Our long-term goal is to have the analyzer have a low false
170+
positive rate for most code on all checks.</p>
171+
172+
<p>Please help us in this endeavor by <a href="filing_bugs.html">reporting false
173+
positives</a>. False positives cannot be addressed unless we know about
174+
them.</p>
175+
176+
<h3>More Checks</h3>
177+
178+
<p>Static analysis not magic; a static analyzer can only find bugs that it has
179+
been specifically engineered to find. If there are specific kinds of bugs you
180+
would like the Clang Static Analyzer to find, please feel free to file <a
181+
href="filing_bugs.html">feature requests</a> or contribute your own patches.</p>
182+
183+
</div>
184+
</body>
185+
</html>
186+

0 commit comments

Comments
 (0)