-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] DeadStores: Add a crude suppression files generated by Dri…
…verKit IIG. IIG is a replacement for MIG in DriverKit: IIG is autogenerating C++ code. Suppress dead store warnings on such code, as the tool seems to be producing them regularly, and the users of IIG are not in position to address these warnings, as they don't control the autogenerated code. IIG-generated code is identified by looking at the comments at the top of the file. Differential Revision: https://reviews.llvm.org/D63118 llvm-svn: 363892
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* iig generated from SomethingSomething.iig */ | ||
|
||
// The comment above is the whole point of the test. | ||
// That's how the suppression works. | ||
// It needs to be on the top. | ||
// Run-lines can wait. | ||
|
||
// RUN: %clang_analyze_cc1 -w -triple x86_64-apple-driverkit19.0 \ | ||
// RUN: -analyzer-checker=deadcode -verify %s | ||
|
||
// expected-no-diagnostics | ||
|
||
#include "os_object_base.h" | ||
|
||
class OSSomething { | ||
kern_return_t Invoke(const IORPC); | ||
void foo(OSDispatchMethod supermethod) { | ||
kern_return_t ret; | ||
IORPC rpc; | ||
// Test the DriverKit specific suppression in the dead stores checker. | ||
if (supermethod) ret = supermethod((OSObject *)this, rpc); // no-warning | ||
else ret = ((OSObject *)this)->Invoke(rpc); // no-warning | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters