1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-23 18:18:00 +02:00

Arithmetic overflow checks

This commit is contained in:
Brian Fiete 2022-01-11 08:17:09 -05:00
parent 1f0d2dcc82
commit eb375362a1
29 changed files with 503 additions and 87 deletions

View file

@ -20,7 +20,7 @@ namespace llvm
class AttributeList;
class Module;
class LLVMContext;
class TargetMachine;
class TargetMachine;
};
NS_BF_BEGIN
@ -100,7 +100,8 @@ public:
llvm::TargetMachine* mLLVMTargetMachine;
Array<llvm::DebugLoc> mSavedDebugLocs;
llvm::InlineAsm* mNopInlineAsm;
llvm::InlineAsm* mAsmObjectCheckAsm;
llvm::InlineAsm* mObjectCheckAsm;
llvm::InlineAsm* mOverflowCheckAsm;
llvm::DebugLoc mDebugLoc;
BfCodeGenOptions mCodeGenOptions;
bool mHasDebugLoc;
@ -140,6 +141,7 @@ public:
llvm::Type* GetSizeAlignedType(BfIRTypeEntry* typeEntry);
llvm::Value* GetAlignedPtr(llvm::Value* val);
llvm::Value* FixGEP(llvm::Value* fromValue, llvm::Value* result);
llvm::Value* DoCheckedIntrinsic(llvm::Intrinsic::ID intrin, llvm::Value* lhs, llvm::Value* rhs, bool useAsm);
public:
BfIRCodeGen();
@ -158,6 +160,7 @@ public:
void Read(int64& i);
void Read(Val128& i);
void Read(bool& val);
void Read(int8& val);
void Read(BfIRTypeEntry*& type);
void Read(llvm::Type*& llvmType, BfIRTypeEntry** outTypeEntry = NULL);
void Read(llvm::FunctionType*& llvmType);