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

Added changes to support CompilerExplorer

This commit is contained in:
Brian Fiete 2019-10-11 05:58:08 -07:00
parent c97b074fee
commit c9e0ab6089
20 changed files with 389 additions and 156 deletions

View file

@ -3415,7 +3415,8 @@ static void AddFunctionSimplificationPasses(llvm::legacy::PassManagerBase &MPM,
//if (EnableGVNHoist)
if (options.mEnableGVNHoist)
MPM.add(llvm::createGVNHoistPass());
if (options.mEnableGVNSink) {
if (options.mEnableGVNSink)
{
MPM.add(llvm::createGVNSinkPass());
MPM.add(llvm::createCFGSimplificationPass());
}
@ -4047,7 +4048,7 @@ bool BfIRCodeGen::WriteObjectFile(const StringImpl& outFileName, const BfCodeGen
{
// Ask the target to add backend passes as necessary.
if (target->addPassesToEmitFile(PM, out, NULL,
llvm::TargetMachine::CGFT_ObjectFile,
(codeGenOptions.mAsmKind != BfAsmKind_None) ? llvm::TargetMachine::CGFT_AssemblyFile : llvm::TargetMachine::CGFT_ObjectFile,
//TargetMachine::CGFT_AssemblyFile,
noVerify /*, StartAfterID, StopAfterID*/))
{
@ -4110,6 +4111,12 @@ const char* BfIRCodeGen::GetIntrinsicName(int intrinId)
return gIntrinEntries[intrinId].mName;
}
void BfIRCodeGen::SetAsmKind(BfAsmKind asmKind)
{
const char* args[] = {"", (asmKind == BfAsmKind_ATT) ? "-x86-asm-syntax=att" : "-x86-asm-syntax=intel" };
llvm::cl::ParseCommandLineOptions(2, args);
}
#ifdef BF_PLATFORM_LINUX
//HACK: I don't know why this is needed, but we get link errors if we don't have it.
int BF_LinuxFixLinkage()