• Home
  • Raw
  • Download

Lines Matching refs:llvm

177 static std::map<std::string, llvm::Value*> namedValues;
190 static llvm::StructType *ourTypeInfoType;
192 static llvm::StructType *ourCaughtResultType;
194 static llvm::StructType *ourExceptionType;
195 static llvm::StructType *ourUnwindExceptionType;
197 static llvm::ConstantInt *ourExceptionNotThrownState;
198 static llvm::ConstantInt *ourExceptionThrownState;
199 static llvm::ConstantInt *ourExceptionCaughtState;
202 typedef std::vector<llvm::Type*> ArgTypes;
220 llvm::Function *createFunction(llvm::Module &module, in createFunction()
221 llvm::Type *retType, in createFunction()
225 llvm::GlobalValue::LinkageTypes linkage, in createFunction()
228 llvm::FunctionType *functType = in createFunction()
229 llvm::FunctionType::get(retType, theArgTypes, isVarArg); in createFunction()
230 llvm::Function *ret = in createFunction()
231 llvm::Function::Create(functType, linkage, functName, &module); in createFunction()
237 for (llvm::Function::arg_iterator argIndex = ret->arg_begin(); in createFunction()
256 static llvm::AllocaInst *createEntryBlockAlloca(llvm::Function &function, in createEntryBlockAlloca()
258 llvm::Type *type, in createEntryBlockAlloca()
259 llvm::Constant *initWith = 0) { in createEntryBlockAlloca()
260 llvm::BasicBlock &block = function.getEntryBlock(); in createEntryBlockAlloca()
261 llvm::IRBuilder<> tmp(&block, block.begin()); in createEntryBlockAlloca()
262 llvm::AllocaInst *ret = tmp.CreateAlloca(type, 0, varName.c_str()); in createEntryBlockAlloca()
439 if (encoding == llvm::dwarf::DW_EH_PE_omit) in readEncodedPointer()
444 case llvm::dwarf::DW_EH_PE_absptr: in readEncodedPointer()
448 case llvm::dwarf::DW_EH_PE_uleb128: in readEncodedPointer()
452 case llvm::dwarf::DW_EH_PE_sleb128: in readEncodedPointer()
455 case llvm::dwarf::DW_EH_PE_udata2: in readEncodedPointer()
459 case llvm::dwarf::DW_EH_PE_udata4: in readEncodedPointer()
463 case llvm::dwarf::DW_EH_PE_udata8: in readEncodedPointer()
467 case llvm::dwarf::DW_EH_PE_sdata2: in readEncodedPointer()
471 case llvm::dwarf::DW_EH_PE_sdata4: in readEncodedPointer()
475 case llvm::dwarf::DW_EH_PE_sdata8: in readEncodedPointer()
487 case llvm::dwarf::DW_EH_PE_absptr: in readEncodedPointer()
490 case llvm::dwarf::DW_EH_PE_pcrel: in readEncodedPointer()
493 case llvm::dwarf::DW_EH_PE_textrel: in readEncodedPointer()
494 case llvm::dwarf::DW_EH_PE_datarel: in readEncodedPointer()
495 case llvm::dwarf::DW_EH_PE_funcrel: in readEncodedPointer()
496 case llvm::dwarf::DW_EH_PE_aligned: in readEncodedPointer()
504 if (encoding & llvm::dwarf::DW_EH_PE_indirect) { in readEncodedPointer()
651 if (lpStartEncoding != llvm::dwarf::DW_EH_PE_omit) { in handleLsda()
658 if (ttypeEncoding != llvm::dwarf::DW_EH_PE_omit) { in handleLsda()
879 void generateStringPrint(llvm::LLVMContext &context, in generateStringPrint()
880 llvm::Module &module, in generateStringPrint()
881 llvm::IRBuilder<> &builder, in generateStringPrint()
884 llvm::Function *printFunct = module.getFunction("printStr"); in generateStringPrint()
886 llvm::Value *stringVar; in generateStringPrint()
887 llvm::Constant *stringConstant = in generateStringPrint()
888 llvm::ConstantArray::get(context, toPrint); in generateStringPrint()
893 new llvm::GlobalVariable(module, in generateStringPrint()
896 llvm::GlobalValue::LinkerPrivateLinkage, in generateStringPrint()
905 llvm::Value *cast = builder.CreatePointerCast(stringVar, in generateStringPrint()
923 void generateIntegerPrint(llvm::LLVMContext &context, in generateIntegerPrint()
924 llvm::Module &module, in generateIntegerPrint()
925 llvm::IRBuilder<> &builder, in generateIntegerPrint()
926 llvm::Function &printFunct, in generateIntegerPrint()
927 llvm::Value &toPrint, in generateIntegerPrint()
930 llvm::Constant *stringConstant = llvm::ConstantArray::get(context, format); in generateIntegerPrint()
931 llvm::Value *stringVar; in generateIntegerPrint()
936 new llvm::GlobalVariable(module, in generateIntegerPrint()
939 llvm::GlobalValue::LinkerPrivateLinkage, in generateIntegerPrint()
948 llvm::Value *cast = builder.CreateBitCast(stringVar, in generateIntegerPrint()
976 static llvm::BasicBlock *createFinallyBlock(llvm::LLVMContext &context, in createFinallyBlock()
977 llvm::Module &module, in createFinallyBlock()
978 llvm::IRBuilder<> &builder, in createFinallyBlock()
979 llvm::Function &toAddTo, in createFinallyBlock()
982 llvm::BasicBlock &terminatorBlock, in createFinallyBlock()
983 llvm::BasicBlock &unwindResumeBlock, in createFinallyBlock()
984 llvm::Value **exceptionCaughtFlag, in createFinallyBlock()
985 llvm::Value **exceptionStorage in createFinallyBlock()
987 ,llvm::Value **caughtResultStorage in createFinallyBlock()
1008 llvm::PointerType *exceptionStorageType = builder.getInt8PtrTy(); in createFinallyBlock()
1012 llvm::ConstantPointerNull::get( in createFinallyBlock()
1018 llvm::ConstantAggregateZero::get( in createFinallyBlock()
1022 llvm::BasicBlock *ret = llvm::BasicBlock::Create(context, in createFinallyBlock()
1037 llvm::SwitchInst *theSwitch = builder.CreateSwitch(builder.CreateLoad( in createFinallyBlock()
1060 static llvm::BasicBlock *createCatchBlock(llvm::LLVMContext &context, in createCatchBlock()
1061 llvm::Module &module, in createCatchBlock()
1062 llvm::IRBuilder<> &builder, in createCatchBlock()
1063 llvm::Function &toAddTo, in createCatchBlock()
1066 llvm::BasicBlock &terminatorBlock, in createCatchBlock()
1067 llvm::Value &exceptionCaughtFlag) { in createCatchBlock()
1069 llvm::BasicBlock *ret = llvm::BasicBlock::Create(context, in createCatchBlock()
1113 llvm::Function *createCatchWrappedInvokeFunction(llvm::Module &module, in createCatchWrappedInvokeFunction()
1114 llvm::IRBuilder<> &builder, in createCatchWrappedInvokeFunction()
1115 llvm::FunctionPassManager &fpm, in createCatchWrappedInvokeFunction()
1116 llvm::Function &toInvoke, in createCatchWrappedInvokeFunction()
1121 llvm::LLVMContext &context = module.getContext(); in createCatchWrappedInvokeFunction()
1122 llvm::Function *toPrint32Int = module.getFunction("print32Int"); in createCatchWrappedInvokeFunction()
1130 llvm::Function *ret = createFunction(module, in createCatchWrappedInvokeFunction()
1135 llvm::Function::ExternalLinkage, in createCatchWrappedInvokeFunction()
1140 llvm::BasicBlock *entryBlock = llvm::BasicBlock::Create(context, in createCatchWrappedInvokeFunction()
1144 llvm::BasicBlock *normalBlock = llvm::BasicBlock::Create(context, in createCatchWrappedInvokeFunction()
1148 llvm::BasicBlock *exceptionBlock = llvm::BasicBlock::Create(context, in createCatchWrappedInvokeFunction()
1153 llvm::BasicBlock *exceptionRouteBlock = llvm::BasicBlock::Create(context, in createCatchWrappedInvokeFunction()
1158 llvm::BasicBlock *externalExceptionBlock = llvm::BasicBlock::Create(context, in createCatchWrappedInvokeFunction()
1163 llvm::BasicBlock *unwindResumeBlock = llvm::BasicBlock::Create(context, in createCatchWrappedInvokeFunction()
1168 llvm::BasicBlock *endBlock = llvm::BasicBlock::Create(context, "end", ret); in createCatchWrappedInvokeFunction()
1171 std::vector<llvm::BasicBlock*> catchBlocks(numExceptionsToCatch); in createCatchWrappedInvokeFunction()
1172 llvm::Value *exceptionCaughtFlag = NULL; in createCatchWrappedInvokeFunction()
1173 llvm::Value *exceptionStorage = NULL; in createCatchWrappedInvokeFunction()
1175 llvm::Value *caughtResultStorage = NULL; in createCatchWrappedInvokeFunction()
1180 llvm::BasicBlock *finallyBlock = createFinallyBlock(context, in createCatchWrappedInvokeFunction()
1213 std::vector<llvm::Value*> args; in createCatchWrappedInvokeFunction()
1229 llvm::Function *deleteOurException = module.getFunction("deleteOurException"); in createCatchWrappedInvokeFunction()
1257 llvm::Function *resumeOurException = module.getFunction("_Unwind_Resume"); in createCatchWrappedInvokeFunction()
1267 llvm::Function *personality = module.getFunction("ourPersonality"); in createCatchWrappedInvokeFunction()
1270 llvm::LandingPadInst *caughtResult = in createCatchWrappedInvokeFunction()
1284 llvm::Value *unwindException = builder.CreateExtractValue(caughtResult, 0); in createCatchWrappedInvokeFunction()
1285 llvm::Value *retTypeInfoIndex = builder.CreateExtractValue(caughtResult, 1); in createCatchWrappedInvokeFunction()
1294 llvm::Function *ehException = module.getFunction("llvm.eh.exception"); in createCatchWrappedInvokeFunction()
1297 llvm::Value *unwindException = builder.CreateCall(ehException); in createCatchWrappedInvokeFunction()
1302 llvm::Value *functPtr = builder.CreatePointerCast(personality, in createCatchWrappedInvokeFunction()
1316 args.push_back(llvm::ConstantInt::get(builder.getInt32Ty(), 0)); in createCatchWrappedInvokeFunction()
1318 llvm::Function *ehSelector = module.getFunction("llvm.eh.selector"); in createCatchWrappedInvokeFunction()
1327 llvm::Value *retTypeInfoIndex = builder.CreateCall(ehSelector, args); in createCatchWrappedInvokeFunction()
1333 llvm::Value *unwindExceptionClass = in createCatchWrappedInvokeFunction()
1342 llvm::ConstantInt::get(builder.getInt64Ty(), in createCatchWrappedInvokeFunction()
1368 llvm::Value *typeInfoThrown = builder.CreatePointerCast( in createCatchWrappedInvokeFunction()
1379 llvm::Value *typeInfoThrownType = in createCatchWrappedInvokeFunction()
1394 llvm::SwitchInst *switchToCatchBlock = builder.CreateSwitch(retTypeInfoIndex, in createCatchWrappedInvokeFunction()
1402 switchToCatchBlock->addCase(llvm::ConstantInt::get( in createCatchWrappedInvokeFunction()
1403 llvm::Type::getInt32Ty(context), i), in createCatchWrappedInvokeFunction()
1413 llvm::verifyFunction(*ret); in createCatchWrappedInvokeFunction()
1435 llvm::Function *createThrowExceptionFunction(llvm::Module &module, in createThrowExceptionFunction()
1436 llvm::IRBuilder<> &builder, in createThrowExceptionFunction()
1437 llvm::FunctionPassManager &fpm, in createThrowExceptionFunction()
1440 llvm::Function &nativeThrowFunct) { in createThrowExceptionFunction()
1441 llvm::LLVMContext &context = module.getContext(); in createThrowExceptionFunction()
1448 llvm::Function *ret = createFunction(module, in createThrowExceptionFunction()
1453 llvm::Function::ExternalLinkage, in createThrowExceptionFunction()
1459 llvm::BasicBlock *entryBlock = llvm::BasicBlock::Create(context, in createThrowExceptionFunction()
1463 llvm::BasicBlock *nativeThrowBlock = llvm::BasicBlock::Create(context, in createThrowExceptionFunction()
1467 llvm::BasicBlock *generatedThrowBlock = llvm::BasicBlock::Create(context, in createThrowExceptionFunction()
1471 llvm::Value *exceptionType = namedValues["exceptTypeToThrow"]; in createThrowExceptionFunction()
1485 llvm::Function *toPrint32Int = module.getFunction("print32Int"); in createThrowExceptionFunction()
1499 llvm::SwitchInst *theSwitch = builder.CreateSwitch(exceptionType, in createThrowExceptionFunction()
1503 theSwitch->addCase(llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), in createThrowExceptionFunction()
1511 llvm::Function *createOurException = module.getFunction("createOurException"); in createThrowExceptionFunction()
1512 llvm::Function *raiseOurException = module.getFunction( in createThrowExceptionFunction()
1516 llvm::Value *exception = builder.CreateCall(createOurException, in createThrowExceptionFunction()
1523 llvm::verifyFunction(*ret); in createThrowExceptionFunction()
1530 llvm::Module &module,
1531 llvm::IRBuilder<> &builder);
1553 llvm::Function *createUnwindExceptionTest(llvm::Module &module, in createUnwindExceptionTest()
1554 llvm::IRBuilder<> &builder, in createUnwindExceptionTest()
1555 llvm::FunctionPassManager &fpm, in createUnwindExceptionTest()
1565 llvm::Function *nativeThrowFunct = module.getFunction(nativeThrowFunctName); in createUnwindExceptionTest()
1569 llvm::Function *throwFunct = createThrowExceptionFunction(module, in createUnwindExceptionTest()
1581 llvm::Function *innerCatchFunct = createCatchWrappedInvokeFunction(module, in createUnwindExceptionTest()
1595 llvm::Function *outerCatchFunct = createCatchWrappedInvokeFunction(module, in createUnwindExceptionTest()
1646 void runExceptionThrow(llvm::ExecutionEngine *engine, in runExceptionThrow()
1647 llvm::Function *function, in runExceptionThrow()
1682 typedef llvm::ArrayRef<llvm::Type*> TypeArray;
1691 llvm::Module &module, in createStandardUtilityFunctions()
1692 llvm::IRBuilder<> &builder) { in createStandardUtilityFunctions()
1694 llvm::LLVMContext &context = module.getContext(); in createStandardUtilityFunctions()
1700 llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), 0), in createStandardUtilityFunctions()
1702 llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), 1), in createStandardUtilityFunctions()
1704 llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), 2), in createStandardUtilityFunctions()
1709 ourTypeInfoType = llvm::StructType::get(context, in createStandardUtilityFunctions()
1714 llvm::Type *caughtResultFieldTypes[] = { in createStandardUtilityFunctions()
1720 ourCaughtResultType = llvm::StructType::get(context, in createStandardUtilityFunctions()
1726 ourExceptionType = llvm::StructType::get(context, in createStandardUtilityFunctions()
1734 llvm::StructType::get(context, in createStandardUtilityFunctions()
1762 std::vector<llvm::Constant*> structVals; in createStandardUtilityFunctions()
1764 llvm::Constant *nextStruct; in createStandardUtilityFunctions()
1765 llvm::GlobalVariable *nextGlobal = NULL; in createStandardUtilityFunctions()
1772 structVals.push_back(llvm::ConstantInt::get(builder.getInt32Ty(), i)); in createStandardUtilityFunctions()
1773 nextStruct = llvm::ConstantStruct::get(ourTypeInfoType, structVals); in createStandardUtilityFunctions()
1781 new llvm::GlobalVariable(module, in createStandardUtilityFunctions()
1784 llvm::GlobalValue::ExternalLinkage, in createStandardUtilityFunctions()
1794 llvm::Function *funct = NULL; in createStandardUtilityFunctions()
1798 llvm::Type *retType = builder.getVoidTy(); in createStandardUtilityFunctions()
1811 llvm::Function::ExternalLinkage, in createStandardUtilityFunctions()
1830 llvm::Function::ExternalLinkage, in createStandardUtilityFunctions()
1848 llvm::Function::ExternalLinkage, in createStandardUtilityFunctions()
1866 llvm::Function::ExternalLinkage, in createStandardUtilityFunctions()
1884 llvm::Function::ExternalLinkage, in createStandardUtilityFunctions()
1902 llvm::Function::ExternalLinkage, in createStandardUtilityFunctions()
1920 llvm::Function::ExternalLinkage, in createStandardUtilityFunctions()
1924 funct->addFnAttr(llvm::Attribute::NoReturn); in createStandardUtilityFunctions()
1940 llvm::Function::ExternalLinkage, in createStandardUtilityFunctions()
1944 funct->addFnAttr(llvm::Attribute::NoReturn); in createStandardUtilityFunctions()
1964 llvm::Function::ExternalLinkage, in createStandardUtilityFunctions()
1970 getDeclaration(&module, llvm::Intrinsic::eh_selector); in createStandardUtilityFunctions()
1974 getDeclaration(&module, llvm::Intrinsic::eh_exception); in createStandardUtilityFunctions()
1978 getDeclaration(&module, llvm::Intrinsic::eh_typeid_for); in createStandardUtilityFunctions()
2008 llvm::JITExceptionHandling = true; in main()
2010 llvm::InitializeNativeTarget(); in main()
2011 llvm::LLVMContext &context = llvm::getGlobalContext(); in main()
2012 llvm::IRBuilder<> theBuilder(context); in main()
2015 llvm::Module *module = new llvm::Module("my cool jit", context); in main()
2018 llvm::EngineBuilder factory(module); in main()
2019 factory.setEngineKind(llvm::EngineKind::JIT); in main()
2021 llvm::ExecutionEngine *executionEngine = factory.create(); in main()
2024 llvm::FunctionPassManager fpm(module); in main()
2029 fpm.add(new llvm::TargetData(*executionEngine->getTargetData())); in main()
2035 fpm.add(llvm::createBasicAliasAnalysisPass()); in main()
2038 fpm.add(llvm::createPromoteMemoryToRegisterPass()); in main()
2041 fpm.add(llvm::createInstructionCombiningPass()); in main()
2044 fpm.add(llvm::createReassociatePass()); in main()
2047 fpm.add(llvm::createGVNPass()); in main()
2051 fpm.add(llvm::createCFGSimplificationPass()); in main()
2058 llvm::Function *toRun = in main()