mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Added TargetTriple, fixed asm stuff for non-x86 LLVM
This commit is contained in:
parent
079574a4e7
commit
e2dad5f838
8 changed files with 110 additions and 11 deletions
42
IDEHelper/Compiler/BfTargetTriple.cpp
Normal file
42
IDEHelper/Compiler/BfTargetTriple.cpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
#include "BfTargetTriple.h"
|
||||
|
||||
USING_NS_BF;
|
||||
|
||||
BfTargetTriple::BfTargetTriple()
|
||||
{
|
||||
mParsed = true;
|
||||
mMachineType = BfMachineType_Unknown;
|
||||
}
|
||||
|
||||
BfTargetTriple::BfTargetTriple(const StringImpl& targetTriple)
|
||||
{
|
||||
mParsed = false;
|
||||
mMachineType = BfMachineType_Unknown;
|
||||
mTargetTriple = targetTriple;
|
||||
}
|
||||
|
||||
void BfTargetTriple::Parse()
|
||||
{
|
||||
if (mTargetTriple.StartsWith("x86_64"))
|
||||
mMachineType = BfMachineType_x64;
|
||||
else if ((mTargetTriple.StartsWith("i686")) || (mTargetTriple.StartsWith("x86")))
|
||||
mMachineType = BfMachineType_x64;
|
||||
else if ((mTargetTriple.StartsWith("aarch64")) || (mTargetTriple.StartsWith("arm64")))
|
||||
mMachineType = BfMachineType_AArch64;
|
||||
else
|
||||
mMachineType = BfMachineType_Unknown;
|
||||
mParsed = true;
|
||||
}
|
||||
|
||||
void BfTargetTriple::Set(const StringImpl& targetTriple)
|
||||
{
|
||||
mTargetTriple = targetTriple;
|
||||
mParsed = false;
|
||||
}
|
||||
|
||||
BfMachineType BfTargetTriple::GetMachineType()
|
||||
{
|
||||
if (!mParsed)
|
||||
Parse();
|
||||
return mMachineType;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue