1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Added AArch64 support

This commit is contained in:
Brian Fiete 2019-10-16 13:07:37 -07:00
parent 3c153d27d2
commit 8c18d56c9e
6 changed files with 48 additions and 6 deletions

View file

@ -3176,7 +3176,7 @@ void BfCompiler::UpdateRevisedTypes()
if (outerTypeDef->mDefState == BfTypeDef::DefState_Deleted)
{
BfLogSysM("UpdateRevisedTypes deleting type %p\n", outerTypeDef);
BfLogSysM("UpdateRevisedTypes deleting outerTypeDef %p\n", outerTypeDef);
outerTypeDef->mDefState = BfTypeDef::DefState_Deleted;
mSystem->RemoveTypeDef(outerTypeDef);
}

View file

@ -76,6 +76,8 @@ BfDefBuilder::~BfDefBuilder()
void BfDefBuilder::Process(BfPassInstance* passInstance, BfSource* bfSource, bool fullRefresh)
{
BF_ASSERT(mSystem->mCurSystemLockThreadId == BfpThread_GetCurrentId());
String fileName;
BfParser* parser = bfSource->ToParser();
if (parser != NULL)
@ -1171,7 +1173,7 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
}
}
BfLogSys(mCurSource->mSystem, "DefBuilder %p TypeDecl:%s\n", mCurSource, mCurTypeDef->mName->ToString().mPtr);
BfLogSys(mCurSource->mSystem, "DefBuilder %p %p TypeDecl:%s\n", mCurTypeDef, mCurSource, mCurTypeDef->mName->ToString().mPtr);
mCurTypeDef->mProtection = (outerTypeDef == NULL) ? BfProtection_Public : BfProtection_Private;
if (typeDeclaration->mInternalSpecifier != NULL)
@ -1363,6 +1365,8 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
if (outerTypeDef != NULL)
numGenericParams += (int)outerTypeDef->mGenericParamDefs.size();
BfLogSys(mCurSource->mSystem, "DefBuilder %p Hash:%d isAutoComplete:%d\n", mCurTypeDef, mSystem->mTypeDefs.GetHash(mCurTypeDef), isAutoCompleteTempType);
if (!isAutoCompleteTempType)
{
BfTypeDef* prevDef = NULL;
@ -1370,6 +1374,8 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
// auto checkTypeDef = mSystem->mTypeDefs.Find(fullName);
// while (checkTypeDef != NULL)
auto itr = mSystem->mTypeDefs.TryGet(fullName);
while (itr)
{

View file

@ -3953,7 +3953,7 @@ bool BfIRCodeGen::WriteObjectFile(const StringImpl& outFileName, const BfCodeGen
const llvm::Target *theTarget = llvm::TargetRegistry::lookupTarget(arch.c_str(), theTriple, Error);
if (!theTarget)
{
OutputDebugStrF("Failed to create LLVM Target: %s", Error.c_str());
Fail(StrFormat("Failed to create LLVM Target: %s", Error.c_str()));
return false;
}
@ -4057,6 +4057,7 @@ bool BfIRCodeGen::WriteObjectFile(const StringImpl& outFileName, const BfCodeGen
//TargetMachine::CGFT_AssemblyFile,
noVerify /*, StartAfterID, StopAfterID*/))
{
Fail("Target does not support generation of this file type");
/*errs() << argv[0] << ": target does not support generation of this"
<< " file type!\n";*/
return false;
@ -4137,3 +4138,33 @@ int BF_LinuxFixLinkage()
return 0;
}
#endif
//#include "aarch64/Disassembler/X86DisassemblerDecoder.h"
//#include "X86/MCTargetDesc/X86MCTargetDesc.h"
//#include "X86/MCTargetDesc/X86BaseInfo.h"
//#include "X86InstrInfo.h"
#ifdef BF_PLATFORM_MACOS
#include "AArch64/MCTargetDesc/AArch64MCTargetDesc.h"
//#include "AArch64/MCTargetDesc/AArch64BaseInfo.h"
//#include "../X86InstrInfo.h"
int BF_AARC64_Linkage()
{
LLVMInitializeAArch64TargetInfo();
LLVMInitializeAArch64Target();
LLVMInitializeAArch64TargetMC();
return 0;
}
#endif
void BfIRCodeGen::StaticInit()
{
LLVMInitializeX86TargetInfo();
LLVMInitializeX86Target();
LLVMInitializeX86TargetMC();
LLVMInitializeAArch64TargetInfo();
LLVMInitializeAArch64Target();
LLVMInitializeAArch64TargetMC();
}

View file

@ -142,6 +142,8 @@ public:
static int GetIntrinsicId(const StringImpl& name);
static const char* GetIntrinsicName(int intrinId);
static void SetAsmKind(BfAsmKind asmKind);
static void StaticInit();
};
NS_BF_END