From d8876a745038ac4418595fa8b197c7a3645079ca Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Sat, 19 Jan 2013 19:52:57 +0000 Subject: [PATCH] [analyzer] Don't show "Entered 'foo'" if 'foo' is implicit. Before: Calling implicit default constructor for 'Foo' (where Foo is constructed) Entered call from 'test' (at "=default" or 'Foo' declaration) Calling default constructor for 'Bar' (at "=default" or 'Foo' declaration) After: Calling implicit default constructor for 'Foo' (where Foo is constructed) Calling default constructor for 'Bar' (at "=default" or 'Foo' declaration) This only affects the plist diagnostics; this note is never shown in the other diagnostics. llvm-svn: 172915 --- clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp | 5 ++ clang/test/Analysis/inlining/path-notes.cpp | 84 ------------------------ 2 files changed, 5 insertions(+), 84 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index a584a84..3c6ff6c 100644 --- a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -877,6 +877,11 @@ IntrusiveRefCntPtr PathDiagnosticCallPiece::getCallEnterWithinCallerEvent() const { if (!callEnterWithin.asLocation().isValid()) return 0; + if (Callee->isImplicit()) + return 0; + if (const CXXMethodDecl *MD = dyn_cast(Callee)) + if (MD->isDefaulted()) + return 0; SmallString<256> buf; llvm::raw_svector_ostream Out(buf); diff --git a/clang/test/Analysis/inlining/path-notes.cpp b/clang/test/Analysis/inlining/path-notes.cpp index cfcd0ce..6678642 100644 --- a/clang/test/Analysis/inlining/path-notes.cpp +++ b/clang/test/Analysis/inlining/path-notes.cpp @@ -1067,20 +1067,6 @@ namespace defaulted { // CHECK-NEXT: col9 // CHECK-NEXT: file0 // CHECK-NEXT: -// CHECK-NEXT: depth1 -// CHECK-NEXT: extended_message -// CHECK-NEXT: Entered call from 'testDefaultConstruction' -// CHECK-NEXT: message -// CHECK-NEXT: Entered call from 'testDefaultConstruction' -// CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: kindevent -// CHECK-NEXT: location -// CHECK-NEXT: -// CHECK-NEXT: line93 -// CHECK-NEXT: col9 -// CHECK-NEXT: file0 -// CHECK-NEXT: // CHECK-NEXT: ranges // CHECK-NEXT: // CHECK-NEXT: @@ -1294,20 +1280,6 @@ namespace defaulted { // CHECK-NEXT: col9 // CHECK-NEXT: file0 // CHECK-NEXT: -// CHECK-NEXT: depth1 -// CHECK-NEXT: extended_message -// CHECK-NEXT: Entered call from 'testCopyConstruction' -// CHECK-NEXT: message -// CHECK-NEXT: Entered call from 'testCopyConstruction' -// CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: kindevent -// CHECK-NEXT: location -// CHECK-NEXT: -// CHECK-NEXT: line93 -// CHECK-NEXT: col9 -// CHECK-NEXT: file0 -// CHECK-NEXT: // CHECK-NEXT: ranges // CHECK-NEXT: // CHECK-NEXT: @@ -1555,20 +1527,6 @@ namespace defaulted { // CHECK-NEXT: col5 // CHECK-NEXT: file0 // CHECK-NEXT: -// CHECK-NEXT: depth1 -// CHECK-NEXT: extended_message -// CHECK-NEXT: Entered call from 'testMoveConstruction' -// CHECK-NEXT: message -// CHECK-NEXT: Entered call from 'testMoveConstruction' -// CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: kindevent -// CHECK-NEXT: location -// CHECK-NEXT: -// CHECK-NEXT: line107 -// CHECK-NEXT: col5 -// CHECK-NEXT: file0 -// CHECK-NEXT: // CHECK-NEXT: ranges // CHECK-NEXT: // CHECK-NEXT: @@ -1850,20 +1808,6 @@ namespace defaulted { // CHECK-NEXT: col9 // CHECK-NEXT: file0 // CHECK-NEXT: -// CHECK-NEXT: depth1 -// CHECK-NEXT: extended_message -// CHECK-NEXT: Entered call from 'testCopyAssignment' -// CHECK-NEXT: message -// CHECK-NEXT: Entered call from 'testCopyAssignment' -// CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: kindevent -// CHECK-NEXT: location -// CHECK-NEXT: -// CHECK-NEXT: line93 -// CHECK-NEXT: col9 -// CHECK-NEXT: file0 -// CHECK-NEXT: // CHECK-NEXT: ranges // CHECK-NEXT: // CHECK-NEXT: @@ -2174,20 +2118,6 @@ namespace defaulted { // CHECK-NEXT: Calling defaulted move assignment operator for 'MovableWrapper' // CHECK-NEXT: // CHECK-NEXT: -// CHECK-NEXT: kindevent -// CHECK-NEXT: location -// CHECK-NEXT: -// CHECK-NEXT: line110 -// CHECK-NEXT: col5 -// CHECK-NEXT: file0 -// CHECK-NEXT: -// CHECK-NEXT: depth1 -// CHECK-NEXT: extended_message -// CHECK-NEXT: Entered call from 'testMoveAssignment' -// CHECK-NEXT: message -// CHECK-NEXT: Entered call from 'testMoveAssignment' -// CHECK-NEXT: -// CHECK-NEXT: // CHECK-NEXT: kindcontrol // CHECK-NEXT: edges // CHECK-NEXT: @@ -2499,20 +2429,6 @@ namespace defaulted { // CHECK-NEXT: // CHECK-NEXT: depth1 // CHECK-NEXT: extended_message -// CHECK-NEXT: Entered call from 'testDestruction' -// CHECK-NEXT: message -// CHECK-NEXT: Entered call from 'testDestruction' -// CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: kindevent -// CHECK-NEXT: location -// CHECK-NEXT: -// CHECK-NEXT: line93 -// CHECK-NEXT: col9 -// CHECK-NEXT: file0 -// CHECK-NEXT: -// CHECK-NEXT: depth1 -// CHECK-NEXT: extended_message // CHECK-NEXT: Calling '~Dereferencer' // CHECK-NEXT: message // CHECK-NEXT: Calling '~Dereferencer' -- 2.7.4