Home | History | Annotate | Download | only in IR

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.
91 bool runOnFunction(Function &F) {
94 for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
96 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.
166 bool runOnFunction(Function &F) {
183 // Scan through, checking all of the external function's linkage now...
187 // Check to make sure function prototypes are okay.
244 void visitMDNode(MDNode &MD, Function *F);
248 void visitFunction(Function &F);
299 bool PerformTypeCheck(Intrinsic::ID ID, Function *F, Type *Ty,
476 "Aliasing chain should end with function or global variable", &GA);
488 "Named metadata operand cannot be function local!", MD);
493 void Verifier::visitMDNode(MDNode &MD, Function *F) {
507 "Global metadata operand cannot be function local!", &MD, N);
514 // function that we expect.
515 Function *ActualF = 0;
522 assert(ActualF && "Unimplemented function local metadata case!");
524 Assert2(ActualF == F, "function-local metadata used in wrong function",
713 // VerifyFunctionAttrs - Check parameter attributes against a function type.
754 "' do not apply to the function!", V);
818 // visitFunction - Verify that a function is ok.
820 void Verifier::visitFunction(Function &F) {
821 // Check function arguments.
826 "Function context does not match Module context!", &F);
830 "# formal arguments must match # of arguments for function type!",
845 // Check function attributes.
848 // Check that this function meets the restrictions on this calling convention.
869 // Check that the argument values match the function type for this function...
871 for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end();
874 "Argument value does not match function argument type!",
877 "Function arguments must have first-class types!", I);
880 "Function takes metadata but isn't an intrinsic", I, &F);
884 // Function has a body somewhere we can't see.
888 "invalid linkage type for function declaration", &F);
890 // Verify that this function (which has a body) is not named "llvm.*". It
897 "Entry block to function must not have predecessors!", Entry);
906 // If this function is actually an intrinsic, verify that it is only used in
984 Function *F = RI.getParent()->getParent();
988 "Found return instr that returns non-void in Function of void "
992 "Function return type does not match operand "
1332 "Called function must be a pointer!", I);
1336 "Called function is not pointer to function type!", I);
1342 "Called function requires more parameters than were provided!",I);
1345 "Incorrect number of arguments passed to called function!", I);
1347 // Verify that all arguments to the call match the function type.
1350 "Call parameter type does not match function signature!",
1377 "Function has metadata parameter but isn't an intrinsic", I);
1386 if (Function *F = CI.getCalledFunction())
1773 // function should match.
1776 "Personality function doesn't match others in function", &LPI);
1780 Assert1(isa<Constant>(PersonalityFn), "Personality function is not constant!",
1865 if (Function *F = dyn_cast<Function>(I.getOperand(i))) {
1866 // Check to make sure that the "address of" an intrinsic function is never
1873 Assert1(F->getParent() == Mod, "Referencing function in another module!",
1877 "Referring to a basic block in another function!", &I);
1880 "Referring to an argument in another function!", &I);
1997 Function *IF = CI.getCalledFunction();
2026 // or are local to *this* function.
2074 "Enclosing function does not use GC.", &CI);
2077 Assert1(isa<Function>(CI.getArgOperand(1)->stripPointerCasts()),
2078 "llvm.init_trampoline parameter #2 must resolve to a function.",
2117 /// verifyFunction - Check a function for errors, printing messages on stderr.
2118 /// Return true if the function is corrupt.
2120 bool llvm::verifyFunction(const Function &f, VerifierFailureAction action) {
2121 Function &F = const_cast<Function&>(f);