mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 00:50:25 +02:00
Added changes to support CompilerExplorer
This commit is contained in:
parent
c97b074fee
commit
c9e0ab6089
20 changed files with 389 additions and 156 deletions
|
@ -8,6 +8,18 @@ namespace IDE.Compiler
|
|||
{
|
||||
public class BfProject
|
||||
{
|
||||
enum Flags : int32
|
||||
{
|
||||
None = 0,
|
||||
MergeFunctions = 1,
|
||||
CombineLoads = 2,
|
||||
VectorizeLoops = 4,
|
||||
VectorizeSLP = 8,
|
||||
SingleModule = 0x10,
|
||||
AsmOutput = 0x20,
|
||||
AsmOutput_ATT = 0x40,
|
||||
}
|
||||
|
||||
[StdCall, CLink]
|
||||
extern static void BfProject_Delete(void* nativeBfProject);
|
||||
|
||||
|
@ -22,7 +34,7 @@ namespace IDE.Compiler
|
|||
|
||||
[StdCall, CLink]
|
||||
extern static void BfProject_SetOptions(void* nativeBfProject, int32 targetType, char8* startupObject, char8* preprocessorMacros,
|
||||
int32 optLevel, int32 ltoType, bool mergeFunctions, bool combineLoads, bool vectorizeLoops, bool vectorizeSLP);
|
||||
int32 optLevel, int32 ltoType, Flags flags);
|
||||
|
||||
public void* mNativeBfProject;
|
||||
public bool mDisabled;
|
||||
|
@ -51,10 +63,21 @@ namespace IDE.Compiler
|
|||
public void SetOptions(Project.TargetType targetType, String startupObject, List<String> preprocessorMacros,
|
||||
BuildOptions.BfOptimizationLevel optLevel, BuildOptions.LTOType ltoType, bool mergeFunctions, bool combineLoads, bool vectorizeLoops, bool vectorizeSLP)
|
||||
{
|
||||
Flags flags = default;
|
||||
void SetFlags(bool val, Flags flag)
|
||||
{
|
||||
if (val)
|
||||
flags |= flag;
|
||||
}
|
||||
SetFlags(mergeFunctions, .MergeFunctions);
|
||||
SetFlags(combineLoads, .CombineLoads);
|
||||
SetFlags(vectorizeLoops, .VectorizeLoops);
|
||||
SetFlags(vectorizeSLP, .VectorizeSLP);
|
||||
|
||||
String macrosStr = scope String();
|
||||
macrosStr.Join("\n", preprocessorMacros.GetEnumerator());
|
||||
BfProject_SetOptions(mNativeBfProject, (int32)targetType, startupObject, macrosStr,
|
||||
(int32)optLevel, (int32)ltoType, mergeFunctions, combineLoads, vectorizeLoops, vectorizeSLP);
|
||||
(int32)optLevel, (int32)ltoType, flags);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1179,48 +1179,6 @@ namespace IDE.ui
|
|||
}
|
||||
}
|
||||
|
||||
public void RemoveInvalidContinuationItems()
|
||||
{
|
||||
/*var lastValidListViewItem = this;
|
||||
for (int32 idx = 1; idx < mWatchSeriesInfo.mCount; idx++)
|
||||
{
|
||||
int32 parentIdx = idx + mWatchSeriesInfo.mStartMemberIdx;
|
||||
if (parentIdx >= mParentItem.mChildItems.Count)
|
||||
break;
|
||||
|
||||
WatchListViewItem watchListViewItem = (WatchListViewItem)mParentItem.mChildItems[parentIdx];
|
||||
if (watchListViewItem.mWatchSeriesInfo != mWatchSeriesInfo)
|
||||
break;
|
||||
if (watchListViewItem.mSeriesMemberIdx == 0)
|
||||
break;
|
||||
|
||||
int addrSize = IDEApp.sApp.mDebugger.GetAddrSize() * 2;
|
||||
int addrsCount = (mWatchSeriesInfo.mAddrs.Length / addrSize) / mWatchSeriesInfo.mAddrsEntrySize;
|
||||
if (watchListViewItem.mSeriesMemberIdx >= addrsCount)
|
||||
{
|
||||
lastValidListViewItem.mBottomPadding += watchListViewItem.mSelfHeight + watchListViewItem.mBottomPadding;
|
||||
mListView.mListSizeDirty = true;
|
||||
mParentItem.RemoveChildItem(watchListViewItem);
|
||||
idx--;
|
||||
}
|
||||
else
|
||||
lastValidListViewItem = watchListViewItem;
|
||||
}*/
|
||||
|
||||
// This caused 'closing' opened items with Dictionary elements when stepping
|
||||
/*if (mWatchSeriesInfo.mAddrs != null)
|
||||
{
|
||||
int32 checkIdx = mWatchSeriesInfo.mStartMemberIdx + 1;
|
||||
while (checkIdx < mParentItem.mChildItems.Count)
|
||||
{
|
||||
WatchListViewItem watchListViewItem = (WatchListViewItem)mParentItem.mChildItems[checkIdx];
|
||||
if (watchListViewItem.mWatchSeriesInfo != mWatchSeriesInfo)
|
||||
break;
|
||||
//mParentItem.RemoveChildItem(watchListViewItem);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if ((mWatchEntry != null) && (mWatchEntry.mIsPending))
|
||||
|
@ -2508,13 +2466,6 @@ namespace IDE.ui
|
|||
while (listViewItem.GetChildCount() > memberCount)
|
||||
listViewItem.RemoveChildItem(listViewItem.GetChildAtIndex(memberCount));
|
||||
|
||||
if ((watchSeriesInfo != null) && (watchSeriesInfo.mAddrs != null))
|
||||
{
|
||||
var headItem = (WatchListViewItem)listViewItem.GetChildAtIndex(watchSeriesInfo.mStartMemberIdx);
|
||||
headItem.RemoveInvalidContinuationItems();
|
||||
mListView.UpdateAll();
|
||||
}
|
||||
|
||||
if ((listViewItem.GetChildCount() == 0) && (listViewItem.mOpenButton != null))
|
||||
{
|
||||
Widget.RemoveAndDelete(listViewItem.mOpenButton);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue