1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Trimmed trailing whitespace

This commit is contained in:
Brian Fiete 2022-07-27 12:26:36 -04:00
parent 4f2fd58284
commit 602c7f318f
13 changed files with 1049 additions and 1113 deletions

File diff suppressed because it is too large Load diff

View file

@ -26,7 +26,7 @@ public:
bool mIsStatic;
bool mIsTLS;
BeMCSymbolKind mSymKind;
int mValue;
int mValue;
int mIdx;
int mSectionNum;
@ -169,7 +169,7 @@ public:
return false;
for (int i = 0; i < (int)lhs->mType->mParams.size(); i++)
if (lhs->mType->mParams[i] != rhs->mType->mParams[i])
return false;
return false;
return true;
}
};
@ -215,16 +215,16 @@ public:
PerfManager* mPerfManager;
DataStream* mStream;
BumpAllocator mAlloc;
BeModule* mBeModule;
OwnedVector<BeMCSymbol> mSymbols;
BeModule* mBeModule;
OwnedVector<BeMCSymbol> mSymbols;
OwnedVector<BeCOFFSection> mDynSects;
uint32 mTimestamp;
BeCOFFSection mTextSect;
BeCOFFSection mDataSect;
BeCOFFSection mRDataSect;
BeCOFFSection mBSSSect;
BeCOFFSection mTLSSect;
BeCOFFSection mRDataSect;
BeCOFFSection mBSSSect;
BeCOFFSection mTLSSect;
BeCOFFSection mPDataSect;
BeCOFFSection mXDataSect;
BeCOFFSection mDebugSSect;
@ -234,8 +234,8 @@ public:
int mBSSPos;
Array<BeCOFFSection*> mUsedSections;
Dictionary<BeValue*, BeMCSymbol*> mSymbolMap;
Dictionary<String, BeMCSymbol*> mNamedSymbolMap;
HashSet<COFFArgListRef> mArgListSet;
Dictionary<String, BeMCSymbol*> mNamedSymbolMap;
HashSet<COFFArgListRef> mArgListSet;
HashSet<COFFFuncTypeRef> mFuncTypeSet;
Deque<BeFunction*> mFuncWorkList;
int mTTagStartPos;
@ -244,10 +244,10 @@ public:
int mSectionStartPos;
int mCurStringId;
int mCurJumpTableIdx;
bool mTypesLocked;
bool mTypesLocked;
String mDirectives;
public:
public:
void ToString(BeMDNode* mdNode, String& str);
int GetCVRegNum(X64CPURegister reg, int bits);
@ -255,10 +255,10 @@ public:
void DbgTStartTag();
void DbgTEndTag();
void DbgEncodeConstant(DynMemStream& memStream, int64 val);
void DbgEncodeString(DynMemStream& memStream, const StringImpl& str);
void DbgEncodeString(DynMemStream& memStream, const StringImpl& str);
void DbgMakeFuncType(BeDbgFunction* dbgFunc);
void DbgMakeFunc(BeDbgFunction* dbgFunc);
int DbgGetTypeId(BeDbgType* dbgType, bool doDefine = false);
int DbgGetTypeId(BeDbgType* dbgType, bool doDefine = false);
void DbgGenerateTypeInfo();
void DbgSAlign();
@ -270,18 +270,18 @@ public:
void DbgEndSection();
void DbgStartVarDefRange(BeDbgFunction* dbgFunc, BeDbgVariable* dbgVar, const BeDbgVariableLoc& varLoc, int offset, int range);
void DbgEndLineBlock(BeDbgFunction* dbgFunc, const Array<BeDbgCodeEmission>& emissions, int blockStartPos, int emissionStartIdx, int lineCount);
void DbgGenerateModuleInfo();
void DbgGenerateModuleInfo();
void InitSect(BeCOFFSection& sect, const StringImpl& name, int characteristics, bool addNow, bool makeSectSymbol);
void AlignConst(BeCOFFSection& sect, BeConstant* constVal);
void WriteConst(BeCOFFSection& sect, BeConstant* constVal);
void Generate(BeModule* module);
public:
BeCOFFObject();
BeCOFFObject();
void Finish();
bool Generate(BeModule* module, const StringImpl& fileName);
bool Generate(BeModule* module, const StringImpl& fileName);
BeMCSymbol* GetSymbol(BeValue* value, bool allowCreate = true);
BeMCSymbol* GetSymbolRef(const StringImpl& name);
void MarkSectionUsed(BeCOFFSection& sect, bool getSectSymbol = false);

View file

@ -28,7 +28,7 @@ BeType* BeContext::GetPrimitiveType(BeTypeCode typeCode)
primType->mTypeCode = typeCode;
switch (typeCode)
{
case BeTypeCode_None:
case BeTypeCode_None:
primType->mSize = 0;
primType->mAlign = 0;
break;
@ -80,24 +80,24 @@ BeStructType* BeContext::CreateStruct(const StringImpl& name)
BeStructType* structType = mTypes.Alloc<BeStructType>();
structType->mContext = this;
structType->mTypeCode = BeTypeCode_Struct;
structType->mName = name;
structType->mName = name;
structType->mIsOpaque = true;
return structType;
}
BeStructType* BeContext::CreateStruct(const SizedArrayImpl<BeType*>& types)
{
BeStructType** valuePtr = NULL;
if (mAnonymousStructMap.TryGetValueWith(types, &valuePtr))
return *valuePtr;
{
BeStructType** valuePtr = NULL;
if (mAnonymousStructMap.TryGetValueWith(types, &valuePtr))
return *valuePtr;
Array<BeType*> key;
for (auto type : types)
key.Add(type);
BeStructType* structType = CreateStruct("");
SetStructBody(structType, types, false);
mAnonymousStructMap.TryAdd(key, structType);
mAnonymousStructMap.TryAdd(key, structType);
return structType;
}
@ -109,7 +109,7 @@ BePointerType* BeContext::GetPointerTo(BeType* beType)
pointerType->mTypeCode = BeTypeCode_Pointer;
pointerType->mElementType = beType;
pointerType->mSize = mPointerSize;
pointerType->mAlign = mPointerSize;
pointerType->mAlign = mPointerSize;
beType->mPointerType = pointerType;
/*if (beType->IsSizedArray())
@ -197,12 +197,12 @@ bool BeContext::AreTypesEqual(BeType* lhs, BeType* rhs)
{
if (lhs == rhs)
return true;
if (lhs->mTypeCode != rhs->mTypeCode)
return false;
switch (lhs->mTypeCode)
{
{
case BeTypeCode_None:
case BeTypeCode_NullPtr:
case BeTypeCode_Boolean:
@ -214,7 +214,7 @@ bool BeContext::AreTypesEqual(BeType* lhs, BeType* rhs)
case BeTypeCode_Double:
return true;
case BeTypeCode_Pointer:
return AreTypesEqual(((BePointerType*)lhs)->mElementType, ((BePointerType*)rhs)->mElementType);
return AreTypesEqual(((BePointerType*)lhs)->mElementType, ((BePointerType*)rhs)->mElementType);
case BeTypeCode_SizedArray:
{
auto lhsSizedArray = (BeSizedArrayType*)lhs;
@ -222,7 +222,7 @@ bool BeContext::AreTypesEqual(BeType* lhs, BeType* rhs)
if (lhsSizedArray->mLength != rhsSizedArray->mLength)
return false;
return AreTypesEqual(lhsSizedArray->mElementType, rhsSizedArray->mElementType);
}
}
case BeTypeCode_Vector:
{
auto lhsSizedArray = (BeVectorType*)lhs;
@ -233,5 +233,4 @@ bool BeContext::AreTypesEqual(BeType* lhs, BeType* rhs)
}
}
return false;
}
}

View file

@ -88,7 +88,6 @@ public:
virtual ~BeType()
{
}
int GetStride()
@ -120,7 +119,6 @@ public:
{
return (mTypeCode == BeTypeCode_Float) || (mTypeCode == BeTypeCode_Double);
}
bool IsStruct()
{
@ -159,10 +157,10 @@ public:
}
virtual void HashContent(BeHashContext& hashCtx)
{
{
BF_ASSERT(mTypeCode < BeTypeCode_Struct);
hashCtx.Mixin(mTypeCode);
}
}
};
class BeStructMember
@ -174,21 +172,21 @@ public:
class BeStructType : public BeType
{
public:
public:
BeContext* mContext;
String mName;
Array<BeStructMember> mMembers;
Array<BeStructMember> mMembers;
bool mIsPacked;
bool mIsOpaque;
virtual void HashContent(BeHashContext& hashCtx) override
{
{
hashCtx.MixinStr(mName);
hashCtx.Mixin(mMembers.size());
for (auto& member : mMembers)
{
member.mType->HashReference(hashCtx);
hashCtx.Mixin(member.mByteOffset);
hashCtx.Mixin(member.mByteOffset);
}
hashCtx.Mixin(mIsPacked);
hashCtx.Mixin(mIsOpaque);
@ -213,9 +211,9 @@ public:
BeContext* mContext;
BeType* mElementType;
int mLength;
virtual void HashContent(BeHashContext& hashCtx) override
{
{
hashCtx.Mixin(BeTypeCode_SizedArray);
hashCtx.Mixin(mLength);
mElementType->HashReference(hashCtx);
@ -247,27 +245,27 @@ class BeFunctionType : public BeType
{
public:
String mName;
BeType* mReturnType;
BeType* mReturnType;
Array<BeFunctionTypeParam> mParams;
bool mIsVarArg;
virtual void HashContent(BeHashContext& hashCtx) override
{
hashCtx.Mixin(BeTypeCode_Function);
hashCtx.MixinStr(mName);
mReturnType->HashReference(hashCtx);
mReturnType->HashReference(hashCtx);
hashCtx.Mixin(mParams.size());
for (auto& param : mParams)
{
param.mType->HashReference(hashCtx);
}
hashCtx.Mixin(mIsVarArg);
hashCtx.Mixin(mIsVarArg);
}
};
class BeContext
{
public:
public:
int mPointerSize;
//BumpAllocator mAlloc;
BeType* mPrimitiveTypes[BeTypeCode_COUNT];
@ -278,8 +276,8 @@ public:
void NotImpl();
public:
BeContext();
BeType* GetPrimitiveType(BeTypeCode typeCode);
BeContext();
BeType* GetPrimitiveType(BeTypeCode typeCode);
BeType* GetVoidPtrType();
BeStructType* CreateStruct(const StringImpl& name);
BeStructType* CreateStruct(const SizedArrayImpl<BeType*>& types);

View file

@ -8,4 +8,3 @@
NS_BF_BEGIN
NS_BF_END

File diff suppressed because it is too large Load diff

View file

@ -75,40 +75,40 @@ class BeIRCodeGen : public BfIRCodeGenBase
{
public:
bool mDebugging;
BfIRBuilder* mBfIRBuilder;
BfIRBuilder* mBfIRBuilder;
BeFunction* mActiveFunction;
BeContext* mBeContext;
BeModule* mBeModule;
Array<BeDbgLoc*> mSavedDebugLocs;
bool mHasDebugLoc;
BeModule* mBeModule;
Array<BeDbgLoc*> mSavedDebugLocs;
bool mHasDebugLoc;
int mCmdCount;
Dictionary<int, BeIRCodeGenEntry> mResults;
Dictionary<int, BeIRTypeEntry> mTypes;
Dictionary<int, BeIRTypeEntry> mTypes;
Dictionary<BeType*, BeDbgType*> mOnDemandTypeMap;
Dictionary<BeType*, BeValue*> mReflectDataMap;
Array<int> mConfigConsts;
Array<int> mConfigConsts;
public:
public:
void FatalError(const StringImpl& str);
void NotImpl();
BfTypeCode GetTypeCode(BeType* type, bool isSigned);
void SetResult(int id, BeValue* value);
void SetResult(int id, BeType* type);
void SetResult(int id, BeBlock* value);
void SetResult(int id, BeMDNode* md);
void SetResult(int id, BeMDNode* md);
BeType* GetBeType(BfTypeCode typeCode, bool& isSigned);
BeIRTypeEntry& GetTypeEntry(int typeId);
BeIRTypeEntry& GetTypeEntry(int typeId);
void FixValues(BeStructType* structType, CmdParamVec<BeValue*>& values);
public:
BeIRCodeGen();
~BeIRCodeGen();
~BeIRCodeGen();
void Hash(BeHashContext& hashCtx);
bool IsModuleEmpty();
@ -127,12 +127,12 @@ public:
void Read(BeConstant*& beConstant);
void Read(BeFunction*& beFunc);
void Read(BeBlock*& beBlock);
void Read(BeMDNode*& beMD);
void Read(BeMDNode*& beMD);
template <typename T>
void Read(SizedArrayImpl<T>& vec)
{
int len = (int)ReadSLEB128();
int len = (int)ReadSLEB128();
for (int i = 0; i < len; i++)
{
T result;
@ -140,11 +140,11 @@ public:
vec.push_back(result);
}
}
void Init(const BfSizedArray<uint8>& buffer);
void Process();
virtual void ProcessBfIRData(const BfSizedArray<uint8>& buffer) override;
virtual void ProcessBfIRData(const BfSizedArray<uint8>& buffer) override;
virtual void HandleNextCmd() override;
virtual void SetConfigConst(int idx, int value) override;

View file

@ -1,4 +1,3 @@
#pragma warning(disable:4996)
#include "BeLibManger.h"
#include "BeefySysLib/util/BeefPerf.h"
@ -37,7 +36,7 @@ bool BeLibFile::ReadLib()
mOldFileStream.Read(fileId, 8);
if (strncmp(fileId, "!<arch>\n", 8) != 0)
return false;
const char* libStrTable = NULL;
Dictionary<int, BeLibEntry*> pendingLibEntryMap;
@ -62,18 +61,18 @@ bool BeLibFile::ReadLib()
mOldFileStream.Read(data, len);
int numSymbols = FromBigEndian(*(int32*)data);
uint8* strTab = data + 4 + numSymbols * 4;
for (int symIdx = 0; symIdx < numSymbols; symIdx++)
{
{
const char* str = (char*)strTab;
strTab += strlen((char*)strTab) + 1;
int offset = FromBigEndian(((int32*)(data + 4))[symIdx]);
BeLibEntry* pendingEntry;
BeLibEntry* pendingEntry;
BeLibEntry** pendingEntryPtr = NULL;
if (!pendingLibEntryMap.TryAdd(offset, NULL, &pendingEntryPtr))
{
@ -93,7 +92,6 @@ bool BeLibFile::ReadLib()
}
else
{
}
}
else if (strncmp(header.mName, "// ", 3) == 0)
@ -115,7 +113,7 @@ bool BeLibFile::ReadLib()
fileName.Append(&libStrTable[tabIdx], checkIdx - tabIdx);
break;
}
}
}
}
else
{
@ -125,9 +123,9 @@ bool BeLibFile::ReadLib()
fileName.Append(&header.mName[0], i);
}
}
BeLibEntry* libEntry = NULL;
if (!pendingLibEntryMap.TryGetValue(headerFilePos, &libEntry))
{
libEntry = new BeLibEntry();
@ -171,11 +169,11 @@ bool BeLibFile::ReadLib()
}
bool BeLibFile::Init(const StringImpl& filePath, bool moveFile)
{
bool isInitialized = false;
{
bool isInitialized = false;
if (FileExists(filePath))
{
{
String altName;
if (moveFile)
{
@ -196,14 +194,14 @@ bool BeLibFile::Init(const StringImpl& filePath, bool moveFile)
if (!mOldFileStream.Open(altName, "rb"))
return false;
if (!ReadLib())
return false;
}
String newLibName = filePath;
}
String newLibName = filePath;
mFilePath = newLibName;
return true;
}
@ -212,9 +210,9 @@ bool BeLibFile::Finish()
BP_ZONE("BeLibFile::Finish");
//mOldEntries.clear();
Dictionary<String, BeLibEntry*>* libEntryMaps[2] = { &mEntries, &mOldEntries };
Dictionary<String, BeLibEntry*>* libEntryMaps[2] = { &mEntries, &mOldEntries };
Array<BeLibEntry*> libEntries;
bool isAllReferenced = true;
@ -241,7 +239,7 @@ bool BeLibFile::Finish()
}
if (!mFileStream.Open(mFilePath, "wb"))
{
{
mFailed = true;
return false;
}
@ -255,7 +253,7 @@ bool BeLibFile::Finish()
mFileStream.Write("!<arch>\n", 8);
std::sort(libEntries.begin(), libEntries.end(),
std::sort(libEntries.begin(), libEntries.end(),
[&](BeLibEntry* lhs, BeLibEntry* rhs)
{
return lhs->mName < rhs->mName;
@ -263,12 +261,12 @@ bool BeLibFile::Finish()
int longNamesSize = 0;
int tabSize = 4; // num symbols
int tabSize = 4; // num symbols
int numSymbols = 0;
for (auto libEntry : libEntries)
{
if (libEntry->mName.length() > 15)
{
{
longNamesSize += (int)libEntry->mName.length() + 2;
}
@ -277,28 +275,27 @@ bool BeLibFile::Finish()
numSymbols++;
tabSize += 4; // Offset
tabSize += (int)sym.length() + 1; // String table
}
}
}
// Determine where all these entries will be placed
int predictPos = mFileStream.GetPos() + sizeof(BeLibMemberHeader) + BF_ALIGN(tabSize, 2);
if (longNamesSize > 0)
predictPos += sizeof(BeLibMemberHeader) + BF_ALIGN(longNamesSize, 2);
predictPos += sizeof(BeLibMemberHeader) + BF_ALIGN(longNamesSize, 2);
for (auto libEntry : libEntries)
{
libEntry->mNewDataPos = predictPos;
predictPos += sizeof(BeLibMemberHeader);
predictPos += BF_ALIGN(libEntry->mLength, 2);
predictPos += BF_ALIGN(libEntry->mLength, 2);
}
int tabStartPos = mFileStream.GetPos();
BeLibMemberHeader header;
header.Init("/", "0", tabSize);
header.Init("/", "0", tabSize);
mFileStream.WriteT(header);
mFileStream.Write(ToBigEndian((int32)numSymbols));
@ -308,7 +305,7 @@ bool BeLibFile::Finish()
for (auto& sym : libEntry->mSymbols)
{
mFileStream.Write((int32)ToBigEndian(libEntry->mNewDataPos));
}
}
}
// String map table
@ -317,11 +314,11 @@ bool BeLibFile::Finish()
for (auto& sym : libEntry->mSymbols)
{
mFileStream.Write((uint8*)sym.c_str(), (int)sym.length() + 1);
}
}
}
int actualTabSize = mFileStream.GetPos() - tabStartPos - sizeof(BeLibMemberHeader);
//return true;
if ((tabSize % 2) != 0)
@ -332,16 +329,16 @@ bool BeLibFile::Finish()
// Create long names table
if (longNamesSize > 0)
{
header.Init("//", "0", longNamesSize);
header.Init("//", "0", longNamesSize);
mFileStream.WriteT(header);
for (auto libEntry : libEntries)
{
if (libEntry->mName.length() > 15)
if (libEntry->mName.length() > 15)
{
mFileStream.Write((uint8*)libEntry->mName.c_str(), (int)libEntry->mName.length());
mFileStream.Write("/\n", 2);
}
}
}
if ((longNamesSize % 2) != 0)
@ -357,9 +354,9 @@ bool BeLibFile::Finish()
String entryName;
if (libEntry->mName.length() > 15)
{
char idxStr[32];
_itoa(longNamesPos, idxStr, 10);
{
char idxStr[32];
_itoa(longNamesPos, idxStr, 10);
entryName = "/";
entryName += idxStr;
longNamesPos += (int)libEntry->mName.length() + 2;
@ -370,7 +367,7 @@ bool BeLibFile::Finish()
entryName += "/";
}
header.Init(entryName.c_str(), "644", libEntry->mLength);
header.Init(entryName.c_str(), "644", libEntry->mLength);
mFileStream.WriteT(header);
if (libEntry->mOldDataPos != -1)
@ -383,11 +380,11 @@ bool BeLibFile::Finish()
}
else if (libEntry->mData.size() != 0)
{
mFileStream.Write((uint8*)&libEntry->mData[0], (int)libEntry->mData.size());
mFileStream.Write((uint8*)&libEntry->mData[0], (int)libEntry->mData.size());
}
if ((libEntry->mLength % 2) != 0)
mFileStream.Write((uint8)0);
mFileStream.Write((uint8)0);
}
mFileStream.Close();
@ -448,7 +445,7 @@ BeLibEntry* BeLibManager::AddFile(const StringImpl& filePath, void* data, int si
libFile = *libFilePtr;
}
else
{
{
libFile = new BeLibFile();
*libFilePtr = libFile;
@ -485,7 +482,7 @@ BeLibEntry* BeLibManager::AddFile(const StringImpl& filePath, void* data, int si
// It's possible that we rebuild a type (generic, probably), decide we don't have any refs so we delete the type,
// but then we specialize methods and then have to recreate it. Thus two entries here.
delete *libEntryPtr;
}
}
libEntry = new BeLibEntry();
libEntry->mLibFile = libFile;
*libEntryPtr = libEntry;
@ -494,7 +491,7 @@ BeLibEntry* BeLibManager::AddFile(const StringImpl& filePath, void* data, int si
libEntry->mName = fileName;
libEntry->mData.Insert(0, (uint8*)data, size);
libEntry->mLength = size;
return libEntry;
}
@ -533,5 +530,4 @@ String BeLibManager::GetLibFilePath(const StringImpl& objFilePath)
BeLibManager* BeLibManager::Get()
{
return &gBfLibManager;
}
}

View file

@ -39,7 +39,7 @@ struct BeLibMemberHeader
memcpy(mDate, "0", 1);
memcpy(mMode, mode, strlen(mode));
char sizeStr[32];
char sizeStr[32];
sprintf(sizeStr, "%d", size);
memcpy(mSize, sizeStr, strlen(sizeStr));
}
@ -60,7 +60,7 @@ public:
Array<uint8> mData;
BeLibEntry* mNextWithSameName;
public:
public:
BeLibEntry()
{
mReferenced = false;
@ -84,7 +84,7 @@ public:
String mFilePath;
String mOldFilePath;
FileStream mOldFileStream;
FileStream mFileStream;
FileStream mFileStream;
Dictionary<String, BeLibEntry*> mOldEntries;
Dictionary<String, BeLibEntry*> mEntries;
bool mFailed;
@ -107,7 +107,7 @@ public:
Dictionary<String, BeLibFile*> mLibFiles;
Array<String> mErrors;
public:
public:
BeLibManager();
~BeLibManager();
@ -118,8 +118,7 @@ public:
void Finish();
static String GetLibFilePath(const StringImpl& objFilePath);
static BeLibManager* Get();
static BeLibManager* Get();
};
NS_BF_END

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,6 @@ NS_BF_BEGIN
class BeMCAddInst
{
public:
};
struct BeVTrackingBits
@ -109,9 +108,7 @@ public:
DiffIterator& operator++()
{
}
};*/
Iterator begin()
@ -198,7 +195,7 @@ enum BeMCOperandKind
BeMCOperandKind_Immediate_f64,
BeMCOperandKind_Immediate_f32_Packed128,
BeMCOperandKind_Immediate_f64_Packed128,
BeMCOperandKind_Immediate_int32x4,
BeMCOperandKind_Immediate_int32x4,
BeMCOperandKind_ConstAgg,
BeMCOperandKind_Block,
BeMCOperandKind_Label,
@ -769,14 +766,14 @@ class BeMCVRegInfo
{
public:
X64CPURegister mReg;
X64CPURegister mNaturalReg; // From param
X64CPURegister mNaturalReg; // From param
BeType* mType;
int mAlign;
int mFrameOffset; // 0 = 'RBP' (probably first local var or saved RBP), 8 means retAddr
bool mRegNumPinned;
bool mHasDynLife;
bool mDoConservativeLife; // Keep alive through 'init' as well as 'uninit'
bool mIsExpr; // Not an actual value, something like 'mRelTo + mRelOffset'
bool mIsExpr; // Not an actual value, something like 'mRelTo + mRelOffset'
bool mWantsExprActualize;
bool mWantsExprOffsetActualize;
bool mChainLifetimeEnd; // Kill relTo's when we are killed
@ -794,7 +791,7 @@ public:
bool mDisableR13; // Special case when this vreg is used in an ModRM scale, which isn't allowed
bool mDisableRAX; // Special case when RAX must be preserved (ie: For IDIV)
bool mDisableRDX; // Special case when RDX must be preserved (ie: For IDIV)
bool mDisableEx; // Disable any registers that require a REX
bool mDisableEx; // Disable any registers that require a REX
int mVRegAffinity; // Try to match the mReg of this vreg
BeMCOperand mRelTo;
int mRelOffsetScale;
@ -804,7 +801,7 @@ public:
bool mFoundLastUse;
bool mMustExist; // Regs we must be able to debug
// Must be refreshed with RefreshRefCounts
// Must be refreshed with RefreshRefCounts
int mRefCount;
int mAssignCount;
@ -961,7 +958,6 @@ enum BeTrackKind
BeTrackKind_COUNT = 2
};
// BeVTrackingEntry is immutable -- the Set/Clear/Merge methods allocate new entries if
// the requested change produces a new liveness set
class BeVTrackingContext
@ -1476,7 +1472,7 @@ public:
void EmitStdInst(BeMCInstForm instForm, BeMCInst* inst, uint8 opcode_rm_r, uint8 opcode_r_rm, uint8 opcode_rm_imm, uint8 opcode_rm_imm_rx, uint8 opcode_rm_imm8, uint8 opcode_rm_imm8_rx);
bool EmitStdXMMInst(BeMCInstForm instForm, BeMCInst* inst, uint8 opcode);
bool EmitStdXMMInst(BeMCInstForm instForm, BeMCInst* inst, uint8 opcode, uint8 opcode_dest_frm);
bool EmitPackedXMMInst(BeMCInstForm instForm, BeMCInst* inst, uint8 opcode);
bool EmitPackedXMMInst(BeMCInstForm instForm, BeMCInst* inst, uint8 opcode);
bool EmitIntXMMInst(BeMCInstForm instForm, BeMCInst* inst, uint8 opcode);
bool EmitIntBitwiseXMMInst(BeMCInstForm instForm, BeMCInst* inst, uint8 opcode);
void EmitAggMov(const BeMCOperand& dest, const BeMCOperand& src);

File diff suppressed because it is too large Load diff

View file

@ -68,7 +68,7 @@ public:
virtual void Visit(BeValue* beValue) {}
virtual void Visit(BeBlock* beBlock) {}
virtual void Visit(BeArgument* beArgument) {}
virtual void Visit(BeArgument* beArgument) {}
virtual void Visit(BeInst* beInst) {}
virtual void Visit(BeNopInst* nopInst) {}
virtual void Visit(BeUnreachableInst* unreachableInst) {}
@ -76,10 +76,10 @@ public:
virtual void Visit(BeUndefValueInst* undefValue) {}
virtual void Visit(BeExtractValueInst* extractValue) {}
virtual void Visit(BeInsertValueInst* insertValue) {}
virtual void Visit(BeNumericCastInst* castInst) {}
virtual void Visit(BeBitCastInst* castInst) {}
virtual void Visit(BeNegInst* negInst) {}
virtual void Visit(BeNotInst* notInst) {}
virtual void Visit(BeNumericCastInst* castInst) {}
virtual void Visit(BeBitCastInst* castInst) {}
virtual void Visit(BeNegInst* negInst) {}
virtual void Visit(BeNotInst* notInst) {}
virtual void Visit(BeBinaryOpInst* binaryOpInst) {}
virtual void Visit(BeFenceInst* fenceInst) {}
virtual void Visit(BeStackSaveInst* stackSaveInst) {}
@ -108,8 +108,8 @@ public:
virtual void Visit(BeSwitchInst* switchInst) {}
virtual void Visit(BeRetInst* retInst) {}
virtual void Visit(BeCallInst* callInst) {}
//virtual void Visit(BeDbgVariable* dbgVariable) {}
//virtual void Visit(BeDbgVariable* dbgVariable) {}
virtual void Visit(BeDbgDeclareInst* dbgDeclareInst) {}
};
@ -122,15 +122,15 @@ class BeInliner : public BeValueVisitor
public:
BumpAllocator* mAlloc;
OwnedVector<BeValue>* mOwnedValueVec;
Dictionary<BeValue*, BeValue*> mValueMap;
Dictionary<BeValue*, BeValue*> mValueMap;
Dictionary<BeDbgLoc*, BeDbgLoc*> mInlinedAtMap;
BeModule* mModule;
BeFunction* mSrcFunc;
BeFunction* mDestFunc;
BeCallInst* mCallInst;
BeBlock* mDestBlock;
BeDbgLoc* mSrcDbgLoc;
BeCallInst* mCallInst;
BeBlock* mDestBlock;
BeDbgLoc* mSrcDbgLoc;
BeDbgLoc* mDestDbgLoc;
public:
@ -158,7 +158,7 @@ public:
auto inst = mOwnedValueVec->Alloc<T>();
AddInst(inst, srcInst);
return inst;
}
}
virtual void Visit(BeValue* beValue) override;
virtual void Visit(BeBlock* beBlock) override;
@ -202,7 +202,7 @@ public:
virtual void Visit(BeSwitchInst* switchInst) override;
virtual void Visit(BeRetInst* retInst) override;
virtual void Visit(BeCallInst* callInst) override;
virtual void Visit(BeDbgDeclareInst* dbgDeclareInst) override;
};
@ -212,7 +212,7 @@ public:
int mRefCount;
#ifdef _DEBUG
bool mLifetimeEnded;
bool mWasRemoved;
bool mWasRemoved;
BeValue()
{
mLifetimeEnded = false;
@ -228,12 +228,11 @@ public:
virtual ~BeValue()
{
}
static const int TypeId = 0;
virtual void Accept(BeValueVisitor* beVisitor) = 0;
virtual bool TypeIdIsA(int typeId) = 0;
virtual bool TypeIdIsA(int typeId) = 0;
virtual BeValue* DynCast(int typeId)
{
if (TypeIdIsA(typeId))
@ -246,7 +245,6 @@ public:
}
virtual int GetTypeId() { return TypeId; }
public:
virtual BeType* GetType()
{
@ -255,7 +253,6 @@ public:
virtual void SetName(const StringImpl& name)
{
}
};
@ -310,8 +307,8 @@ class BeConstant : public BeValue
{
public:
BE_VALUE_TYPE(BeConstant, BeValue);
BeType* mType;
BeType* mType;
union
{
bool mBool;
@ -325,7 +322,7 @@ public:
uint8 mUInt8;
uint8 mChar;
uint32 mChar32;
double mDouble;
double mDouble;
//BeType* mTypeParam;
//BeGlobalVariable* mGlobalVar;
BeConstant* mTarget;
@ -338,7 +335,7 @@ public:
return false;
}
virtual BeType* GetType();
virtual BeType* GetType();
virtual void GetData(BeConstData& data);
virtual void HashContent(BeHashContext& hashCtx) override;
};
@ -365,7 +362,7 @@ class BeGEP1Constant : public BeConstant
{
public:
BE_VALUE_TYPE(BeGEP1Constant, BeConstant);
int mIdx0;
int mIdx0;
virtual BeType* GetType();
@ -373,14 +370,14 @@ public:
{
hashCtx.Mixin(TypeId);
mTarget->HashReference(hashCtx);
hashCtx.Mixin(mIdx0);
hashCtx.Mixin(mIdx0);
}
};
class BeGEP2Constant : public BeConstant
{
public:
BE_VALUE_TYPE(BeGEP2Constant, BeConstant);
BE_VALUE_TYPE(BeGEP2Constant, BeConstant);
int mIdx0;
int mIdx1;
@ -388,7 +385,7 @@ public:
virtual void HashContent(BeHashContext& hashCtx) override
{
hashCtx.Mixin(TypeId);
hashCtx.Mixin(TypeId);
mTarget->HashReference(hashCtx);
hashCtx.Mixin(mIdx0);
hashCtx.Mixin(mIdx1);
@ -399,7 +396,7 @@ class BeExtractValueConstant : public BeConstant
{
public:
BE_VALUE_TYPE(BeExtractValueConstant, BeConstant);
int mIdx0;
int mIdx0;
virtual BeType* GetType();
@ -407,14 +404,14 @@ public:
{
hashCtx.Mixin(TypeId);
mTarget->HashReference(hashCtx);
hashCtx.Mixin(mIdx0);
hashCtx.Mixin(mIdx0);
}
};
class BeStructConstant : public BeConstant
{
public:
BE_VALUE_TYPE(BeStructConstant, BeConstant);
BE_VALUE_TYPE(BeStructConstant, BeConstant);
SizedArray<BeConstant*, 4> mMemberValues;
@ -434,25 +431,25 @@ class BeUndefConstant : public BeConstant
{
public:
BE_VALUE_TYPE(BeUndefConstant, BeConstant);
virtual void HashContent(BeHashContext& hashCtx) override
{
hashCtx.Mixin(mType);
hashCtx.Mixin(TypeId);
hashCtx.Mixin(TypeId);
}
};
class BeStringConstant : public BeConstant
{
public:
BE_VALUE_TYPE(BeStringConstant, BeConstant);
BE_VALUE_TYPE(BeStringConstant, BeConstant);
String mString;
virtual void HashContent(BeHashContext& hashCtx) override
{
hashCtx.Mixin(TypeId);
hashCtx.MixinStr(mString);
hashCtx.MixinStr(mString);
}
};
@ -471,8 +468,8 @@ public:
int mAlign;
bool mUnnamedAddr;
virtual BeType* GetType();
virtual BeType* GetType();
virtual void HashContent(BeHashContext& hashCtx) override
{
hashCtx.Mixin(TypeId);
@ -485,12 +482,12 @@ public:
hashCtx.Mixin(mIsTLS);
hashCtx.Mixin(mAlign);
hashCtx.Mixin(mUnnamedAddr);
}
}
virtual void GetData(BeConstData& data) override
{
data.mConsts.Add({ (int)data.mData.size(), this });
data.mData.Insert(data.mData.size(), (uint8)0, 8);
data.mData.Insert(data.mData.size(), (uint8)0, 8);
}
};
@ -522,13 +519,13 @@ class BeIntrinsic : public BeValue
{
public:
BE_VALUE_TYPE(BeIntrinsic, BeValue);
String mName;
BfIRIntrinsic mKind;
BeType* mReturnType;
BeIntrinsic()
{
{
mReturnType = NULL;
}
@ -536,7 +533,7 @@ public:
{
hashCtx.Mixin(TypeId);
hashCtx.Mixin(mKind);
}
}
};
class BeFunction : public BeConstant
@ -544,15 +541,15 @@ class BeFunction : public BeConstant
public:
BE_VALUE_TYPE(BeFunction, BeConstant);
BeModule* mModule;
BeModule* mModule;
#ifdef _DEBUG
StringT<256> mName;
#else
String mName;
#endif
BfIRLinkageType mLinkageType;
BfIRLinkageType mLinkageType;
bool mIsVarReturn;
bool mAlwaysInline;
bool mAlwaysInline;
bool mNoUnwind;
bool mUWTable;
bool mNoReturn;
@ -561,10 +558,10 @@ public:
bool mIsDLLExport;
bool mIsDLLImport;
BfIRCallingConv mCallingConv;
Array<BeBlock*> mBlocks;
Array<BeBlock*> mBlocks;
Array<BeFunctionParam> mParams;
BeDbgFunction* mDbgFunction;
BeGlobalVariable* mRemapBindVar;
BeGlobalVariable* mRemapBindVar;
public:
BeFunction()
@ -575,15 +572,15 @@ public:
mDbgFunction = NULL;
mIsVarReturn = false;
mAlwaysInline = false;
mDidInlinePass = false;
mDidInlinePass = false;
mNoUnwind = false;
mUWTable = false;
mNoReturn = false;
mNoFramePointerElim = false;
mIsDLLExport = false;
mIsDLLImport = false;
mRemapBindVar = NULL;
}
mRemapBindVar = NULL;
}
BeFunctionType* GetFuncType()
{
@ -600,7 +597,7 @@ public:
{
return (!mParams.IsEmpty()) && (mParams[0].mStructRet);
}
virtual void HashContent(BeHashContext& hashCtx) override;
};
@ -614,12 +611,11 @@ public:
BeFunction* mFunction;
public:
bool IsEmpty();
bool IsEmpty();
virtual void HashContent(BeHashContext& hashCtx) override;
};
//////////////////////////////////////////////////////////////////////////
class BeInst : public BeValue
@ -630,8 +626,8 @@ public:
BeBlock* mParentBlock;
const char* mName;
BeDbgLoc* mDbgLoc;
public:
public:
BeContext* GetContext();
BeModule* GetModule();
@ -640,7 +636,7 @@ public:
return GetType() != NULL;
}
virtual void SetName(const StringImpl& name) override;
virtual void SetName(const StringImpl& name) override;
BeInst()
{
@ -650,7 +646,7 @@ public:
}
virtual void HashInst(BeHashContext& hashCtx) = 0;
virtual void HashContent(BeHashContext& hashCtx) override;
virtual void HashContent(BeHashContext& hashCtx) override;
};
class BeNopInst : public BeInst
@ -707,7 +703,7 @@ class BeExtractValueInst : public BeInst
public:
BE_VALUE_TYPE(BeExtractValueInst, BeInst);
BeValue* mAggVal;
BeValue* mAggVal;
int mIdx;
virtual BeType* GetType() override;
@ -769,7 +765,7 @@ public:
BeValue* mValue;
BeType* mToType;
virtual BeType* GetType() override;
virtual void HashInst(BeHashContext& hashCtx) override
@ -777,7 +773,7 @@ public:
hashCtx.Mixin(TypeId);
mValue->HashReference(hashCtx);
mToType->HashReference(hashCtx);
}
}
};
class BeNegInst : public BeInst
@ -785,7 +781,7 @@ class BeNegInst : public BeInst
public:
BE_VALUE_TYPE(BeNegInst, BeInst);
BeValue* mValue;
BeValue* mValue;
virtual BeType* GetType() override;
virtual void HashInst(BeHashContext& hashCtx) override
@ -823,15 +819,15 @@ enum BeBinaryOpKind
BeBinaryOpKind_BitwiseAnd,
BeBinaryOpKind_BitwiseOr,
BeBinaryOpKind_ExclusiveOr,
BeBinaryOpKind_LeftShift,
BeBinaryOpKind_RightShift,
BeBinaryOpKind_LeftShift,
BeBinaryOpKind_RightShift,
BeBinaryOpKind_ARightShift,
BeBinaryOpKind_Equality,
BeBinaryOpKind_InEquality,
BeBinaryOpKind_GreaterThan,
BeBinaryOpKind_LessThan,
BeBinaryOpKind_GreaterThanOrEqual,
BeBinaryOpKind_LessThanOrEqual,
BeBinaryOpKind_LessThanOrEqual,
};
class BeBinaryOpInst : public BeInst
@ -844,7 +840,7 @@ public:
BeValue* mLHS;
BeValue* mRHS;
virtual BeType* GetType() override;
virtual BeType* GetType() override;
virtual void HashInst(BeHashContext& hashCtx) override
{
@ -920,7 +916,7 @@ public:
bool mForceMem;
public:
virtual BeType* GetType() override;
virtual BeType* GetType() override;
virtual void HashInst(BeHashContext& hashCtx) override
{
@ -1034,7 +1030,7 @@ public:
virtual void HashInst(BeHashContext& hashCtx) override
{
hashCtx.Mixin(TypeId);
hashCtx.Mixin(TypeId);
}
};
@ -1043,7 +1039,7 @@ class BeValueScopeRetainInst : public BeInst
public:
BE_VALUE_TYPE(BeValueScopeRetainInst, BeInst);
BeValue* mValue;
BeValue* mValue;
virtual void HashInst(BeHashContext& hashCtx) override
{
@ -1054,7 +1050,7 @@ public:
class BeValueScopeEndInst : public BeInst
{
public:
public:
BE_VALUE_TYPE(BeValueScopeEndInst, BeInst);
BeValueScopeStartInst* mScopeStart;
@ -1077,7 +1073,7 @@ public:
bool mIsVolatile;
public:
virtual BeType* GetType() override;
virtual BeType* GetType() override;
virtual void HashInst(BeHashContext& hashCtx) override
{
@ -1144,7 +1140,7 @@ public:
virtual void HashInst(BeHashContext& hashCtx) override
{
hashCtx.Mixin(TypeId);
hashCtx.Mixin(TypeId);
}
};
@ -1155,7 +1151,7 @@ public:
virtual void HashInst(BeHashContext& hashCtx) override
{
hashCtx.Mixin(TypeId);
hashCtx.Mixin(TypeId);
}
virtual BeType* GetType() override
@ -1278,7 +1274,7 @@ class BeSwitchCase
{
public:
BeConstant* mValue;
BeBlock* mBlock;
BeBlock* mBlock;
};
class BeSwitchInst : public BeInst
@ -1338,7 +1334,7 @@ public:
bool mStructRet;
bool mZExt;
bool mNoAlias;
bool mNoCapture;
bool mNoCapture;
Arg()
{
mValue = NULL;
@ -1352,14 +1348,14 @@ public:
};
public:
BE_VALUE_TYPE(BeCallInst, BeInst);
BE_VALUE_TYPE(BeCallInst, BeInst);
BeValue* mInlineResult;
BeValue* mFunc;
SizedArray<Arg, 4> mArgs;
BfIRCallingConv mCallingConv;
bool mNoReturn;
bool mTailCall;
bool mTailCall;
virtual BeType* GetType() override;
@ -1369,7 +1365,7 @@ public:
mFunc = NULL;
mCallingConv = BfIRCallingConv_CDecl;
mNoReturn = false;
mTailCall = false;
mTailCall = false;
}
virtual void HashInst(BeHashContext& hashCtx) override
@ -1379,7 +1375,7 @@ public:
mInlineResult->HashReference(hashCtx);
mFunc->HashReference(hashCtx);
for (auto& arg : mArgs)
{
{
arg.mValue->HashReference(hashCtx);
hashCtx.Mixin(arg.mStructRet);
hashCtx.Mixin(arg.mZExt);
@ -1388,7 +1384,7 @@ public:
}
hashCtx.Mixin(mCallingConv);
hashCtx.Mixin(mNoReturn);
hashCtx.Mixin(mTailCall);
hashCtx.Mixin(mTailCall);
}
bool HasStructRet()
@ -1405,9 +1401,9 @@ public:
BE_VALUE_TYPE(BeComptimeError, BeInst);
public:
int mError;
int mError;
public:
public:
virtual void HashInst(BeHashContext& hashCtx) override
{
hashCtx.Mixin(TypeId);
@ -1424,7 +1420,7 @@ public:
int mTypeId;
BeType* mResultType;
public:
public:
virtual BeType* GetType() override
{
return mResultType;
@ -1476,7 +1472,7 @@ public:
}
virtual void HashInst(BeHashContext& hashCtx) override
{
{
hashCtx.Mixin(TypeId);
mValue->HashReference(hashCtx);
hashCtx.Mixin(mTypeId);
@ -1554,7 +1550,7 @@ public:
struct BeDumpContext
{
public:
public:
Dictionary<BeValue*, String> mValueNameMap;
Dictionary<String, int> mSeenNames;
@ -1588,7 +1584,6 @@ public:
bool mIsValue;
virtual void HashInst(BeHashContext& hashCtx) override;
};
class BeMDNode : public BeValue
@ -1599,7 +1594,6 @@ public:
public:
virtual ~BeMDNode()
{
}
virtual void HashContent(BeHashContext& hashCtx) override
@ -1620,20 +1614,20 @@ public:
int mColumn;
BeMDNode* mDbgScope;
BeDbgLoc* mDbgInlinedAt;
int mIdx;
int mIdx;
bool mHadInline;
public:
BeDbgLoc()
{
{
}
int GetInlineDepth();
int GetInlineDepth();
int GetInlineMatchDepth(BeDbgLoc* other);
BeDbgLoc* GetInlinedAt(int idx = 0);
BeDbgLoc* GetRoot();
BeDbgFunction* GetDbgFunc();
BeDbgFile* GetDbgFile();
BeDbgFile* GetDbgFile();
virtual void HashContent(BeHashContext& hashCtx) override
{
@ -1645,7 +1639,7 @@ public:
else
hashCtx.Mixin(-1);
if (mDbgInlinedAt != NULL)
mDbgInlinedAt->HashReference(hashCtx);
mDbgInlinedAt->HashReference(hashCtx);
}
};
@ -1660,7 +1654,7 @@ public:
BeBlock* mLastBeBlock;
int mId;
virtual void HashContent(BeHashContext& hashCtx) override;
virtual void HashContent(BeHashContext& hashCtx) override;
};
class BeDbgNamespace : public BeMDNode
@ -1687,16 +1681,16 @@ public:
public:
int mTypeId;
BeDbgTypeId()
{
mTypeId = -1;
}
virtual void HashContent(BeHashContext& hashCtx) override
{
hashCtx.Mixin(TypeId);
hashCtx.Mixin(mTypeId);
hashCtx.Mixin(mTypeId);
}
};
@ -1704,7 +1698,7 @@ class BeDbgType : public BeMDNode
{
public:
BE_VALUE_TYPE(BeDbgType, BeMDNode);
public:
int mSize;
int mAlign;
@ -1744,7 +1738,7 @@ public:
BE_VALUE_TYPE(BeDbgBasicType, BeDbgType);
public:
String mName;
String mName;
int mEncoding;
virtual void HashContent(BeHashContext& hashCtx) override
@ -1763,7 +1757,7 @@ public:
BE_VALUE_TYPE(BeDbgArrayType, BeDbgType);
public:
BeDbgType* mElement;
BeDbgType* mElement;
int mNumElements;
virtual void HashContent(BeHashContext& hashCtx) override
@ -1772,7 +1766,7 @@ public:
hashCtx.Mixin(mSize);
hashCtx.Mixin(mAlign);
hashCtx.Mixin(mNumElements);
mElement->HashReference(hashCtx);
mElement->HashReference(hashCtx);
}
};
@ -1824,10 +1818,10 @@ public:
class BeDbgPointerType : public BeDbgType
{
public:
BE_VALUE_TYPE(BeDbgPointerType, BeDbgType);
BE_VALUE_TYPE(BeDbgPointerType, BeDbgType);
public:
BeDbgType* mElement;
BeDbgType* mElement;
virtual void HashContent(BeHashContext& hashCtx) override
{
@ -1862,7 +1856,7 @@ public:
int mFlags;
int mOffset;
bool mIsStatic;
BeValue* mStaticValue;
BeValue* mStaticValue;
public:
BeDbgStructMember()
@ -1895,7 +1889,7 @@ public:
public:
BeDbgType* mReturnType;
Array<BeDbgType*> mParams;
public:
virtual void HashContent(BeHashContext& hashCtx) override
{
@ -1954,9 +1948,9 @@ public:
Kind_SymbolAddr
};
Kind mKind;
X64CPURegister mReg;
int mOfs;
Kind mKind;
X64CPURegister mReg;
int mOfs;
public:
BeDbgVariableLoc()
@ -1974,7 +1968,7 @@ public:
public:
String mName;
BeMDNode* mType;
BeMDNode* mType;
BeValue* mValue;
int mParamNum;
BfIRInitType mInitType;
@ -1984,13 +1978,13 @@ public:
BeDbgLoc* mDeclDbgLoc;
BeDbgVariableLoc mPrimaryLoc;
BeDbgVariableLoc mSavedLoc;
BeDbgVariableLoc mSavedLoc;
int mDeclStart;
int mDeclEnd;
int mDeclMCBlockId;
int mDeclEnd;
int mDeclMCBlockId;
bool mDeclLifetimeExtend;
bool mDbgLifeEnded;
bool mIsValue; // Value vs Addr
bool mIsValue; // Value vs Addr
Array<BeDbgVariableRange> mSavedRanges;
Array<BeDbgVariableRange> mGaps;
@ -2027,7 +2021,7 @@ public:
if (mScope != NULL)
mScope->HashReference(hashCtx);
if (mDeclDbgLoc != NULL)
mDeclDbgLoc->HashReference(hashCtx);
mDeclDbgLoc->HashReference(hashCtx);
// The others only get filled in after generation -- not part of hash
}
@ -2065,8 +2059,8 @@ public:
bool mIncludedAsMember;
int mFlags;
int mVK;
int mVIndex;
int mVIndex;
Array<BeDbgVariable*> mVariables;
int mPrologSize;
int mCodeLen;
@ -2089,9 +2083,9 @@ public:
mIsLocalToUnit = false;
mVK = -1;
mVIndex = -1;
mIsStaticMethod = true;
mIsStaticMethod = true;
mIncludedAsMember = false;
mPrologSize = 0;
mPrologSize = 0;
mCodeLen = -1;
mCvTypeId = -1;
mCvFuncId = -1;
@ -2128,7 +2122,7 @@ public:
return ((mVariables.size() > 0) && (mVariables[0]->mName == "this"));
}*/
}
virtual void HashContent(BeHashContext& hashCtx) override;
};
@ -2166,7 +2160,7 @@ public:
public:
BeDbgStructType()
{
mScope = NULL;
mScope = NULL;
mDerivedFrom = NULL;
mIsStatic = false;
mIsFullyDefined = false;
@ -2236,12 +2230,12 @@ public:
BE_VALUE_TYPE(BeDbgFile, BeMDNode);
public:
String mFileName;
String mFileName;
String mDirectory;
Val128 mMD5Hash;
int mIdx;
int mIdx;
void ToString(String& str);
void ToString(String& str);
void GetFilePath(String& outStr);
virtual void HashContent(BeHashContext& hashCtx) override
@ -2295,7 +2289,7 @@ public:
String mFileName;
String mDirectory;
String mProducer;
OwnedVector<BeDbgFile> mFiles;
OwnedVector<BeDbgNamespace> mNamespaces;
OwnedVector<BeDbgGlobalVariable> mGlobalVariables;
@ -2303,7 +2297,7 @@ public:
OwnedVector<BeMDNode> mTypes;
Array<BeDbgFunction*> mFuncs; // Does not include methods in structs
virtual void HashContent(BeHashContext& hashCtx) override;
virtual void HashContent(BeHashContext& hashCtx) override;
BeDbgReferenceType* CreateReferenceType(BeDbgType* dbgType);
};
@ -2330,18 +2324,18 @@ public:
int mInsertPos;
BeDbgLoc* mCurDbgLoc;
BeDbgLoc* mPrevDbgLocInline;
BeDbgLoc* mLastDbgLoc;
Array<BeArgument*> mArgs;
Array<BeFunction*> mFunctions;
BeDbgLoc* mLastDbgLoc;
Array<BeArgument*> mArgs;
Array<BeFunction*> mFunctions;
Dictionary<String, BeFunction*> mFunctionMap;
int mCurDbgLocIdx;
int mCurLexBlockId;
int mCurLexBlockId;
BeDbgModule* mDbgModule;
CeMachine* mCeMachine;
public:
void AddInst(BeInst* inst);
public:
void AddInst(BeInst* inst);
static void ToString(StringImpl& str, BeType* type);
static void StructToString(StringImpl& str, BeStructType* type);
@ -2362,7 +2356,7 @@ public:
}
public:
BeModule(const StringImpl& moduleName, BeContext* context);
BeModule(const StringImpl& moduleName, BeContext* context);
~BeModule();
void Hash(BeHashContext& hashCtx);
@ -2375,11 +2369,11 @@ public:
void DoInlining(BeFunction* func);
void DoInlining();
static BeCmpKind InvertCmp(BeCmpKind cmpKind);
static BeCmpKind SwapCmpSides(BeCmpKind cmpKind);
static BeCmpKind InvertCmp(BeCmpKind cmpKind);
static BeCmpKind SwapCmpSides(BeCmpKind cmpKind);
void SetActiveFunction(BeFunction* function);
BeArgument* GetArgument(int arg);
BeBlock* CreateBlock(const StringImpl& name);
BeBlock* CreateBlock(const StringImpl& name);
void AddBlock(BeFunction* function, BeBlock* block);
void RemoveBlock(BeFunction* function, BeBlock* block);
BeBlock* GetInsertBlock();
@ -2395,9 +2389,9 @@ public:
///
BeNopInst* CreateNop();
BeUndefValueInst* CreateUndefValue(BeType* type);
BeNumericCastInst* CreateNumericCast(BeValue* value, BeType* toType, bool valSigned, bool toSigned);
BeNumericCastInst* CreateNumericCast(BeValue* value, BeType* toType, bool valSigned, bool toSigned);
BeBitCastInst* CreateBitCast(BeValue* value, BeType* toType);;
BeCmpInst* CreateCmp(BeCmpKind cmpKind, BeValue* lhs, BeValue* rhs);
BeCmpInst* CreateCmp(BeCmpKind cmpKind, BeValue* lhs, BeValue* rhs);
BeBinaryOpInst* CreateBinaryOp(BeBinaryOpKind opKind, BeValue* lhs, BeValue* rhs, BfOverflowCheckKind overflowCheckKind = BfOverflowCheckKind_None);
BeAllocaInst* CreateAlloca(BeType* type);
@ -2407,19 +2401,17 @@ public:
BeStoreInst* CreateAlignedStore(BeValue* val, BeValue* ptr, int alignment, bool isVolatile);
BeGEPInst* CreateGEP(BeValue* ptr, BeValue* idx0, BeValue* idx1);
BeBrInst* CreateBr(BeBlock* block);
BeBrInst* CreateBr(BeBlock* block);
BeCondBrInst* CreateCondBr(BeValue* cond, BeBlock* trueBlock, BeBlock* falseBlock);
BeRetInst* CreateRetVoid();
BeRetInst* CreateRet(BeValue* value);
BeRetInst* CreateRet(BeValue* value);
BeSetRetInst* CreateSetRet(BeValue* value, int returnTypeId);
BeCallInst* CreateCall(BeValue* func, const SizedArrayImpl<BeValue*>& args);
BeConstant* GetConstant(BeType* type, double floatVal);
BeConstant* GetConstant(BeType* type, int64 intVal);
BeConstant* GetConstant(BeType* type, bool boolVal);
BeConstant* GetConstantNull(BePointerType* type);
BeConstant* GetConstantNull(BePointerType* type);
};
NS_BF_END