forked from OSchip/llvm-project
Rework checker "packages" and groups to be more hierarchical.
llvm-svn: 128187
This commit is contained in:
parent
f949d8e13d
commit
49c79790de
|
@ -1020,28 +1020,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
// Treat blocks as analysis entry points.
|
||||
CmdArgs.push_back("-analyzer-opt-analyze-nested-blocks");
|
||||
|
||||
CmdArgs.push_back("-analyzer-eagerly-assume");
|
||||
|
||||
// Add default argument set.
|
||||
if (!Args.hasArg(options::OPT__analyzer_no_default_checks)) {
|
||||
types::ID InputType = Inputs[0].getType();
|
||||
|
||||
// Checks to perform for all language types.
|
||||
|
||||
CmdArgs.push_back("-analyzer-checker=core");
|
||||
CmdArgs.push_back("-analyzer-checker=deadcode");
|
||||
CmdArgs.push_back("-analyzer-checker=security");
|
||||
|
||||
if (getToolChain().getTriple().getOS() != llvm::Triple::Win32)
|
||||
CmdArgs.push_back("-analyzer-checker=unix");
|
||||
|
||||
if (getToolChain().getTriple().getVendor() == llvm::Triple::Apple)
|
||||
CmdArgs.push_back("-analyzer-checker=macosx");
|
||||
|
||||
CmdArgs.push_back("-analyzer-checker=deadcode.DeadStores");
|
||||
CmdArgs.push_back("-analyzer-checker=deadcode.IdempotentOperations");
|
||||
|
||||
// Checks to perform for Objective-C/Objective-C++.
|
||||
if (types::isObjC(InputType)) {
|
||||
// Enable all checkers in 'cocoa' package.
|
||||
CmdArgs.push_back("-analyzer-checker=cocoa");
|
||||
}
|
||||
|
||||
CmdArgs.push_back("-analyzer-eagerly-assume");
|
||||
CmdArgs.push_back("-analyzer-checker=osx");
|
||||
}
|
||||
|
||||
// Set the output format. The default is plist, for (lame) historical
|
||||
|
|
|
@ -14,19 +14,26 @@ include "clang/StaticAnalyzer/Checkers/CheckerBase.td"
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
def Core : Package<"core">;
|
||||
def Cocoa : Package<"cocoa">;
|
||||
def Unix : Package<"unix">;
|
||||
def MacOSX : Package<"macosx">;
|
||||
def CoreBuiltin : Package<"builtin">, InPackage<Core>;
|
||||
def CoreUninitialized : Package<"uninitialized">, InPackage<Core>;
|
||||
def CoreExperimental : Package<"experimental">, InPackage<Core>, Hidden;
|
||||
|
||||
def Cplusplus : Package<"cplusplus">;
|
||||
def CplusplusExperimental : Package<"experimental">, InPackage<Cplusplus>, Hidden;
|
||||
|
||||
def DeadCode : Package<"deadcode">;
|
||||
def DeadCodeExperimental : Package<"experimental">, InPackage<DeadCode>, Hidden;
|
||||
|
||||
def CoreExperimental : Package<"experimental">,
|
||||
InPackage<Core>, Hidden;
|
||||
def Security : Package <"security">;
|
||||
def SecurityExperimental : Package<"experimental">, InPackage<Security>, Hidden;
|
||||
|
||||
def CocoaExperimental : Package<"experimental">,
|
||||
InPackage<Cocoa>, Hidden;
|
||||
def Unix : Package<"unix">;
|
||||
def UnixExperimental : Package<"experimental">, InPackage<Unix>, Hidden;
|
||||
|
||||
def UnixExperimental : Package<"experimental">,
|
||||
InPackage<Unix>, Hidden;
|
||||
def OSX : Package<"osx">;
|
||||
def Cocoa : Package<"cocoa">, InPackage<OSX>;
|
||||
def CocoaExperimental : Package<"experimental">, InPackage<Cocoa>, Hidden;
|
||||
def CoreFoundation : Package<"coreFoundation">, InPackage<OSX>;
|
||||
|
||||
def LLVM : Package<"llvm">;
|
||||
def Debug : Package<"debug">;
|
||||
|
@ -39,13 +46,251 @@ def AllExperimental : CheckerGroup<"all-experimental">,
|
|||
Hidden;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Checkers.
|
||||
// Core Checkers.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let ParentPackage = Core in {
|
||||
|
||||
def DereferenceChecker : Checker<"NullDereference">,
|
||||
HelpText<"Check for dereferences of null pointers">,
|
||||
DescFile<"DereferenceChecker.cpp">;
|
||||
|
||||
def CallAndMessageChecker : Checker<"CallAndMessage">,
|
||||
HelpText<"Check for logical errors for function calls and Objective-C message expressions (e.g., uninitialized arguments, null function pointers)">,
|
||||
DescFile<"CallAndMessageChecker.cpp">;
|
||||
|
||||
def AdjustedReturnValueChecker : Checker<"AdjustedReturnValue">,
|
||||
HelpText<"Check to see if the return value of a function call is different than the caller expects (e.g., from calls through function pointers)">,
|
||||
DescFile<"AdjustedReturnValueChecker.cpp">;
|
||||
|
||||
def AttrNonNullChecker : Checker<"AttributeNonNull">,
|
||||
HelpText<"Check for null pointers passed as arguments to a function whose arguments are marked with the 'nonnull' attribute">,
|
||||
DescFile<"AttrNonNullChecker.cpp">;
|
||||
|
||||
def VLASizeChecker : Checker<"VLASize">,
|
||||
HelpText<"Check for declarations of VLA of undefined or zero size">,
|
||||
DescFile<"VLASizeChecker.cpp">;
|
||||
|
||||
def DivZeroChecker : Checker<"DivideZero">,
|
||||
HelpText<"Check for division by zero">,
|
||||
DescFile<"DivZeroChecker.cpp">;
|
||||
|
||||
def UndefResultChecker : Checker<"UndefinedBinaryOperatorResult">,
|
||||
HelpText<"Check for undefined results of binary operators">,
|
||||
DescFile<"UndefResultChecker.cpp">;
|
||||
|
||||
def StackAddrEscapeChecker : Checker<"StackAddressEscape">,
|
||||
HelpText<"Check that addresses to stack memory do not escape the function">,
|
||||
DescFile<"StackAddrEscapeChecker.cpp">;
|
||||
|
||||
} // end "core"
|
||||
|
||||
let ParentPackage = CoreExperimental in {
|
||||
|
||||
def CastSizeChecker : Checker<"CastSize">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check when casting a malloc'ed type T, whether the size is a multiple of the size of T">,
|
||||
DescFile<"CastSizeChecker.cpp">;
|
||||
|
||||
def CastToStructChecker : Checker<"CastToStruct">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check for cast from non-struct pointer to struct pointer">,
|
||||
DescFile<"CastToStructChecker.cpp">;
|
||||
|
||||
def FixedAddressChecker : Checker<"FixedAddr">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check for assignment of a fixed address to a pointer">,
|
||||
DescFile<"FixedAddressChecker.cpp">;
|
||||
|
||||
def PointerArithChecker : Checker<"PointerArithm">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check for pointer arithmetic on locations other than array elements">,
|
||||
DescFile<"PointerArithChecker">;
|
||||
|
||||
def PointerSubChecker : Checker<"PointerSub">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check for pointer subtractions on two pointers pointing to different memory chunks">,
|
||||
DescFile<"PointerSubChecker">;
|
||||
|
||||
def SizeofPointerChecker : Checker<"SizeofPtr">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Warn about unintended use of sizeof() on pointer expressions">,
|
||||
DescFile<"CheckSizeofPointer.cpp">;
|
||||
|
||||
} // end "core.experimental"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Evaluate "builtin" functions.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let ParentPackage = CoreBuiltin in {
|
||||
|
||||
def NoReturnFunctionChecker : Checker<"NoReturnFunctions">,
|
||||
HelpText<"Evaluate \"panic\" functions that are known to not return to the caller">,
|
||||
DescFile<"NoReturnFunctionChecker.cpp">;
|
||||
|
||||
def BuiltinFunctionChecker : Checker<"BuiltinFunctions">,
|
||||
HelpText<"Evaluate compiler builtin functions (e.g., alloca())">,
|
||||
DescFile<"BuiltinFunctionChecker.cpp">;
|
||||
|
||||
} // end "core.builtin"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Uninitialized values checkers.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let ParentPackage = CoreUninitialized in {
|
||||
|
||||
def UndefinedArraySubscriptChecker : Checker<"ArraySubscript">,
|
||||
HelpText<"Check for uninitialized values used as array subscripts">,
|
||||
DescFile<"UndefinedArraySubscriptChecker.cpp">;
|
||||
|
||||
def UndefinedAssignmentChecker : Checker<"Assign">,
|
||||
HelpText<"Check for assigning uninitialized values">,
|
||||
DescFile<"UndefinedAssignmentChecker.cpp">;
|
||||
|
||||
def UndefBranchChecker : Checker<"Branch">,
|
||||
HelpText<"Check for uninitialized values used as branch conditions">,
|
||||
DescFile<"UndefBranchChecker.cpp">;
|
||||
|
||||
def UndefCapturedBlockVarChecker : Checker<"CapturedBlockVariable">,
|
||||
HelpText<"Check for blocks that capture uninitialized values">,
|
||||
DescFile<"UndefCapturedBlockVarChecker.cpp">;
|
||||
|
||||
def ReturnUndefChecker : Checker<"UndefReturn">,
|
||||
HelpText<"Check for uninitialized values being returned to the caller">,
|
||||
DescFile<"ReturnUndefChecker.cpp">;
|
||||
|
||||
} // end "core.uninitialized"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// C++ checkers.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let ParentPackage = CplusplusExperimental in {
|
||||
|
||||
def CStringChecker : Checker<"CString">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check calls to functions in <string.h>">,
|
||||
DescFile<"CStringChecker.cpp">;
|
||||
|
||||
def IteratorsChecker : Checker<"Iterators">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check improper uses of STL vector iterators">,
|
||||
DescFile<"IteratorsChecker.cpp">;
|
||||
|
||||
} // end: "cplusplus.experimental"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Deadcode checkers.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let ParentPackage = DeadCode in {
|
||||
|
||||
def DeadStoresChecker : Checker<"DeadStores">,
|
||||
HelpText<"Check for values stored to a variables that are never read afterwards">,
|
||||
DescFile<"DeadStoresChecker.cpp">;
|
||||
|
||||
def IdempotentOperationChecker : Checker<"IdempotentOperations">,
|
||||
HelpText<"Warn about idempotent operations">,
|
||||
DescFile<"IdempotentOperationChecker.cpp">;
|
||||
|
||||
} // end DeadCode
|
||||
|
||||
let ParentPackage = DeadCodeExperimental in {
|
||||
|
||||
def UnreachableCodeChecker : Checker<"UnreachableCode">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check unreachable code">,
|
||||
DescFile<"UnreachableCodeChecker.cpp">;
|
||||
|
||||
} // end "deadcode.experimental"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Security checkers.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let ParentPackage = SecurityExperimental in {
|
||||
|
||||
def SecuritySyntaxChecker : Checker<"SecuritySyntactic">,
|
||||
HelpText<"Perform quick security API checks that require no data flow">,
|
||||
DescFile<"CheckSecuritySyntaxOnly.cpp">;
|
||||
|
||||
def ArrayBoundChecker : Checker<"ArrayBound">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Warn about buffer overflows (older checker)">,
|
||||
DescFile<"ArrayBoundChecker.cpp">;
|
||||
|
||||
def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Warn about buffer overflows (newer checker)">,
|
||||
DescFile<"ArrayBoundCheckerV2.cpp">;
|
||||
|
||||
def ReturnPointerRangeChecker : Checker<"ReturnPtrRange">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check for an out-of-bound pointer being returned to callers">,
|
||||
DescFile<"ReturnPointerRangeChecker.cpp">;
|
||||
|
||||
} // end "security.experimental"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Unix API checkers.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let ParentPackage = Unix in {
|
||||
|
||||
def UnixAPIChecker : Checker<"API">,
|
||||
HelpText<"Check calls to various UNIX/Posix functions">,
|
||||
DescFile<"UnixAPIChecker.cpp">;
|
||||
|
||||
} // end "unix"
|
||||
|
||||
let ParentPackage = UnixExperimental in {
|
||||
|
||||
def ChrootChecker : Checker<"Chroot">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check improper use of chroot">,
|
||||
DescFile<"ChrootChecker.cpp">;
|
||||
|
||||
def MallocChecker : Checker<"Malloc">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check for potential memory leaks, double free, and use-after-free problems">,
|
||||
DescFile<"MallocChecker.cpp">;
|
||||
|
||||
def PthreadLockChecker : Checker<"PthreadLock">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Simple lock -> unlock checker">,
|
||||
DescFile<"PthreadLockChecker.cpp">;
|
||||
|
||||
def StreamChecker : Checker<"Stream">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Check stream handling functions">,
|
||||
DescFile<"StreamChecker.cpp">;
|
||||
|
||||
} // end "unix.experimental"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Mac OS X, Cocoa, and Core Foundation checkers.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let ParentPackage = OSX in {
|
||||
|
||||
def MacOSXAPIChecker : Checker<"API">,
|
||||
InPackage<OSX>,
|
||||
HelpText<"Check for proper uses of various Mac OS X APIs">,
|
||||
DescFile<"MacOSXAPIChecker.cpp">;
|
||||
|
||||
def OSAtomicChecker : Checker<"AtomicCAS">,
|
||||
InPackage<OSX>,
|
||||
HelpText<"Evaluate calls to OSAtomic functions">,
|
||||
DescFile<"OSAtomicChecker.cpp">;
|
||||
|
||||
} // end "macosx"
|
||||
|
||||
let ParentPackage = Cocoa in {
|
||||
|
||||
def ObjCSelfInitChecker : Checker<"SelfInit">,
|
||||
HelpText<"Check that 'self' is propely initialized inside an initializer method">,
|
||||
HelpText<"Check that 'self' is properly initialized inside an initializer method">,
|
||||
DescFile<"ObjCSelfInitChecker.cpp">;
|
||||
|
||||
def ObjCAtSyncChecker : Checker<"AtSync">,
|
||||
|
@ -66,10 +311,10 @@ def VariadicMethodTypeChecker : Checker<"VariadicMethodTypes">,
|
|||
DescFile<"BasicObjCFoundationChecks.cpp">;
|
||||
|
||||
def NSAutoreleasePoolChecker : Checker<"NSAutoreleasePool">,
|
||||
HelpText<"Warn for subpar uses of NSAutoreleasePool">,
|
||||
HelpText<"Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode">,
|
||||
DescFile<"NSAutoreleasePoolChecker.cpp">;
|
||||
|
||||
def ObjCMethSigsChecker : Checker<"MethodSigs">,
|
||||
def ObjCMethSigsChecker : Checker<"IncompatibleMethodTypes">,
|
||||
HelpText<"Warn about Objective-C method signatures with type incompatibilities">,
|
||||
DescFile<"CheckObjCInstMethSignature.cpp">;
|
||||
|
||||
|
@ -83,233 +328,60 @@ def NSErrorChecker : Checker<"NSError">,
|
|||
|
||||
} // end "cocoa"
|
||||
|
||||
let ParentPackage = Core in {
|
||||
let ParentPackage = CocoaExperimental in {
|
||||
|
||||
def DereferenceChecker : Checker<"Deref">,
|
||||
HelpText<"Check for null pointers at loads and stores">,
|
||||
DescFile<"DereferenceChecker.cpp">;
|
||||
def ObjCDeallocChecker : Checker<"Dealloc">,
|
||||
InGroup<AllExperimental>,
|
||||
HelpText<"Warn about Objective-C classes that lack a correct implementation of -dealloc">,
|
||||
DescFile<"CheckObjCDealloc.cpp">;
|
||||
|
||||
def CallAndMessageChecker : Checker<"CallAndMsg">,
|
||||
HelpText<"Check for errors of call and objc message expressions">,
|
||||
DescFile<"CallAndMessageChecker.cpp">;
|
||||
} // end "cocoa.experimental"
|
||||
|
||||
def AdjustedReturnValueChecker : Checker<"AdjustRet">,
|
||||
HelpText<"Check to see if the return value of a function call is different than the caller expects">,
|
||||
DescFile<"AdjustedReturnValueChecker.cpp">;
|
||||
|
||||
def AttrNonNullChecker : Checker<"AttrNonNull">,
|
||||
HelpText<"Check for arguments declared to have nonnull attribute">,
|
||||
DescFile<"AttrNonNullChecker.cpp">;
|
||||
|
||||
def VLASizeChecker : Checker<"VLASize">,
|
||||
HelpText<"Check for declarations of VLA of undefined or zero size">,
|
||||
DescFile<"VLASizeChecker.cpp">;
|
||||
|
||||
def DivZeroChecker : Checker<"DivZero">,
|
||||
HelpText<"Check for division by zeros">,
|
||||
DescFile<"DivZeroChecker.cpp">;
|
||||
|
||||
def ReturnUndefChecker : Checker<"UndefReturn">,
|
||||
HelpText<"Check for undefined or garbage values being returned to the caller">,
|
||||
DescFile<"ReturnUndefChecker.cpp">;
|
||||
|
||||
def UndefinedArraySubscriptChecker : Checker<"UndefArraySubscript">,
|
||||
HelpText<"Check for undefined array subscripts">,
|
||||
DescFile<"UndefinedArraySubscriptChecker.cpp">;
|
||||
|
||||
def UndefinedAssignmentChecker : Checker<"UndefAssign">,
|
||||
HelpText<"Check for assigning undefined values">,
|
||||
DescFile<"UndefinedAssignmentChecker.cpp">;
|
||||
|
||||
def UndefBranchChecker : Checker<"UndefBranch">,
|
||||
HelpText<"Check for undefined branch conditions">,
|
||||
DescFile<"UndefBranchChecker.cpp">;
|
||||
|
||||
def UndefCapturedBlockVarChecker : Checker<"UndefBlockVar">,
|
||||
HelpText<"Check for blocks that capture uninitialized values">,
|
||||
DescFile<"UndefCapturedBlockVarChecker.cpp">;
|
||||
|
||||
def UndefResultChecker : Checker<"UndefBinOpResult">,
|
||||
HelpText<"Check for undefined results of non-assignment binary operators">,
|
||||
DescFile<"UndefResultChecker.cpp">;
|
||||
|
||||
def NoReturnFunctionChecker : Checker<"NoReturnFunc">,
|
||||
HelpText<"Evaluate functions that do not return to the caller">,
|
||||
DescFile<"NoReturnFunctionChecker.cpp">;
|
||||
|
||||
def BuiltinFunctionChecker : Checker<"BuiltinFunc">,
|
||||
HelpText<"Evaluate clang builtin functions">,
|
||||
DescFile<"BuiltinFunctionChecker.cpp">;
|
||||
|
||||
def StackAddrEscapeChecker : Checker<"StackAddrEscape">,
|
||||
HelpText<"Check that addresses to stack memory do not escape the function">,
|
||||
DescFile<"StackAddrEscapeChecker.cpp">;
|
||||
|
||||
} // end "core"
|
||||
|
||||
let ParentPackage = DeadCode in {
|
||||
|
||||
def DeadStoresChecker : Checker<"DeadStores">,
|
||||
HelpText<"Check for values stored to a variables that are never read afterwards">,
|
||||
DescFile<"DeadStoresChecker.cpp">;
|
||||
|
||||
def IdempotentOperationChecker : Checker<"IdempotentOperations">,
|
||||
HelpText<"Warn about idempotent operations">,
|
||||
DescFile<"IdempotentOperationChecker.cpp">;
|
||||
|
||||
} // end DeadCode
|
||||
|
||||
def UnixAPIChecker : Checker<"API">,
|
||||
InPackage<Unix>,
|
||||
HelpText<"Check calls to various UNIX/Posix functions">,
|
||||
DescFile<"UnixAPIChecker.cpp">;
|
||||
|
||||
def MacOSXAPIChecker : Checker<"API">,
|
||||
InPackage<MacOSX>,
|
||||
HelpText<"Check for proper uses of various Mac OS X APIs">,
|
||||
DescFile<"MacOSXAPIChecker.cpp">;
|
||||
|
||||
def OSAtomicChecker : Checker<"AtomicCAS">,
|
||||
InPackage<MacOSX>,
|
||||
HelpText<"Evaluate calls to OSAtomic functions">,
|
||||
DescFile<"OSAtomicChecker.cpp">;
|
||||
let ParentPackage = CoreFoundation in {
|
||||
|
||||
def CFNumberCreateChecker : Checker<"CFNumber">,
|
||||
InPackage<MacOSX>,
|
||||
HelpText<"Check for proper uses of CFNumberCreate">,
|
||||
DescFile<"BasicObjCFoundationChecks.cpp">;
|
||||
|
||||
def CFRetainReleaseChecker : Checker<"CFRetainRelease">,
|
||||
InPackage<MacOSX>,
|
||||
HelpText<"Check for null arguments to CFRetain/CFRelease">,
|
||||
DescFile<"BasicObjCFoundationChecks.cpp">;
|
||||
|
||||
def CFErrorChecker : Checker<"CFError">,
|
||||
InPackage<MacOSX>,
|
||||
HelpText<"Check usage of CFErrorRef* parameters">,
|
||||
DescFile<"NSErrorChecker.cpp">;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Checkers for LLVM development.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
def LLVMConventionsChecker : Checker<"Conventions">,
|
||||
InPackage<LLVM>,
|
||||
HelpText<"Check code for LLVM codebase conventions">,
|
||||
DescFile<"LLVMConventionsChecker.cpp">;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Debugging checkers (for analyzer development).
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let ParentPackage = Debug in {
|
||||
|
||||
def LiveVariablesDumper : Checker<"DumpLiveVars">,
|
||||
InPackage<Debug>,
|
||||
HelpText<"Print results of live variable analysis">,
|
||||
DescFile<"DebugCheckers.cpp">;
|
||||
|
||||
def CFGViewer : Checker<"ViewCFG">,
|
||||
InPackage<Debug>,
|
||||
HelpText<"View Control-Flow Graphs using GraphViz">,
|
||||
DescFile<"DebugCheckers.cpp">;
|
||||
|
||||
def CFGDumper : Checker<"DumpCFG">,
|
||||
InPackage<Debug>,
|
||||
HelpText<"Display Control-Flow Graphs">,
|
||||
DescFile<"DebugCheckers.cpp">;
|
||||
|
||||
def AnalyzerStatsChecker : Checker<"Stats">,
|
||||
InPackage<Debug>,
|
||||
HelpText<"Emit warnings with analyzer statistics">,
|
||||
DescFile<"AnalyzerStatsChecker.cpp">;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Hidden experimental checkers.
|
||||
//===----------------------------------------------------------------------===//
|
||||
} // end "debug"
|
||||
|
||||
let Group = AllExperimental in {
|
||||
|
||||
def ArrayBoundCheckerV2 : Checker<"Overflow">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Warn about buffer overflows">,
|
||||
DescFile<"ArrayBoundCheckerV2.cpp">,
|
||||
Hidden; // Must be specified explicitly in order to run.
|
||||
|
||||
def MallocChecker : Checker<"Malloc">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check for potential memory leaks, double free, and use-after-free problems">,
|
||||
DescFile<"MallocChecker.cpp">;
|
||||
|
||||
def CStringChecker : Checker<"CString">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check calls to functions in <string.h>">,
|
||||
DescFile<"CStringChecker.cpp">;
|
||||
|
||||
def UnreachableCodeChecker : Checker<"UnreachableCode">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check unreachable code">,
|
||||
DescFile<"UnreachableCodeChecker.cpp">,
|
||||
Hidden; // Must be specified explicitly in order to run.
|
||||
|
||||
def CastToStructChecker : Checker<"CastToStruct">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check for cast from non-struct pointer to struct pointer">,
|
||||
DescFile<"CastToStructChecker.cpp">;
|
||||
|
||||
def FixedAddressChecker : Checker<"FixedAddr">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check for assignment of a fixed address to a pointer">,
|
||||
DescFile<"FixedAddressChecker.cpp">;
|
||||
|
||||
def PointerArithChecker : Checker<"PointerArithm">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check for pointer arithmetic on locations other than array elements">,
|
||||
DescFile<"PointerArithChecker">;
|
||||
|
||||
def PointerSubChecker : Checker<"PointerSub">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check for pointer subtractions on two pointers pointing to different memory chunks">,
|
||||
DescFile<"PointerSubChecker">;
|
||||
|
||||
def SizeofPointerChecker : Checker<"SizeofPtr">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Warn about unintended use of sizeof() on pointer expressions">,
|
||||
DescFile<"CheckSizeofPointer.cpp">;
|
||||
|
||||
def SecuritySyntaxChecker : Checker<"SecuritySyntactic">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Perform quick security checks that require no data flow">,
|
||||
DescFile<"CheckSecuritySyntaxOnly.cpp">;
|
||||
|
||||
def ReturnPointerRangeChecker : Checker<"ReturnPtrRange">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check for an out-of-bound pointer being returned to callers">,
|
||||
DescFile<"ReturnPointerRangeChecker.cpp">;
|
||||
|
||||
def ArrayBoundChecker : Checker<"ArrayBound">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check for an out-of-bound pointer being returned to callers">,
|
||||
DescFile<"ArrayBoundChecker.cpp">;
|
||||
|
||||
def CastSizeChecker : Checker<"CastSize">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check when casting a malloc'ed type T, whether the size is a multiple of the size of T">,
|
||||
DescFile<"CastSizeChecker.cpp">;
|
||||
|
||||
def ObjCDeallocChecker : Checker<"Dealloc">,
|
||||
InPackage<CocoaExperimental>,
|
||||
HelpText<"Warn about Objective-C classes that lack a correct implementation of -dealloc">,
|
||||
DescFile<"CheckObjCDealloc.cpp">;
|
||||
|
||||
def ChrootChecker : Checker<"Chroot">,
|
||||
InPackage<UnixExperimental>,
|
||||
HelpText<"Check improper use of chroot">,
|
||||
DescFile<"ChrootChecker.cpp">;
|
||||
|
||||
def PthreadLockChecker : Checker<"PthreadLock">,
|
||||
InPackage<UnixExperimental>,
|
||||
HelpText<"Simple lock -> unlock checker">,
|
||||
DescFile<"PthreadLockChecker.cpp">;
|
||||
|
||||
def StreamChecker : Checker<"Stream">,
|
||||
InPackage<UnixExperimental>,
|
||||
HelpText<"Check stream handling functions">,
|
||||
DescFile<"StreamChecker.cpp">;
|
||||
|
||||
def IteratorsChecker : Checker<"Iterators">,
|
||||
InPackage<CoreExperimental>,
|
||||
HelpText<"Check improper uses of STL vector iterators">,
|
||||
DescFile<"IteratorsChecker.cpp">;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,macosx.CFNumber -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,macosx.CFNumber -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,macosx.CFNumber -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,macosx.CFNumber -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
|
||||
|
||||
typedef signed long CFIndex;
|
||||
typedef const struct __CFAllocator * CFAllocatorRef;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,cocoa.NSError,macosx.CFError -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,cocoa.NSError,macosx.CFError -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,cocoa.NSError,macosx.CFError -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,cocoa.NSError,macosx.CFError -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=basic -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
|
||||
typedef signed char BOOL;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=cocoa.experimental.Dealloc '-DIBOutlet=__attribute__((iboutlet))' %s -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.experimental.Dealloc '-DIBOutlet=__attribute__((iboutlet))' %s -verify
|
||||
typedef signed char BOOL;
|
||||
@protocol NSObject
|
||||
- (BOOL)isEqual:(id)object;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,cocoa.NilArg,macosx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,cocoa.NilArg,macosx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,cocoa.NilArg,macosx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,cocoa.NilArg,macosx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
// ==-- FIXME: -analyzer-store=basic fails on this file (false negatives). --==
|
||||
// NOTWORK: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,cocoa.NilArg,macosx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s &&
|
||||
// NOTWORK: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,cocoa.NilArg,macosx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
||||
// NOTWORK: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,cocoa.NilArg,macosx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
||||
// NOTWORK: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,cocoa.NilArg,macosx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
// NOTWORK: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s &&
|
||||
// NOTWORK: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
||||
// NOTWORK: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
|
||||
// NOTWORK: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.AtomicCAS,core.experimental -analyzer-store=basic -analyzer-constraints=range -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// The following code is reduced using delta-debugging from
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental -analyzer-checker=cocoa.MethodSigs -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify %s
|
||||
|
||||
int printf(const char *, ...);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental -analyzer-checker=cocoa.experimental.Dealloc %s -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental -analyzer-checker=osx.cocoa.experimental.Dealloc %s -verify
|
||||
|
||||
// Tests for the checker which checks missing/extra ivar 'release' calls
|
||||
// in dealloc.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.UnreachableCode,core.experimental.Malloc -verify -analyzer-constraints=basic %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.UnreachableCode,core.experimental.Malloc -verify -analyzer-constraints=range %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.experimental.UnreachableCode,unix.experimental.Malloc -verify -analyzer-constraints=basic %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.experimental.UnreachableCode,unix.experimental.Malloc -verify -analyzer-constraints=range %s
|
||||
|
||||
// These are used to trigger warnings.
|
||||
typedef typeof(sizeof(int)) size_t;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,core.experimental.UnreachableCode -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,core.experimental.UnreachableCode -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,deadcode.experimental.UnreachableCode -analyzer-store=region -analyzer-constraints=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,deadcode.experimental.UnreachableCode -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
int string_literal_init() {
|
||||
char a[] = "abc";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.CString -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,core.experimental.CString -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,core.experimental.CString -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,core.experimental.CString -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.experimental.CString -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,cplusplus.experimental.CString -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,cplusplus.experimental.CString -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,cplusplus.experimental.CString -analyzer-store=region -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===
|
||||
// Declarations
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.UnreachableCode -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.experimental.UnreachableCode -verify %s
|
||||
|
||||
// Trigger a warning if the analyzer reaches this point in the control flow.
|
||||
#define WARN ((void)*(char*)0)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-checker=core,core.experimental.Malloc -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-checker=core,unix.experimental.Malloc -fblocks -verify %s
|
||||
void free(void *);
|
||||
|
||||
void t1 () {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.Iterators -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.experimental.Iterators -verify %s
|
||||
// XFAIL: win32
|
||||
|
||||
#include <vector>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.UnreachableCode,core.experimental.CastSize,core.experimental.Malloc -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.experimental.UnreachableCode,core.experimental.CastSize,unix.experimental.Malloc -analyzer-store=region -verify %s
|
||||
typedef __typeof(sizeof(int)) size_t;
|
||||
void *malloc(size_t);
|
||||
void free(void *);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental.CastToStruct,core.experimental.ReturnPtrRange,core.experimental.ReturnPtrRange,core.experimental.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental.CastToStruct,core.experimental.ReturnPtrRange,core.experimental.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental.CastToStruct,security.experimental.ReturnPtrRange,security.experimental.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental.CastToStruct,security.experimental.ReturnPtrRange,security.experimental.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
|
||||
|
||||
typedef long unsigned int size_t;
|
||||
void *memcpy(void *, const void *, size_t);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
// NOTE: Use '-fobjc-gc' to test the analysis being run twice, and multiple reports are not issued.
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,cocoa.AtSync -analyzer-disable-checker=core.experimental.Malloc -analyzer-store=basic -fobjc-gc -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,cocoa.AtSync -analyzer-disable-checker=core.experimental.Malloc -analyzer-store=basic -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,cocoa.AtSync -analyzer-disable-checker=core.experimental.Malloc -analyzer-store=basic -fobjc-gc -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,cocoa.AtSync -analyzer-disable-checker=core.experimental.Malloc -analyzer-store=basic -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-disable-checker=unix.experimental.Malloc -analyzer-store=basic -fobjc-gc -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-disable-checker=unix.experimental.Malloc -analyzer-store=basic -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-disable-checker=unix.experimental.Malloc -analyzer-store=basic -fobjc-gc -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-disable-checker=unix.experimental.Malloc -analyzer-store=basic -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,core.experimental,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code %s
|
||||
|
||||
#ifndef __clang_analyzer__
|
||||
#error __clang__analyzer__ not defined
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,unix.experimental,security.experimental.ArrayBound -analyzer-store=basic -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental,unix.experimental,security.experimental.ArrayBound -analyzer-store=region -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// This file tests cases where we should not flag out-of-bounds warnings.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,core.experimental.Overflow -verify %s
|
||||
// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,security.experimental.ArrayBoundV2 -verify %s
|
||||
|
||||
// Tests doing an out-of-bounds access after the end of an array using:
|
||||
// - constant integer index
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,unix.experimental,security.experimental.ArrayBound -analyzer-store=region -verify %s
|
||||
|
||||
typedef __typeof(sizeof(int)) size_t;
|
||||
void *malloc(size_t);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -verify -analyze -analyzer-checker=core,core.experimental -analyzer-store=region %s
|
||||
// RUN: %clang_cc1 -verify -analyze -analyzer-checker=core,security.experimental.ArrayBound -analyzer-store=region %s
|
||||
|
||||
struct tea_cheese { unsigned magic; };
|
||||
typedef struct tea_cheese kernel_tea_cheese_t;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,cocoa.NSAutoreleasePool -analyzer-store=basic -verify -fobjc-gc-only -fblocks %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,cocoa.NSAutoreleasePool -analyzer-store=region -fobjc-gc-only -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSAutoreleasePool -analyzer-store=basic -verify -fobjc-gc-only -fblocks %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSAutoreleasePool -analyzer-store=region -fobjc-gc-only -fblocks -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Header stuff.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,macosx.CFRetainRelease,cocoa.ClassRelease -analyzer-store=basic -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,macosx.CFRetainRelease,cocoa.ClassRelease -analyzer-store=region -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=basic -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease -analyzer-store=region -fblocks -verify %s
|
||||
|
||||
#if __has_feature(attribute_ns_returns_retained)
|
||||
#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=core.experimental.SecuritySyntactic %s -verify
|
||||
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=security.experimental.SecuritySyntactic %s -verify
|
||||
|
||||
// This file complements 'security-syntax-checks.m', but tests that we omit
|
||||
// specific checks on platforms where they don't make sense.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core.experimental.SecuritySyntactic %s -verify
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=security.experimental.SecuritySyntactic %s -verify
|
||||
|
||||
// <rdar://problem/6336718> rule request: floating point used as loop
|
||||
// condition (FLP30-C, FLP-30-CPP)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=cocoa.SelfInit %s -verify
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit %s -verify
|
||||
|
||||
@class NSZone, NSCoder;
|
||||
@protocol NSObject
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.CString,core.experimental.UnreachableCode -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,core.experimental.CString,core.experimental.UnreachableCode -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,core.experimental.CString,core.experimental.UnreachableCode -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,core.experimental.CString,core.experimental.UnreachableCode -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,cplusplus.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,cplusplus.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,cplusplus.experimental.CString,deadcode.experimental.UnreachableCode -analyzer-store=region -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===
|
||||
// Declarations
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=region -verify %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.experimental,core.uninitialized -analyzer-store=region -verify %s
|
||||
typedef __typeof(sizeof(int)) size_t;
|
||||
void *malloc(size_t);
|
||||
void free(void *);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=unix.API,macosx.API %s -analyzer-store=region -fblocks -verify
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=unix.API,macosx.API %s -analyzer-store=basic -fblocks -verify
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=unix.API,osx.API %s -analyzer-store=region -fblocks -verify
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=unix.API,osx.API %s -analyzer-store=basic -fblocks -verify
|
||||
|
||||
struct _opaque_pthread_once_t {
|
||||
long __sig;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.DeadStores,core.experimental.UnreachableCode -verify -analyzer-opt-analyze-nested-blocks -Wno-unused-value %s
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.experimental.UnreachableCode -verify -analyzer-opt-analyze-nested-blocks -Wno-unused-value %s
|
||||
|
||||
extern void foo(int a);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -fobjc-nonfragile-abi -fblocks -analyze -analyzer-checker=cocoa.UnusedIvars %s -verify
|
||||
// RUN: %clang_cc1 -fobjc-nonfragile-abi -fblocks -analyze -analyzer-checker=osx.cocoa.UnusedIvars %s -verify
|
||||
|
||||
//===--- BEGIN: Delta-debugging reduced headers. --------------------------===//
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,cocoa.VariadicMethodTypes -analyzer-store=basic -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,cocoa.VariadicMethodTypes -analyzer-store=region -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.VariadicMethodTypes -analyzer-store=basic -fblocks -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.VariadicMethodTypes -analyzer-store=region -fblocks -verify %s
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// The following code is reduced using delta-debugging from
|
||||
|
|
Loading…
Reference in New Issue