Lines Matching defs:Check

1 //===-- Lint.cpp - Check for common errors in LLVM IR ---------------------===//
172 // Check - We know that cond should be true, if not print an error message.
173 #define Check(C, ...) \
184 Check(F.hasName() || F.hasLocalLinkage(),
187 // TODO: Check for irreducible control flow.
198 Check(I.getCallingConv() == F->getCallingConv(),
205 Check(FT->isVarArg() ? FT->getNumParams() <= NumActualArgs
211 Check(FT->getReturnType() == I.getType(),
216 // Check argument types (in case the callee was casted) and attributes.
224 Check(Formal->getType() == Actual->getType(),
229 // Check that noalias arguments don't alias other arguments. This is
249 Check(Result != AliasResult::MustAlias &&
256 // Check that an sret argument points to valid memory.
278 Check(!isa<AllocaInst>(Obj),
291 // TODO: Check more intrinsics
301 // Check that the memcpy arguments don't overlap. The AliasAnalysis API
310 Check(AA->alias(MCI->getSource(), Size, MCI->getDest(), Size) !=
361 Check(!TripCount->isZero(),
371 Check(!F->doesNotReturn(),
376 Check(!isa<AllocaInst>(Obj), "Unusual: Returning alloca value", &I);
380 // TODO: Check that the reference is in bounds.
381 // TODO: Check readnone/readonly function attributes.
391 Check(!isa<ConstantPointerNull>(UnderlyingObject),
393 Check(!isa<UndefValue>(UnderlyingObject),
395 Check(!isa<ConstantInt>(UnderlyingObject) ||
398 Check(!isa<ConstantInt>(UnderlyingObject) ||
404 Check(!GV->isConstant(), "Undefined behavior: Write to read-only memory",
406 Check(!isa<Function>(UnderlyingObject) &&
411 Check(!isa<Function>(UnderlyingObject), "Unusual: Load from function body",
413 Check(!isa<BlockAddress>(UnderlyingObject),
417 Check(!isa<BlockAddress>(UnderlyingObject),
421 Check(!isa<Constant>(UnderlyingObject) ||
426 // Check for buffer overflows and misalignment.
431 // OK, so the access is to a constant offset from Ptr. Check that Ptr is
457 Check(!Loc.Size.hasValue() || BaseSize == MemoryLocation::UnknownSize ||
466 Check(*Align <= commonAlignment(*BaseAlign, Offset),
482 Check(!isa<UndefValue>(I.getOperand(0)) || !isa<UndefValue>(I.getOperand(1)),
487 Check(!isa<UndefValue>(I.getOperand(0)) || !isa<UndefValue>(I.getOperand(1)),
494 Check(CI->getValue().ult(cast<IntegerType>(I.getType())->getBitWidth()),
501 Check(CI->getValue().ult(cast<IntegerType>(I.getType())->getBitWidth()),
508 Check(CI->getValue().ult(cast<IntegerType>(I.getType())->getBitWidth()),
550 Check(!isZero(I.getOperand(1), I.getDataLayout(), DT, AC),
555 Check(!isZero(I.getOperand(1), I.getDataLayout(), DT, AC),
560 Check(!isZero(I.getOperand(1), I.getDataLayout(), DT, AC),
565 Check(!isZero(I.getOperand(1), I.getDataLayout(), DT, AC),
572 Check(&I.getParent()->getParent()->getEntryBlock() == I.getParent(),
575 // TODO: Check for an unusual size (MSB set?)
587 Check(I.getNumDestinations() != 0,
594 Check(
603 Check(CI->getValue().ult(
610 Check(&I == &I.getParent()->front() ||
715 /// lintFunction - Check a function for errors, printing messages on stderr.
735 /// lintModule - Check a module for errors, printing messages on stderr.