Lines Matching refs:Function
283 BinaryFunction *Function = BC->createBinaryFunction( in discoverFileObjects() local
286 Function->setOutputAddress(Function->getAddress()); in discoverFileObjects()
296 BinaryFunction &Function = BFI.second; in discoverFileObjects() local
297 Function.setMaxSize(Function.getSize()); in discoverFileObjects()
299 ErrorOr<ArrayRef<uint8_t>> FunctionData = Function.getData(); in discoverFileObjects()
302 << "empty for function " << Function << '\n'; in discoverFileObjects()
307 if (Function.getSize() == 0) { in discoverFileObjects()
308 Function.setSimple(false); in discoverFileObjects()
315 Function.setFileOffset(FunctionData->begin() - FileBegin); in discoverFileObjects()
319 DataInCode.cbegin(), DataInCode.cend(), Function.getFileOffset(), in discoverFileObjects()
323 Function.getFileOffset() + Function.getMaxSize()) in discoverFileObjects()
324 Function.setSimple(false); in discoverFileObjects()
332 BinaryFunction &Function = BFI.second; in disassembleFunctions() local
333 if (!Function.isSimple()) in disassembleFunctions()
335 Function.disassemble(); in disassembleFunctions()
337 Function.print(outs(), "after disassembly", true); in disassembleFunctions()
343 BinaryFunction &Function = BFI.second; in buildFunctionsCFG() local
344 if (!Function.isSimple()) in buildFunctionsCFG()
346 if (!Function.buildCFG(/*AllocId*/ 0)) { in buildFunctionsCFG()
348 << Function << "\n"; in buildFunctionsCFG()
355 BinaryFunction &Function = BFI.second; in postProcessFunctions() local
356 if (Function.empty()) in postProcessFunctions()
358 Function.postProcessCFG(); in postProcessFunctions()
360 Function.print(outs(), "after building cfg", true); in postProcessFunctions()
403 for (BinaryFunction *Function : BC->getAllBinaryFunctions()) { in mapCodeSections()
404 if (!Function->isEmitted()) in mapCodeSections()
406 if (Function->getOutputAddress() == 0) in mapCodeSections()
408 ErrorOr<BinarySection &> FuncSection = Function->getCodeSection(); in mapCodeSections()
411 (Twine("Cannot find section for function ") + Function->getOneName()) in mapCodeSections()
415 FuncSection->setOutputAddress(Function->getOutputAddress()); in mapCodeSections()
418 << Twine::utohexstr(Function->getOutputAddress()) << '\n'); in mapCodeSections()
420 Function->getOutputAddress()); in mapCodeSections()
421 Function->setImageAddress(FuncSection->getAllocAddress()); in mapCodeSections()
422 Function->setImageSize(FuncSection->getOutputSize()); in mapCodeSections()
432 for (BinaryFunction *Function : BC->getAllBinaryFunctions()) { in mapCodeSections()
433 if (!Function->isEmitted()) in mapCodeSections()
435 if (Function->getOutputAddress() != 0) in mapCodeSections()
437 ErrorOr<BinarySection &> FuncSection = Function->getCodeSection(); in mapCodeSections()
442 Function->setFileOffset(Addr - BOLT->getAddress() + in mapCodeSections()
444 Function->setImageAddress(FuncSection->getAllocAddress()); in mapCodeSections()
445 Function->setImageSize(FuncSection->getOutputSize()); in mapCodeSections()
446 BC->registerNameAtAddress(Function->getOneName(), Addr, 0, 0); in mapCodeSections()
571 BinaryFunction &Function = BFI.second; in rewriteFile() local
572 if (!Function.isSimple()) in rewriteFile()
574 assert(Function.isEmitted() && "Simple function has not been emitted"); in rewriteFile()
575 if (!opts::Instrument && (Function.getImageSize() > Function.getMaxSize())) in rewriteFile()
578 outs() << "BOLT: rewriting function \"" << Function << "\"\n"; in rewriteFile()
579 OS.pwrite(reinterpret_cast<char *>(Function.getImageAddress()), in rewriteFile()
580 Function.getImageSize(), Function.getFileOffset()); in rewriteFile()
583 for (const BinaryFunction *Function : BC->getInjectedBinaryFunctions()) { in rewriteFile() local
584 OS.pwrite(reinterpret_cast<char *>(Function->getImageAddress()), in rewriteFile()
585 Function->getImageSize(), Function->getFileOffset()); in rewriteFile()