reference, declaration → definition definition → references, declarations, derived classes, virtual overrides reference to multiple definitions → definitions unreferenced |
2135 visitGlobalValue(F); 2138 FunctionType *FT = F.getFunctionType(); 2139 unsigned NumArgs = F.arg_size(); 2141 Assert(&Context == &F.getContext(), 2142 "Function context does not match Module context!", &F); 2144 Assert(!F.hasCommonLinkage(), "Functions may not have common linkage", &F); 2144 Assert(!F.hasCommonLinkage(), "Functions may not have common linkage", &F); 2146 "# formal arguments must match # of arguments for function type!", &F, 2148 Assert(F.getReturnType()->isFirstClassType() || 2149 F.getReturnType()->isVoidTy() || F.getReturnType()->isStructTy(), 2149 F.getReturnType()->isVoidTy() || F.getReturnType()->isStructTy(), 2150 "Functions cannot return aggregate values!", &F); 2152 Assert(!F.hasStructRetAttr() || F.getReturnType()->isVoidTy(), 2152 Assert(!F.hasStructRetAttr() || F.getReturnType()->isVoidTy(), 2153 "Invalid struct return type!", &F); 2155 AttributeList Attrs = F.getAttributes(); 2158 "Attribute after last parameter!", &F); 2160 bool isLLVMdotName = F.getName().size() >= 5 && 2161 F.getName().substr(0, 5) == "llvm."; 2164 verifyFunctionAttrs(FT, Attrs, &F, isLLVMdotName); 2170 "Attribute 'builtin' can only be applied to a callsite.", &F); 2175 switch (F.getCallingConv()) { 2181 Assert(F.getReturnType()->isVoidTy(), 2182 "Calling convention requires void return type", &F); 2189 Assert(!F.hasStructRetAttr(), 2190 "Calling convention does not allow sret", &F); 2197 Assert(!F.isVarArg(), "Calling convention does not support varargs or " 2199 &F); 2205 for (const Argument &Arg : F.args()) { 2213 "Function takes metadata but isn't an intrinsic", &Arg, &F); 2215 "Function takes token but isn't an intrinsic", &Arg, &F); 2226 Assert(!F.getReturnType()->isTokenTy(), 2227 "Functions returns a token but isn't an intrinsic", &F); 2231 F.getAllMetadata(MDs); 2232 assert(F.hasMetadata() != MDs.empty() && "Bit out-of-sync"); 2236 if (F.hasPersonalityFn()) { 2237 auto *Per = dyn_cast<Function>(F.getPersonalityFn()->stripPointerCasts()); 2239 Assert(Per->getParent() == F.getParent(), 2241 &F, F.getParent(), Per, Per->getParent()); 2241 &F, F.getParent(), Per, Per->getParent()); 2244 if (F.isMaterializable()) { 2246 Assert(MDs.empty(), "unmaterialized function cannot have metadata", &F, 2248 } else if (F.isDeclaration()) { 2254 &F); 2256 "function declaration may not have a !prof attachment", &F); 2261 Assert(!F.hasPersonalityFn(), 2262 "Function declaration shouldn't have a personality routine", &F); 2266 Assert(!isLLVMdotName, "llvm intrinsics cannot be defined!", &F); 2269 const BasicBlock *Entry = &F.getEntryBlock(); 2289 "function must have a single !dbg attachment", &F, I.second); 2291 "function !dbg attachment must be a subprogram", &F, I.second); 2294 AssertDI(!AttachedTo || AttachedTo == &F, 2295 "DISubprogram attached to more than one function", SP, &F); 2296 AttachedTo = &F; 2302 "function must have a single !prof attachment", &F, I.second); 2315 if (F.getIntrinsicID() && F.getParent()->isMaterialized()) { 2315 if (F.getIntrinsicID() && F.getParent()->isMaterialized()) { 2317 if (F.hasAddressTaken(&U)) 2321 auto *N = F.getSubprogram(); 2343 "DILocation's scope must be a DILocalScope", N, &F, &I, DL, 2357 AssertDI(SP->describes(&F), 2358 "!dbg attachment points at wrong subprogram for function", N, &F, 2361 for (auto &BB : F)