Home | History | Annotate | Download | only in VMCore

Lines Matching refs:Function

10 // This file defines the function verifier interface, that can be used for some
29 // * The entry node to a function must not have predecessors
32 // * Verify that a function's argument list agrees with it's declared type.
36 // agree with the function return value type.
37 // * Function call argument types match the function prototype
42 // * All landingpad instructions must use the same personality function with
43 // the same function.
90 bool runOnFunction(Function &F) {
93 for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
95 dbgs() << "Basic Block in function '" << F.getName()
140 /// PersonalityFn - The personality function referenced by the
141 /// LandingPadInsts. All LandingPadInsts within the same function must use
142 /// the same personality function.
169 bool runOnFunction(Function &F) {
190 // Scan through, checking all of the external function's linkage now...
194 // Check to make sure function prototypes are okay.
250 void visitMDNode(MDNode &MD, Function *F);
251 void visitFunction(Function &F);
301 bool PerformTypeCheck(Intrinsic::ID ID, Function *F, Type *Ty,
303 void VerifyIntrinsicPrototype(Intrinsic::ID ID, Function *F,
477 "Aliasing chain should end with function or global variable", &GA);
489 "Named metadata operand cannot be function local!", MD);
494 void Verifier::visitMDNode(MDNode &MD, Function *F) {
508 "Global metadata operand cannot be function local!", &MD, N);
515 // function that we expect.
516 Function *ActualF = 0;
523 assert(ActualF && "Unimplemented function local metadata case!");
525 Assert2(ActualF == F, "function-local metadata used in wrong function",
539 " only applies to the function!", V);
570 // VerifyFunctionAttrs - Check parameter attributes against a function type.
605 " does not apply to the function!", V);
629 // visitFunction - Verify that a function is ok.
631 void Verifier::visitFunction(Function &F) {
632 // Check function arguments.
637 "Function context does not match Module context!", &F);
641 "# formal arguments must match # of arguments for function type!",
656 // Check function attributes.
659 // Check that this function meets the restrictions on this calling convention.
679 // Check that the argument values match the function type for this function...
681 for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end();
684 "Argument value does not match function argument type!",
687 "Function arguments must have first-class types!", I);
690 "Function takes metadata but isn't an intrinsic", I, &F);
694 // Function has a body somewhere we can't see.
698 "invalid linkage type for function declaration", &F);
700 // Verify that this function (which has a body) is not named "llvm.*". It
707 "Entry block to function must not have predecessors!", Entry);
716 // If this function is actually an intrinsic, verify that it is only used in
794 Function *F = RI.getParent()->getParent();
798 "Found return instr that returns non-void in Function of void "
802 "Function return type does not match operand "
1107 "Called function must be a pointer!", I);
1111 "Called function is not pointer to function type!", I);
1117 "Called function requires more parameters than were provided!",I);
1120 "Incorrect number of arguments passed to called function!", I);
1122 // Verify that all arguments to the call match the function type.
1125 "Call parameter type does not match function signature!",
1154 "Function has metadata parameter but isn't an intrinsic", I);
1163 if (Function *F = CI.getCalledFunction())
1446 // function should match.
1449 "Personality function doesn't match others in function", &LPI);
1453 Assert1(isa<Constant>(PersonalityFn), "Personality function is not constant!",
1523 if (Function *F = dyn_cast<Function>(I.getOperand(i))) {
1524 // Check to make sure that the "address of" an intrinsic function is never
1528 Assert1(F->getParent() == Mod, "Referencing function in another module!",
1532 "Referring to a basic block in another function!", &I);
1535 "Referring to an argument in another function!", &I);
1628 Function *IF = CI.getCalledFunction();
1637 // or are local to *this* function.
1679 "Enclosing function does not use GC.", &CI);
1682 Assert1(isa<Function>(CI.getArgOperand(1)->stripPointerCasts()),
1683 "llvm.init_trampoline parameter #2 must resolve to a function.",
1725 bool Verifier::PerformTypeCheck(Intrinsic::ID ID, Function *F, Type *Ty,
1886 /// VerifyIntrinsicPrototype - TableGen emits calls to this function into
1889 void Verifier::VerifyIntrinsicPrototype(Intrinsic::ID ID, Function *F,
1896 // For overloaded intrinsics, the Suffix of the function name must match the
1947 // function is correct. We add the suffix to the name of the intrinsic and
1948 // compare against the given function name. If they are not the same, the
1949 // function name is invalid. This ensures that overloading of intrinsics
1977 /// verifyFunction - Check a function for errors, printing messages on stderr.
1978 /// Return true if the function is corrupt.
1980 bool llvm::verifyFunction(const Function &f, VerifierFailureAction action) {
1981 Function &F = const_cast<Function&>(f);