MCPcopy Create free account
hub / github.com/beefytech/Beef / DoCompile

Method DoCompile

IDEHelper/Compiler/BfCompiler.cpp:7019–8093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7017}
7018
7019bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
7020{
7021 BP_ZONE("BfCompiler::Compile");
7022
7023 uint32 frontendStartTick = BFTickCount();
7024
7025 if (mSystem->mTypeDefs.mCount == 0)
7026 {
7027 // No-source bailout
7028 return true;
7029 }
7030
7031 if (!mOptions.mErrorString.IsEmpty())
7032 {
7033 mPassInstance->Fail(mOptions.mErrorString);
7034 return false;
7035 }
7036
7037 {
7038 String hotSwapErrors;
7039 String toolsetErrors;
7040 for (auto project : mSystem->mProjects)
7041 {
7042 project->ClearCache();
7043 if (project->mDisabled)
7044 continue;
7045 if (project->mCodeGenOptions.mLTOType != BfLTOType_None)
7046 {
7047 if (mOptions.mAllowHotSwapping)
7048 {
7049 if (!hotSwapErrors.IsEmpty())
7050 hotSwapErrors += ", ";
7051 hotSwapErrors += project->mName;
7052 }
7053 if (mOptions.mToolsetType != BfToolsetType_LLVM)
7054 {
7055 if (!toolsetErrors.IsEmpty())
7056 toolsetErrors += ", ";
7057 toolsetErrors += project->mName;
7058 }
7059 }
7060 }
7061
7062 if (!hotSwapErrors.IsEmpty())
7063 mPassInstance->Fail(StrFormat("Hot compilation cannot be used when LTO is enabled in '%s'. Consider setting 'Workspace/Beef/Debug/Enable Hot Compilation' to 'No'.", hotSwapErrors.c_str()));
7064 if (!toolsetErrors.IsEmpty())
7065 mPassInstance->Fail(StrFormat("The Workspace Toolset must be set to 'LLVM' in order to use LTO in '%s'. Consider changing 'Workspace/Targeted/Build/Toolset' to 'LLVM'.", toolsetErrors.c_str()));
7066 }
7067
7068 //
7069 {
7070 String attribName;
7071 mAttributeTypeOptionMap.Clear();
7072 for (int typeOptionsIdx = 0; typeOptionsIdx < (int)mSystem->mTypeOptions.size(); typeOptionsIdx++)
7073 {
7074 auto& typeOptions = mSystem->mTypeOptions[typeOptionsIdx];
7075 for (auto& attributeFilter : typeOptions.mAttributeFilters)
7076 {

Callers

nothing calls this directly

Calls 15

BpEnterFunction · 0.85
BpLeaveFunction · 0.85
GetFunction · 0.85
BpEventFunction · 0.85
CompileStartedMethod · 0.80
ResetStatsMethod · 0.80
StartYieldSectionMethod · 0.80
ProcessAtomGraveyardMethod · 0.80
ContainsReferenceMethod · 0.80
GetInternalMethodMethod · 0.80
FinishInitMethod · 0.80

Tested by

no test coverage detected