Lines Matching refs:Check
1 //===-- Lint.cpp - Check for common errors in LLVM IR ---------------------===//
176 // Check - We know that cond should be true, if not print an error message.
177 #define Check(C, ...) \
188 Check(F.hasName() || F.hasLocalLinkage(),
191 // TODO: Check for irreducible control flow.
202 Check(I.getCallingConv() == F->getCallingConv(),
209 Check(FT->isVarArg() ? FT->getNumParams() <= NumActualArgs
215 Check(FT->getReturnType() == I.getType(),
220 // Check argument types (in case the callee was casted) and attributes.
228 Check(Formal->getType() == Actual->getType(),
233 // Check that noalias arguments don't alias other arguments. This is
254 Check(Result != AliasResult::MustAlias &&
261 // Check that an sret argument points to valid memory.
270 // Check that ABI attributes for the function and call-site match.
280 Check(CallAttr.isValid() == FnAttr.isValid(),
286 Check(CallAttr == FnAttr,
307 Check(!isa<AllocaInst>(Obj),
320 // TODO: Check more intrinsics
330 // Check that the memcpy arguments don't overlap. The AliasAnalysis API
339 Check(AA->alias(MCI->getSource(), Size, MCI->getDest(), Size) !=
390 Check(!TripCount->isZero(),
400 Check(!F->doesNotReturn(),
405 Check(!isa<AllocaInst>(Obj), "Unusual: Returning alloca value", &I);
409 // TODO: Check that the reference is in bounds.
410 // TODO: Check readnone/readonly function attributes.
420 Check(!isa<ConstantPointerNull>(UnderlyingObject),
422 Check(!isa<UndefValue>(UnderlyingObject),
424 Check(!isa<ConstantInt>(UnderlyingObject) ||
427 Check(!isa<ConstantInt>(UnderlyingObject) ||
433 Check(!AMDGPU::isConstantAddressSpace(
438 Check(!GV->isConstant(), "Undefined behavior: Write to read-only memory",
440 Check(!isa<Function>(UnderlyingObject) &&
445 Check(!isa<Function>(UnderlyingObject), "Unusual: Load from function body",
447 Check(!isa<BlockAddress>(UnderlyingObject),
451 Check(!isa<BlockAddress>(UnderlyingObject),
455 Check(!isa<Constant>(UnderlyingObject) ||
460 // Check for buffer overflows and misalignment.
465 // OK, so the access is to a constant offset from Ptr. Check that Ptr is
491 Check(!Loc.Size.hasValue() || Loc.Size.isScalable() ||
501 Check(*Align <= commonAlignment(*BaseAlign, Offset),
527 Check(!isa<UndefValue>(I.getOperand(0)) || !isa<UndefValue>(I.getOperand(1)),
532 Check(!isa<UndefValue>(I.getOperand(0)) || !isa<UndefValue>(I.getOperand(1)),
539 Check(CI->getValue().ult(cast<IntegerType>(I.getType())->getBitWidth()),
546 Check(CI->getValue().ult(cast<IntegerType>(I.getType())->getBitWidth()),
553 Check(CI->getValue().ult(cast<IntegerType>(I.getType())->getBitWidth()),
595 Check(!isZero(I.getOperand(1), I.getDataLayout(), DT, AC),
600 Check(!isZero(I.getOperand(1), I.getDataLayout(), DT, AC),
605 Check(!isZero(I.getOperand(1), I.getDataLayout(), DT, AC),
610 Check(!isZero(I.getOperand(1), I.getDataLayout(), DT, AC),
617 Check(&I.getParent()->getParent()->getEntryBlock() == I.getParent(),
620 // TODO: Check for an unusual size (MSB set?)
632 Check(I.getNumDestinations() != 0,
640 Check(EC.isScalable() || CI->getValue().ult(EC.getFixedValue()),
649 Check(EC.isScalable() || CI->getValue().ult(EC.getFixedValue()),
656 Check(&I == &I.getParent()->front() ||
761 /// lintFunction - Check a function for errors, printing messages on stderr.
781 /// lintModule - Check a module for errors, printing messages on stderr.