diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-08-16 17:45:23 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-08-16 17:45:23 +0000 |
commit | 9bf9af92a44b66f808679807ff67a02d0a67bcfc (patch) | |
tree | f34332efc40de61c924ac6384c242a66ab247120 /clang/test/Analysis/ptr-arith.c | |
parent | d624bfb5f0989f8a13d9ce772c70cd3cb7fd0a9f (diff) | |
download | bcm5719-llvm-9bf9af92a44b66f808679807ff67a02d0a67bcfc.tar.gz bcm5719-llvm-9bf9af92a44b66f808679807ff67a02d0a67bcfc.zip |
Allow multiple PathDiagnosticConsumers to be used with a BugReporter at the same time.
This fixes several issues:
- removes egregious hack where PlistDiagnosticConsumer would forward to HTMLDiagnosticConsumer,
but diagnostics wouldn't be generated consistently in the same way if PlistDiagnosticConsumer
was used by itself.
- emitting diagnostics to the terminal (using clang's diagnostic machinery) is no longer a special
case, just another PathDiagnosticConsumer. This also magically resolved some duplicate warnings,
as we now use PathDiagnosticConsumer's diagnostic pruning, which has scope for the entire translation
unit, not just the scope of a BugReporter (which is limited to a particular ExprEngine).
As an interesting side-effect, diagnostics emitted to the terminal also have their trailing "." stripped,
just like with diagnostics emitted to plists and HTML. This required some tests to be updated, but now
the tests have higher fidelity with what users will see.
There are some inefficiencies in this patch. We currently generate the report graph (from the ExplodedGraph)
once per PathDiagnosticConsumer, which is a bit wasteful, but that could be pulled up higher in the
logic stack. There is some intended duplication, however, as we now generate different PathDiagnostics (for the same issue)
for different PathDiagnosticConsumers. This is necessary to produce the diagnostics that a particular
consumer expects.
llvm-svn: 162028
Diffstat (limited to 'clang/test/Analysis/ptr-arith.c')
-rw-r--r-- | clang/test/Analysis/ptr-arith.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/Analysis/ptr-arith.c b/clang/test/Analysis/ptr-arith.c index 6567000c735..884ae5b9bbc 100644 --- a/clang/test/Analysis/ptr-arith.c +++ b/clang/test/Analysis/ptr-arith.c @@ -36,7 +36,7 @@ domain_port (const char *domain_b, const char *domain_e, void f3() { int x, y; - int d = &y - &x; // expected-warning{{Subtraction of two pointers that do not point to the same memory chunk may cause incorrect result.}} + int d = &y - &x; // expected-warning{{Subtraction of two pointers that do not point to the same memory chunk may cause incorrect result}} int a[10]; int *p = &a[2]; @@ -46,13 +46,13 @@ void f3() { void f4() { int *p; - p = (int*) 0x10000; // expected-warning{{Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.}} + p = (int*) 0x10000; // expected-warning{{Using a fixed address is not portable because that address will probably not be valid in all environments or platforms}} } void f5() { int x, y; int *p; - p = &x + 1; // expected-warning{{Pointer arithmetic done on non-array variables means reliance on memory layout, which is dangerous.}} + p = &x + 1; // expected-warning{{Pointer arithmetic done on non-array variables means reliance on memory layout, which is dangerous}} int a[10]; p = a + 1; // no-warning |