瀏覽代碼

Bug fixes, installer, [Export]

Fixed a bunch of bugs in aggregate const initializers
Fixed ZIP bugs
Fixed a compilation case where we change protection while reifying a type
Added another project kind - Dynamic Library
Added [Export] for DLL method exporting
Fixed some issues of things being  generated as __NOINLINE incorrectly
Fixed an issue with module extensions with not-yet-demanded on-demand methods
Started adding Installer
Brian Fiete 6 年之前
父節點
當前提交
09016c8dc0
共有 100 個文件被更改,包括 2618 次插入920 次删除
  1. 1 1
      Beef.sln
  2. 0 1
      BeefLibs/Beefy2D/src/BFApp.bf
  3. 0 1
      BeefLibs/Beefy2D/src/BFWindow.bf
  4. 0 1
      BeefLibs/Beefy2D/src/Utils.bf
  5. 0 1
      BeefLibs/Beefy2D/src/gfx/ConstantDataDefinition.bf
  6. 0 1
      BeefLibs/Beefy2D/src/gfx/DrawLayer.bf
  7. 0 1
      BeefLibs/Beefy2D/src/gfx/Font.bf
  8. 0 1
      BeefLibs/Beefy2D/src/gfx/Graphics.bf
  9. 0 1
      BeefLibs/Beefy2D/src/gfx/Image.bf
  10. 0 1
      BeefLibs/Beefy2D/src/gfx/Model.bf
  11. 0 1
      BeefLibs/Beefy2D/src/gfx/RenderState.bf
  12. 0 1
      BeefLibs/Beefy2D/src/gfx/Shader.bf
  13. 0 1
      BeefLibs/Beefy2D/src/gfx/Vertex3D.bf
  14. 0 1
      BeefLibs/Beefy2D/src/gfx/VertexDefinition.bf
  15. 0 1
      BeefLibs/Beefy2D/src/res/PSDReader.bf
  16. 0 1
      BeefLibs/Beefy2D/src/res/ResourceManager.bf
  17. 0 1
      BeefLibs/Beefy2D/src/res/SoundBank.bf
  18. 0 1
      BeefLibs/Beefy2D/src/res/SoundEvent.bf
  19. 0 1
      BeefLibs/Beefy2D/src/res/SoundParameter.bf
  20. 0 1
      BeefLibs/Beefy2D/src/sys/SysMenu.bf
  21. 13 5
      BeefLibs/Beefy2D/src/theme/dark/DarkTooltip.bf
  22. 0 1
      BeefLibs/Beefy2D/src/utils/BeefPerf.bf
  23. 0 1
      BeefLibs/Beefy2D/src/utils/PerfTimer.bf
  24. 0 1
      BeefLibs/Beefy2D/src/widgets/ButtonWidget.bf
  25. 0 1
      BeefLibs/Beefy2D/src/widgets/EditWidget.bf
  26. 1 1
      BeefLibs/Beefy2D/src/widgets/ListView.bf
  27. 4 26
      BeefLibs/corlib/src/System/Attribute.bf
  28. 15 1
      BeefLibs/corlib/src/System/Collections/Generic/Dictionary.bf
  29. 0 1
      BeefLibs/corlib/src/System/Collections/IEnumerator.bf
  30. 0 1
      BeefLibs/corlib/src/System/DateTimeOffset.bf
  31. 0 1
      BeefLibs/corlib/src/System/Double.bf
  32. 0 1
      BeefLibs/corlib/src/System/Globalization/CalendarData.bf
  33. 0 1
      BeefLibs/corlib/src/System/Globalization/DateTimeFormat.bf
  34. 0 1
      BeefLibs/corlib/src/System/IO/FileOptions.bf
  35. 0 1
      BeefLibs/corlib/src/System/Native.bf
  36. 0 1
      BeefLibs/corlib/src/System/Nullable.bf
  37. 16 4
      BeefLibs/corlib/src/System/String.bf
  38. 0 1
      BeefLibs/corlib/src/System/TimeZoneInfo.bf
  39. 3 2
      BeefLibs/corlib/src/System/Windows.bf
  40. 424 4
      BeefRT/BeefDbg/BeefDbg.vcxproj
  41. 4 1
      BeefRT/BeefRT.vcxproj
  42. 29 34
      BeefRT/dbg/DbgInternal.cpp
  43. 12 12
      BeefRT/dbg/gc.cpp
  44. 3 11
      BeefRT/dbg/gc.h
  45. 4 5
      BeefRT/dbg/gc_raw.cpp
  46. 13 5
      BeefRT/rt/BfObjects.h
  47. 5 0
      BeefRT/rt/Internal.cpp
  48. 7 7
      BeefRT/rt/Object.cpp
  49. 5 5
      BeefRT/rt/Thread.h
  50. 0 11
      BeefTools/BeefInstall/BeefProj.toml
  51. 0 6
      BeefTools/BeefInstall/BeefSpace.toml
  52. 0 136
      BeefTools/BeefInstall/BeefSpace_User.toml
  53. 25 0
      BeefTools/BeefInstall/Stub/BeefProj.toml
  54. 11 0
      BeefTools/BeefInstall/Stub/BeefSpace.toml
  55. 2 1
      BeefTools/BeefInstall/Stub/src/CabFile.bf
  56. 236 0
      BeefTools/BeefInstall/Stub/src/PEFile.bf
  57. 179 0
      BeefTools/BeefInstall/Stub/src/Program.bf
  58. 二進制
      BeefTools/BeefInstall/StubUI/Beef042Dbg64.dll
  59. 二進制
      BeefTools/BeefInstall/StubUI/Beef042RT64.dll
  60. 24 0
      BeefTools/BeefInstall/StubUI/BeefProj.toml
  61. 10 0
      BeefTools/BeefInstall/StubUI/BeefSpace.toml
  62. 二進制
      BeefTools/BeefInstall/StubUI/StubUI_d.dll
  63. 1 0
      BeefTools/BeefInstall/StubUI/StubUI_d.dll.build.txt
  64. 二進制
      BeefTools/BeefInstall/StubUI/StubUI_d.exp
  65. 二進制
      BeefTools/BeefInstall/StubUI/StubUI_d.lib
  66. 二進制
      BeefTools/BeefInstall/StubUI/StubUI_d.pdb
  67. 41 0
      BeefTools/BeefInstall/StubUI/src/BIApp.bf
  68. 38 0
      BeefTools/BeefInstall/StubUI/src/Program.bf
  69. 0 96
      BeefTools/BeefInstall/src/Program.bf
  70. 1 0
      BeefySysLib/BeefySysLib.vcxproj
  71. 1 1
      IDE/BeefProj.toml
  72. 355 22
      IDE/BeefSpace_User.toml
  73. 5 0
      IDE/Tests/BugW001/BeefProj.toml
  74. 8 0
      IDE/Tests/BugW001/BeefSpace.toml
  75. 9 0
      IDE/Tests/BugW001/scripts/Test.txt
  76. 18 0
      IDE/Tests/BugW001/src/Program.bf
  77. 1 0
      IDE/mintest/BeefSpace.toml
  78. 4 26
      IDE/mintest/minlib/src/System/Attribute.bf
  79. 0 1
      IDE/mintest/minlib/src/System/Collections/Generic/List.bf
  80. 0 1
      IDE/mintest/minlib/src/System/Collections/IEnumerator.bf
  81. 0 1
      IDE/mintest/minlib/src/System/Double.bf
  82. 0 1
      IDE/mintest/minlib/src/System/Math.bf
  83. 0 1
      IDE/mintest/minlib/src/System/Nullable.bf
  84. 0 1
      IDE/mintest/minlib/src/System/Threading/Monitor.bf
  85. 0 387
      IDE/mintest/mintest.bfuser
  86. 8 4
      IDE/mintest/src/main.bf
  87. 7 0
      IDE/mintest/src/main2.bf
  88. 13 57
      IDE/mintest/src/main3.bf
  89. 1062 0
      IDE/src/BuildContext.bf
  90. 0 1
      IDE/src/Clang/ClangCompiler.bf
  91. 0 1
      IDE/src/Clang/ClangHelper.bf
  92. 0 1
      IDE/src/Compiler/BfCompiler.bf
  93. 0 1
      IDE/src/Compiler/BfParser.bf
  94. 0 1
      IDE/src/Compiler/BfPassInstance.bf
  95. 0 1
      IDE/src/Compiler/BfProject.bf
  96. 0 1
      IDE/src/Compiler/BfResolvePassData.bf
  97. 0 1
      IDE/src/Compiler/BfSystem.bf
  98. 0 1
      IDE/src/Debugger/Breakpoint.bf
  99. 0 1
      IDE/src/Debugger/Callbacks.bf
  100. 0 1
      IDE/src/Debugger/DebugManager.bf

+ 1 - 1
Beef.sln

@@ -405,7 +405,7 @@ Global
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
-		VD_Solution = <?xml version="1.0" encoding="utf-16"?>|§r|§n<DocumentsSolution xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">|§r|§n  <m_persistedPinnedDocumentGroupLabels>|§r|§n    <string>X86</string>|§r|§n  </m_persistedPinnedDocumentGroupLabels>|§r|§n</DocumentsSolution>
 		SolutionGuid = {460361DC-9F40-4AE7-B647-82D5D69B70DC}
+		VD_Solution = <?xml version="1.0" encoding="utf-16"?>|§r|§n<DocumentsSolution xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">|§r|§n  <m_persistedPinnedDocumentGroupLabels>|§r|§n    <string>X86</string>|§r|§n  </m_persistedPinnedDocumentGroupLabels>|§r|§n</DocumentsSolution>
 	EndGlobalSection
 EndGlobal

+ 0 - 1
BeefLibs/Beefy2D/src/BFApp.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 using System.IO;
 using Beefy.gfx;

+ 0 - 1
BeefLibs/Beefy2D/src/BFWindow.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 using Beefy.gfx;
 using Beefy.sys;

+ 0 - 1
BeefLibs/Beefy2D/src/Utils.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using System.Reflection;
 using System.Threading;
 using System.IO;

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/ConstantDataDefinition.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using System.Reflection;
 using System.Diagnostics;
 

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/DrawLayer.bf

@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
 using System.Text;
 using Beefy.widgets;
 using Beefy;

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/Font.bf

@@ -1,5 +1,4 @@
 using System;
-using System.Runtime.InteropServices;
 using System.Collections.Generic;
 using System.Text;
 using System.IO;

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/Graphics.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using Beefy.utils;
 using Beefy.geom;
 using System.Diagnostics;

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/Image.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using Beefy.utils;
 using System.Diagnostics;
 

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/Model.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using System.Threading.Tasks;
 using Beefy;
 using Beefy.utils;

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/RenderState.bf

@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
 using System.Text;
 using System.Threading.Tasks;
 using Beefy;

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/Shader.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 
 namespace Beefy.gfx
 {

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/Vertex3D.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 
 namespace Beefy.gfx
 {

+ 0 - 1
BeefLibs/Beefy2D/src/gfx/VertexDefinition.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using System.Reflection;
 using System.Diagnostics;
 

+ 0 - 1
BeefLibs/Beefy2D/src/res/PSDReader.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using Beefy.gfx;
 
 namespace Beefy.res

+ 0 - 1
BeefLibs/Beefy2D/src/res/ResourceManager.bf

@@ -4,7 +4,6 @@ using System.Text;
 using System.Reflection;
 using Beefy.utils;
 using Beefy.gfx;
-using System.Runtime.InteropServices;
 
 namespace Beefy.res
 {    

+ 0 - 1
BeefLibs/Beefy2D/src/res/SoundBank.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using Beefy;
 
 namespace Beefy.res

+ 0 - 1
BeefLibs/Beefy2D/src/res/SoundEvent.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using Beefy;
 
 namespace Beefy.res

+ 0 - 1
BeefLibs/Beefy2D/src/res/SoundParameter.bf

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using System.Runtime.InteropServices;
 using Beefy;
 
 namespace Beefy.res

+ 0 - 1
BeefLibs/Beefy2D/src/sys/SysMenu.bf

@@ -3,7 +3,6 @@ using System.Collections.Generic;
 using System.Text;
 using Beefy.widgets;
 using Beefy;
-using System.Runtime.InteropServices;
 
 namespace Beefy.sys
 {    

+ 13 - 5
BeefLibs/Beefy2D/src/theme/dark/DarkTooltip.bf

@@ -82,6 +82,7 @@ namespace Beefy.theme.dark
 
 		public ~this()
 		{
+			Debug.Assert(mHasClosed);
 			Detach();
 		}
 
@@ -187,11 +188,6 @@ namespace Beefy.theme.dark
 
             if (mWidgetWindow != null)
             {
-                WidgetWindow.sOnMouseDown.Remove(scope => HandleMouseDown, true);
-                WidgetWindow.sOnMouseWheel.Remove(scope => HandleMouseWheel, true);
-                WidgetWindow.sOnMenuItemSelected.Remove(scope => HandleSysMenuItemSelected, true);
-                WidgetWindow.sOnKeyDown.Remove(scope => HandleKeyDown, true);
-
                 mWidgetWindow.Close();
             }
             mCloseEvent();
@@ -249,6 +245,18 @@ namespace Beefy.theme.dark
 			
 			Close();
         }
+
+		protected override void RemovedFromWindow()
+		{
+			base.RemovedFromWindow();
+
+			Debug.Assert(mHasClosed);
+
+			WidgetWindow.sOnMouseDown.Remove(scope => HandleMouseDown, true);
+			WidgetWindow.sOnMouseWheel.Remove(scope => HandleMouseWheel, true);
+			WidgetWindow.sOnMenuItemSelected.Remove(scope => HandleSysMenuItemSelected, true);
+			WidgetWindow.sOnKeyDown.Remove(scope => HandleKeyDown, true);
+		}
     }
 
 	static class DarkTooltipManager

+ 0 - 1
BeefLibs/Beefy2D/src/utils/BeefPerf.bf

@@ -1,5 +1,4 @@
 using System;
-using System.Runtime.InteropServices;
 
 namespace Beefy.utils
 {

+ 0 - 1
BeefLibs/Beefy2D/src/utils/PerfTimer.bf

@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
 using System.Text;
 
 namespace Beefy.utils

+ 0 - 1
BeefLibs/Beefy2D/src/widgets/ButtonWidget.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using Beefy.gfx;
-using System.Runtime.InteropServices;
 
 namespace Beefy.widgets
 {

+ 0 - 1
BeefLibs/Beefy2D/src/widgets/EditWidget.bf

@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 using System.Text;
 using System.Threading;

+ 1 - 1
BeefLibs/Beefy2D/src/widgets/ListView.bf

@@ -852,7 +852,7 @@ namespace Beefy.widgets
                     newSelection = GetRoot();
                     while (newSelection.mChildAreaHeight > 0)
                     {
-                        newSelection = GetRoot().mChildItems[GetRoot().mChildItems.Count - 1];
+                        newSelection = newSelection.mChildItems[newSelection.mChildItems.Count - 1];
                     }    
                 case KeyCode.PageUp:                        
                     int32 numIterations = (int32)(mScrollContentContainer.mHeight / selectedItem.mSelfHeight);

+ 4 - 26
BeefLibs/corlib/src/System/Attribute.bf

@@ -277,38 +277,16 @@ namespace System
 		public bool Profile;
 	}
 
-	namespace Runtime.InteropServices
+	public struct ImportAttribute : Attribute
 	{
-		public enum CallingConvention
+	    public this(String libName)
 		{
-		    Winapi          = 1,
-		    Cdecl           = 2,
-		    StdCall         = 3,
-		    ThisCall        = 4,
-		    FastCall        = 5,
-
-			Default = Cdecl
-		}
-	
-		[AttributeUsage(AttributeTargets.Method /*3*/)]
-	    public struct DllImportAttribute : Attribute
-	    {
-	        public this(String dllName)
-			{
-				CallingConvention = .Default;
-				CLink = false;
-			}
-
-			public CallingConvention CallingConvention;
-			public bool CLink;
 		}
 	}
 
-	public struct ImportAttribute : Attribute
+	public struct ExportAttribute : Attribute
 	{
-	    public this(String libName)
-		{
-		}
+	    
 	}
 
 	[AttributeUsage(AttributeTargets.StaticField | AttributeTargets.Field, .NotInherited)]

+ 15 - 1
BeefLibs/corlib/src/System/Collections/Generic/Dictionary.bf

@@ -261,7 +261,7 @@ namespace System.Collections.Generic
 			return -1;
 		}
 
-		private int FindEntryAlt<TOther>(TOther key) where TOther : IOpEquals<TKey>, IHashable
+		private int FindEntryWith<TAltKey>(TAltKey key) where TAltKey : IOpEquals<TKey>, IHashable
 		{
 			if (mBuckets != null)
 			{
@@ -545,6 +545,20 @@ namespace System.Collections.Generic
 			return false;
 		}
 
+		public bool TryGetWith<TAltKey>(TAltKey key, out TKey matchKey, out TValue value) where TAltKey : IOpEquals<TKey>, IHashable
+		{
+			int_cosize i = (int_cosize)FindEntryWith(key);
+			if (i >= 0)
+			{
+				matchKey = mEntries[i].mKey;
+				value = mEntries[i].mValue;
+				return true;
+			}
+			matchKey = default(TKey);
+			value = default(TValue);
+			return false;
+		}
+
 		public TValue GetValueOrDefault(TKey key)
 		{
 			int_cosize i = (int_cosize)FindEntry(key);

+ 0 - 1
BeefLibs/corlib/src/System/Collections/IEnumerator.bf

@@ -1,5 +1,4 @@
 using System;
-using System.Runtime.InteropServices;
 
 namespace System.Collections.Generic
 {

+ 0 - 1
BeefLibs/corlib/src/System/DateTimeOffset.bf

@@ -8,7 +8,6 @@ namespace System {
     using System;
     using System.Threading;
     using System.Globalization;
-    using System.Runtime.InteropServices;
     using System.Runtime.CompilerServices;
     using System.Diagnostics.Contracts;
 

+ 0 - 1
BeefLibs/corlib/src/System/Double.bf

@@ -6,7 +6,6 @@ namespace System
 {
     using System;
     using System.Globalization;
-    using System.Runtime.InteropServices;
     using System.Runtime.CompilerServices;
     using System.Diagnostics.Contracts;
 	using System.Diagnostics;

+ 0 - 1
BeefLibs/corlib/src/System/Globalization/CalendarData.bf

@@ -6,7 +6,6 @@ namespace System.Globalization
 {
 
     using System;
-    using System.Runtime.InteropServices;    
     using System.Runtime.CompilerServices;
     using System.Diagnostics.Contracts;
 	using System.Diagnostics;

+ 0 - 1
BeefLibs/corlib/src/System/Globalization/DateTimeFormat.bf

@@ -8,7 +8,6 @@ namespace System {
     using System.Globalization;
     using System.Collections.Generic;
     using System.Runtime.CompilerServices;
-    using System.Runtime.InteropServices;
     using System.Security;
     using System.Diagnostics.Contracts;
 

+ 0 - 1
BeefLibs/corlib/src/System/IO/FileOptions.bf

@@ -3,7 +3,6 @@
 // The original source was submitted to https://github.com/Microsoft/referencesource
 
 using System;
-using System.Runtime.InteropServices;
 
 namespace System.IO
 {

+ 0 - 1
BeefLibs/corlib/src/System/Native.bf

@@ -1,5 +1,4 @@
 using System.IO;
-using System.Runtime.InteropServices;
 
 namespace System
 {

+ 0 - 1
BeefLibs/corlib/src/System/Nullable.bf

@@ -1,7 +1,6 @@
 using System.Reflection;
 using System.Collections.Generic;
 using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 
 namespace System

+ 16 - 4
BeefLibs/corlib/src/System/String.bf

@@ -399,11 +399,11 @@ namespace System
 			}
 		}
 
-		public int GetHashCode()
+		static int GetHashCode(char8* ptr, int length)
 		{
-			int charsLeft = mLength;
+			int charsLeft = length;
 			int hash = 0;
-			char8* curPtr = Ptr;
+			char8* curPtr = ptr;
 			let intSize = sizeof(int);
 			while (charsLeft >= intSize)
 			{
@@ -422,6 +422,11 @@ namespace System
 			return hash;
 		}
 
+		public int GetHashCode()
+		{
+			return GetHashCode(Ptr, mLength);
+		}
+
 		public override void ToString(String strBuffer)
 		{
 			strBuffer.Append(this);
@@ -2495,7 +2500,7 @@ namespace System
 		}
 	}
 
-	public struct StringView : Span<char8>, IFormattable, IPrintable
+	public struct StringView : Span<char8>, IFormattable, IPrintable, IOpEquals<String>, IHashable
 	{
 		public this()
 		{
@@ -2579,6 +2584,11 @@ namespace System
 			}
 		}
 
+		public int GetHashCode()
+		{
+			return String.[Friend]GetHashCode(mPtr, mLength);
+		}
+
 		public override void ToString(String strBuffer)
 		{
 			strBuffer.Append(mPtr, mLength);
@@ -2840,11 +2850,13 @@ namespace System
 			return String.UnQuoteString(Ptr, Length, outString);
 		}
 
+		[NoDiscard]
 		public StringView Substring(int pos)
 		{
 			return .(this, pos);
 		}
 
+		[NoDiscard]
 		public StringView Substring(int pos, int length)
 		{
 			return .(this, pos, length);

+ 0 - 1
BeefLibs/corlib/src/System/TimeZoneInfo.bf

@@ -34,7 +34,6 @@ namespace System {
     using System.Globalization;
     using System.IO;
     using System.Runtime.CompilerServices;
-    using System.Runtime.InteropServices;
     using System.Security;
     using System.Text;
     using System.Threading;

+ 3 - 2
BeefLibs/corlib/src/System/Windows.bf

@@ -1,7 +1,6 @@
 #if BF_PLATFORM_WINDOWS
 
 using System.IO;
-using System.Runtime.InteropServices;
 using System.Collections.Generic;
 using System.Text;
 
@@ -9,7 +8,6 @@ namespace System
 {
 	class Windows
 	{
-		
 		public struct COM_IUnknown
 		{
 			public enum ClsContext : uint32
@@ -1245,6 +1243,9 @@ namespace System
 		public static extern IntBool GetFileMUIPath(uint32 dwFlags, char16* pcwszFilePath, char16* pwszLanguage, uint32* pcchLanguage,
 			char16* pwszFileMUIPath, uint32* pcchFileMUIPath, uint64* pululEnumerator);
 
+		[CLink, StdCall]
+		public static extern HInstance LoadLibraryW(char16* libFileName);
+
 		[CLink, StdCall]
 		public static extern HInstance LoadLibraryExW(char16* libFileName, HModule hFile, uint32 dwFlags);
 

+ 424 - 4
BeefRT/BeefDbg/BeefDbg.vcxproj

@@ -1,6 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug Static CStatic|Win32">
+      <Configuration>Debug Static CStatic</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug Static CStatic|x64">
+      <Configuration>Debug Static CStatic</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug Static|Win32">
+      <Configuration>Debug Static</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug Static|x64">
+      <Configuration>Debug Static</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
       <Platform>Win32</Platform>
@@ -9,6 +25,22 @@
       <Configuration>Debug</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release Static CStatic|Win32">
+      <Configuration>Release Static CStatic</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release Static CStatic|x64">
+      <Configuration>Release Static CStatic</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release Static|Win32">
+      <Configuration>Release Static</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release Static|x64">
+      <Configuration>Release Static</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
@@ -31,12 +63,36 @@
     <PlatformToolset>v141</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <PlatformToolset>v141</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
@@ -44,6 +100,20 @@
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
@@ -51,6 +121,20 @@
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
   <ItemGroup>
     <ClCompile Include="..\..\BeefySysLib\Common.cpp" />
     <ClCompile Include="..\..\BeefySysLib\platform\win\CrashCatcher.cpp" />
@@ -66,55 +150,119 @@
     <ClCompile Include="..\gperftools\src\base\sysinfo.cc" />
     <ClCompile Include="..\gperftools\src\central_freelist.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\heap-profile-table.cc">
     </ClCompile>
     <ClCompile Include="..\gperftools\src\page_heap.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\sampler.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\span.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\static_vars.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\symbolize.cc">
     </ClCompile>
     <ClCompile Include="..\gperftools\src\tcmalloc.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\tc_common.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\thread_cache.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\unity_tcmalloc_obj.cc" />
     <ClCompile Include="..\gperftools\src\unity_tcmalloc_raw.cc" />
@@ -124,9 +272,17 @@
     </ClCompile>
     <ClCompile Include="..\gperftools\src\internal_logging.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\base\logging.cc">
     </ClCompile>
@@ -135,12 +291,28 @@
     <ClCompile Include="..\gperftools\src\malloc_extension.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
       </ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">
+      </ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
+      </ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
       </ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">
+      </ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
+      </ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
       </ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">
+      </ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
+      </ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
       </ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">
+      </ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
+      </ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\malloc_hook.cc">
     </ClCompile>
@@ -160,9 +332,17 @@
     </ClCompile>
     <ClCompile Include="..\gperftools\src\stack_trace_table.cc">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\gperftools\src\base\spinlock.cc">
     </ClCompile>
@@ -240,45 +420,152 @@
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
     <Import Project="..\BeefRT.props" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\BeefRT.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\BeefRT.props" />
+  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
     <Import Project="..\BeefRT.props" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\BeefRT.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\BeefRT.props" />
+  </ImportGroup>
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
     <Import Project="..\BeefRT.props" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\BeefRT.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\BeefRT.props" />
+  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
     <Import Project="..\BeefRT.props" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\BeefRT.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\BeefRT.props" />
+  </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <TargetName>Beef$(BeefFilesVersion)Dbg64_d</TargetName>
     <OutDir>$(SolutionDir)\ide\dist\</OutDir>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">
+    <TargetName>Beef$(BeefFilesVersion)Dbg64_ssd</TargetName>
+    <OutDir>$(SolutionDir)\ide\dist\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
+    <TargetName>Beef$(BeefFilesVersion)Dbg64_sd</TargetName>
+    <OutDir>$(SolutionDir)\ide\dist\</OutDir>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <TargetName>Beef$(BeefFilesVersion)Dbg64</TargetName>
     <OutDir>$(SolutionDir)\ide\dist\</OutDir>
     <LinkIncremental>false</LinkIncremental>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">
+    <TargetName>Beef$(BeefFilesVersion)Dbg64_ss</TargetName>
+    <OutDir>$(SolutionDir)\ide\dist\</OutDir>
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
+    <TargetName>Beef$(BeefFilesVersion)Dbg64_s</TargetName>
+    <OutDir>$(SolutionDir)\ide\dist\</OutDir>
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <OutDir>$(SolutionDir)\ide\dist\</OutDir>
     <TargetName>Beef$(BeefFilesVersion)Dbg32_d</TargetName>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">
+    <OutDir>$(SolutionDir)\ide\dist\</OutDir>
+    <TargetName>Beef$(BeefFilesVersion)Dbg32_ssd</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
+    <OutDir>$(SolutionDir)\ide\dist\</OutDir>
+    <TargetName>Beef$(BeefFilesVersion)Dbg32_sd</TargetName>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <OutDir>$(SolutionDir)\ide\dist\</OutDir>
     <TargetName>Beef$(BeefFilesVersion)Dbg32</TargetName>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">
+    <OutDir>$(SolutionDir)\ide\dist\</OutDir>
+    <TargetName>Beef$(BeefFilesVersion)Dbg32_ss</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
+    <OutDir>$(SolutionDir)\ide\dist\</OutDir>
+    <TargetName>Beef$(BeefFilesVersion)Dbg32_s</TargetName>
+  </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <PrecompiledHeader>
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
+      <BaseAddress>0x00DB0000</BaseAddress>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <FixedBaseAddress>
+      </FixedBaseAddress>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
+      <BaseAddress>0x00DB0000</BaseAddress>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <FixedBaseAddress>
+      </FixedBaseAddress>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -295,7 +582,31 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>
+      </DisableSpecificWarnings>
+      <SupportJustMyCode>false</SupportJustMyCode>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
+      <OutputFile>$(SolutionDir)\ide\dist\$(TargetName).dll</OutputFile>
+      <ImportLibrary>$(SolutionDir)\ide\dist\$(TargetName).lib</ImportLibrary>
+      <FixedBaseAddress>false</FixedBaseAddress>
+      <RandomizedBaseAddress>true</RandomizedBaseAddress>
+      <BaseAddress>
+      </BaseAddress>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static CStatic|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
       <DisableSpecificWarnings>
       </DisableSpecificWarnings>
@@ -313,6 +624,30 @@
       </BaseAddress>
     </Link>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>
+      </DisableSpecificWarnings>
+      <SupportJustMyCode>false</SupportJustMyCode>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
+      <OutputFile>$(SolutionDir)\ide\dist\$(TargetName).dll</OutputFile>
+      <ImportLibrary>$(SolutionDir)\ide\dist\$(TargetName).lib</ImportLibrary>
+      <FixedBaseAddress>false</FixedBaseAddress>
+      <RandomizedBaseAddress>true</RandomizedBaseAddress>
+      <BaseAddress>
+      </BaseAddress>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
@@ -321,9 +656,50 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -340,7 +716,29 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;BFRT_DYNAMIC;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <OutputFile>$(SolutionDir)\ide\dist\$(TargetName).dll</OutputFile>
+      <ImportLibrary>$(SolutionDir)\ide\dist\$(TargetName).lib</ImportLibrary>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static CStatic|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -354,6 +752,28 @@
       <ImportLibrary>$(SolutionDir)\ide\dist\$(TargetName).lib</ImportLibrary>
     </Link>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>BFRTDBG;BP_DISABLED;BF_NO_BFAPP;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>.;../;../..;../../BeefySysLib/third_party;../../BeefySysLib;../../BeefySysLib/platform/win;../gperftools/src;../gperftools/src/windows</AdditionalIncludeDirectories>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <OutputFile>$(SolutionDir)\ide\dist\$(TargetName).dll</OutputFile>
+      <ImportLibrary>$(SolutionDir)\ide\dist\$(TargetName).lib</ImportLibrary>
+    </Link>
+  </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>

+ 4 - 1
BeefRT/BeefRT.vcxproj

@@ -478,6 +478,7 @@
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <SupportJustMyCode>false</SupportJustMyCode>
       <BufferSecurityCheck>false</BufferSecurityCheck>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -497,6 +498,7 @@
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <SupportJustMyCode>false</SupportJustMyCode>
       <BufferSecurityCheck>false</BufferSecurityCheck>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -516,6 +518,7 @@
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
       <SupportJustMyCode>false</SupportJustMyCode>
       <BufferSecurityCheck>false</BufferSecurityCheck>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -534,7 +537,7 @@
       <DisableSpecificWarnings>
       </DisableSpecificWarnings>
       <SupportJustMyCode>false</SupportJustMyCode>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
       <LanguageStandard>stdcpp17</LanguageStandard>
       <BufferSecurityCheck>false</BufferSecurityCheck>
     </ClCompile>

+ 29 - 34
BeefRT/dbg/DbgInternal.cpp

@@ -2,23 +2,15 @@
 #define HEAPHOOK
 
 #include <stdio.h>
-
-//#include <crtdefs.h>
 #include <malloc.h>
 #include <stdlib.h>
 #include <string.h>
-//#include <intrin.h>
 
 //#define OBJECT_GUARD_END_SIZE 8
 #define OBJECT_GUARD_END_SIZE 0
 
 //#define BF_USE_STOMP_ALLOC 1
 
-//extern "C"
-//{
-//#include "gperftools/stacktrace.h"
-//}
-
 #ifdef _MSC_VER
 #include <intrin.h>
 #pragma intrinsic(_ReturnAddress) 
@@ -36,8 +28,8 @@
 USING_NS_BF;
 
 #ifdef BF_PLATFORM_WINDOWS
-bf::System::Runtime::BfRtCallbacks gBfRtCallbacks;
-BfRtFlags gBfRtFlags = (BfRtFlags)0;
+bf::System::Runtime::BfRtCallbacks gBfRtDbgCallbacks;
+BfRtFlags gBfRtDbgFlags = (BfRtFlags)0;
 #endif
 
 namespace bf
@@ -47,8 +39,6 @@ namespace bf
 		class Object;
 		class Exception;
 
-		//System::Threading::Thread* gMainThread;		
-
 		class Internal
 		{		
 		public:						
@@ -169,7 +159,7 @@ Beefy::StringT<0> gDbgErrorString;
 extern DbgRawAllocData sEmptyAllocData;
 extern DbgRawAllocData sObjectAllocData;
 
-#define SETUP_ERROR(str, skip) gDbgErrorString = str; gBfRtCallbacks.DebugMessageData_SetupError(str, skip)
+#define SETUP_ERROR(str, skip) gDbgErrorString = str; gBfRtDbgCallbacks.DebugMessageData_SetupError(str, skip)
 
 #ifdef BF_PLATFORM_WINDOWS
 #define BF_CAPTURE_STACK(skipCount, outFrames, wantCount) (int)RtlCaptureStackBackTrace(skipCount, wantCount, (void**)outFrames, NULL)
@@ -198,10 +188,15 @@ void bf::System::Runtime::Dbg_Init(int version, int flags, BfRtCallbacks* callba
 		BfpSystem_FatalError(StrFormat("BeefDbg build version '%d' does not match requested version '%d'", BFRT_VERSION, version).c_str(), "BEEF FATAL ERROR");
 	}
 
-	gBfRtCallbacks = *callbacks;
-	gBfRtFlags = (BfRtFlags)flags;
+	if (gBfRtDbgCallbacks.Alloc != NULL)
+	{
+		BfpSystem_FatalError(StrFormat("BeefDbg already initialized. Multiple executable modules in the same process cannot dynamically link to the Beef debug runtime.").c_str(), "BEEF FATAL ERROR");
+	}
+
+	gBfRtDbgCallbacks = *callbacks;
+	gBfRtDbgFlags = (BfRtFlags)flags;
 #ifdef BF_GC_SUPPORTED	
-	gGCDbgData.mDbgFlags = gBfRtFlags;
+	gGCDbgData.mDbgFlags = gBfRtDbgFlags;
 #endif
 }
 
@@ -215,8 +210,8 @@ void* bf::System::Runtime::Dbg_GetCrashInfoFunc()
 
 void Internal::Dbg_MarkObjectDeleted(bf::System::Object* object)
 {
-	BF_ASSERT((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
-	if ((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0)
+	BF_ASSERT((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
+	if ((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0)
 		object->mObjectFlags = (BfObjectFlags)((object->mObjectFlags & ~BfObjectFlag_StackAlloc) | BfObjectFlag_Deleted);
 #ifdef BF_GC_SUPPORTED
 	gBFGC.ObjectDeleteRequested(object);
@@ -293,10 +288,10 @@ intptr Internal::Dbg_PrepareStackTrace(intptr baseAllocSize, intptr maxStackTrac
 
 bf::System::Object* Internal::Dbg_ObjectAlloc(bf::System::Reflection::TypeInstance* typeInst, intptr size)
 {	
-	BF_ASSERT((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
+	BF_ASSERT((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
 	Object* result;	
 	int allocSize = BF_ALIGN(size, typeInst->mInstAlign);
-	uint8* allocBytes = (uint8*)BfObjectAllocate(allocSize, typeInst->GetType());
+	uint8* allocBytes = (uint8*)BfObjectAllocate(allocSize, typeInst->_GetType());
 // 	int dataOffset = (int)(sizeof(intptr) * 2);
 // 	memset(allocBytes + dataOffset, 0, size - dataOffset);
 	result = (bf::System::Object*)allocBytes;
@@ -322,7 +317,7 @@ bf::System::Object* Internal::Dbg_ObjectAlloc(bf::System::ClassVData* classVData
 	intptr allocSize = size;
 	bool largeAllocInfo = false;
 
-	if ((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0)
+	if ((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0)
 	{
 		if (maxStackTraceDepth > 1)
 		{
@@ -343,7 +338,7 @@ bf::System::Object* Internal::Dbg_ObjectAlloc(bf::System::ClassVData* classVData
 #endif
 
 	bf::System::Object* result;
-	if ((gBfRtFlags & BfRtFlags_LeakCheck) != 0)
+	if ((gBfRtDbgFlags & BfRtFlags_LeakCheck) != 0)
 	{
 		allocSize = BF_ALIGN(allocSize, align);
 		uint8* allocBytes = (uint8*)BfObjectAllocate(allocSize, classVData->mType);
@@ -362,21 +357,21 @@ bf::System::Object* Internal::Dbg_ObjectAlloc(bf::System::ClassVData* classVData
 		sAllocSizes[classVData->mType->mTypeId] += size;
 		result = (bf::System::Object*)(allocPtr + 16);
 #else
-		if ((gBfRtFlags & BfRtFlags_DebugAlloc) != 0)
+		if ((gBfRtDbgFlags & BfRtFlags_DebugAlloc) != 0)
 		{			
 			uint8* allocBytes = (uint8*)BfRawAllocate(allocSize, &sObjectAllocData, NULL, 0);
 			result = (bf::System::Object*)allocBytes;
 		}
 		else
 		{
-			uint8* allocBytes = (uint8*)gBfRtCallbacks.Alloc(allocSize);
+			uint8* allocBytes = (uint8*)gBfRtDbgCallbacks.Alloc(allocSize);
 			result = (bf::System::Object*)allocBytes;
 		}		
 #endif
 	}
 
 #ifndef BFRT_NODBGFLAGS
-	if ((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0)
+	if ((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0)
 	{
 		// The order is very important here-
 		//  Once we set mDbgAllocInfo, the memory will be recognized by the GC as being a valid object.
@@ -429,7 +424,7 @@ bf::System::Object* Internal::Dbg_ObjectAlloc(bf::System::ClassVData* classVData
 
 void Internal::Dbg_ObjectStackInit(bf::System::Object* result, bf::System::ClassVData* classVData)
 {
-	BF_ASSERT((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
+	BF_ASSERT((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
 
 	result->mClassVData = (intptr)classVData | (intptr)BfObjectFlag_StackAlloc;
 #ifndef BFRT_NODBGFLAGS
@@ -468,7 +463,7 @@ static void SetupDbgAllocInfo(bf::System::Object* result, intptr origSize)
 
 void Internal::Dbg_ObjectCreated(bf::System::Object* result, intptr size, bf::System::ClassVData* classVData)
 {
-	BF_ASSERT((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
+	BF_ASSERT((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
 #ifndef BFRT_NODBGFLAGS	
 	BF_ASSERT_REL((result->mClassVData & ~(BfObjectFlag_Allocated | BfObjectFlag_Mark3)) == (intptr)classVData);
 	result->mDbgAllocInfo = (intptr)BF_RETURN_ADDRESS;
@@ -477,7 +472,7 @@ void Internal::Dbg_ObjectCreated(bf::System::Object* result, intptr size, bf::Sy
 
 void Internal::Dbg_ObjectCreatedEx(bf::System::Object* result, intptr origSize, bf::System::ClassVData* classVData)
 {
-	BF_ASSERT((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
+	BF_ASSERT((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
 #ifndef BFRT_NODBGFLAGS	
 	BF_ASSERT_REL((result->mClassVData & ~(BfObjectFlag_Allocated | BfObjectFlag_Mark3)) == (intptr)classVData);
 	SetupDbgAllocInfo(result, origSize);
@@ -486,7 +481,7 @@ void Internal::Dbg_ObjectCreatedEx(bf::System::Object* result, intptr origSize,
 
 void Internal::Dbg_ObjectAllocated(bf::System::Object* result, intptr size, bf::System::ClassVData* classVData)
 {
-	BF_ASSERT((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
+	BF_ASSERT((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
 	result->mClassVData = (intptr)classVData;
 #ifndef BFRT_NODBGFLAGS	
 	result->mDbgAllocInfo = (intptr)BF_RETURN_ADDRESS;	
@@ -495,14 +490,14 @@ void Internal::Dbg_ObjectAllocated(bf::System::Object* result, intptr size, bf::
 
 void Internal::Dbg_ObjectAllocatedEx(bf::System::Object* result, intptr origSize, bf::System::ClassVData* classVData)
 {
-	BF_ASSERT((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
+	BF_ASSERT((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
 	result->mClassVData = (intptr)classVData;
 	SetupDbgAllocInfo(result, origSize);
 }
 
 void Internal::Dbg_ObjectPreDelete(bf::System::Object* object)
 {
-	BF_ASSERT((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
+	BF_ASSERT((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
 
 #ifndef BFRT_NODBGFLAGS
 	const char* errorPtr = NULL;
@@ -539,7 +534,7 @@ void Internal::Dbg_ObjectPreDelete(bf::System::Object* object)
 		errorStr += StrFormat("   (%s)0x%@\n", typeName.c_str(), object);
 		SETUP_ERROR(errorStr.c_str(), 2);
 		BF_DEBUG_BREAK();
-		gBfRtCallbacks.DebugMessageData_Fatal();
+		gBfRtDbgCallbacks.DebugMessageData_Fatal();
 		return;
 	}
 #endif
@@ -547,7 +542,7 @@ void Internal::Dbg_ObjectPreDelete(bf::System::Object* object)
 
 void Internal::Dbg_ObjectPreCustomDelete(bf::System::Object* object)
 {
-	BF_ASSERT((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
+	BF_ASSERT((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0);
 
 	const char* errorPtr = NULL;
 
@@ -566,7 +561,7 @@ void Internal::Dbg_ObjectPreCustomDelete(bf::System::Object* object)
 		errorStr += StrFormat("   (%s)0x%@\n", typeName.c_str(), object);
 		SETUP_ERROR(errorStr.c_str(), 2);
 		BF_DEBUG_BREAK();
-		gBfRtCallbacks.DebugMessageData_Fatal();
+		gBfRtDbgCallbacks.DebugMessageData_Fatal();
 		return;
 	}
 }

+ 12 - 12
BeefRT/dbg/gc.cpp

@@ -34,7 +34,7 @@
 #include "gc.h"
 
 #ifdef BF_GC_SUPPORTED
- 
+
 #include <fstream>
 #include "BeefySysLib/Common.h"
 #include "BeefySysLib/BFApp.h"
@@ -180,12 +180,12 @@ void BFGC::MarkMembers(bf::System::Object* obj)
 	if (((obj->mObjectFlags & BF_OBJECTFLAG_DELETED) != 0) && (!mMarkingDeleted))
 	{
 		mMarkingDeleted = true;
-		gBfRtCallbacks.Object_GCMarkMembers(obj);
+		gBfRtDbgCallbacks.Object_GCMarkMembers(obj);
 		mMarkingDeleted = false;
 	}
 	else
 	{
-		gBfRtCallbacks.Object_GCMarkMembers(obj);
+		gBfRtDbgCallbacks.Object_GCMarkMembers(obj);
 	}
 }
 
@@ -636,7 +636,7 @@ BFGC::BFGC()
 
 	mGCThread = NULL;	
 
-	gGCDbgData.mDbgFlags = gBfRtFlags;
+	gGCDbgData.mDbgFlags = gBfRtDbgFlags;
 	ThreadCache::InitTSD();
 	if (UNLIKELY(Static::pageheap() == NULL)) ThreadCache::InitModule();	
 	gGCDbgData.mObjRootPtr = Static::pageheap()->pagemap_.root_;
@@ -767,7 +767,7 @@ void BFCheckObjectSize(bf::System::Object* obj, int size)
 
 void BFGC::ConservativeScan(void* startAddr, int length)
 {
-	if ((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) == 0)
+	if ((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) == 0)
 		return;
 
     BFLOG2(GCLog::EVENT_CONSERVATIVE_SCAN, (intptr)startAddr, (intptr)startAddr + length);
@@ -877,7 +877,7 @@ bool BFGC::HandlePendingGCData()
 
 void BFGC::SweepSpan(tcmalloc_obj::Span* span, int expectedStartPage)
 {
-	if ((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) == 0)
+	if ((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) == 0)
 		return;
 
 	if (span->location != tcmalloc_obj::Span::IN_USE)
@@ -980,7 +980,7 @@ void BFGC::SweepSpan(tcmalloc_obj::Span* span, int expectedStartPage)
 								mSweepInfo.mLeakObjects.push_back(obj);
 							}
 
-							BFLOG2(GCLog::EVENT_LEAK, (intptr)obj, (intptr)obj->GetType());
+							BFLOG2(GCLog::EVENT_LEAK, (intptr)obj, (intptr)obj->_GetType());
 #ifdef BF_GC_LOG_ENABLED
 							gGCLog.Write();
 #endif
@@ -1160,8 +1160,8 @@ void BFGC::ProcessSweepInfo()
 		//TODO: Testing!
 		//OutputDebugStrF(gDbgErrorString.c_str());	
 
-		gBfRtCallbacks.SetErrorString(gDbgErrorString.c_str());
-		gBfRtCallbacks.DebugMessageData_SetupError(errorStr.c_str(), 1);
+		gBfRtDbgCallbacks.SetErrorString(gDbgErrorString.c_str());
+		gBfRtDbgCallbacks.DebugMessageData_SetupError(errorStr.c_str(), 1);
 		BF_DEBUG_BREAK();		
 	}
 
@@ -1614,7 +1614,7 @@ void BFGC::FinishCollect()
 {
 	//OutputDebugStrF("Collected %d objects\n", mFinalizeList.size());
 
-	if ((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) == 0)
+	if ((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) == 0)
 		return;
 
 	mLastFreeCount = 0;
@@ -1711,7 +1711,7 @@ void BFGC::FinishCollect()
 			{
 				// Temporarily remove object flags so GetType() won't fail
 				obj->mObjectFlags = BfObjectFlag_None;
-				bf::System::Type* type = obj->GetType();
+				bf::System::Type* type = obj->_GetType();
 				//auto pairVal = sizeMap.insert(std::make_pair(type, 0));
 				//int newSize = pairVal.first->second + objSize;
 				int* sizePtr = NULL;
@@ -2046,7 +2046,7 @@ void BFGC::ObjReportHandleSpan(tcmalloc_obj::Span* span, int expectedStartPage,
 			int objectFlags = obj->mObjectFlags;
 			if ((objectFlags & BF_OBJECTFLAG_DELETED) == 0)
 			{
-				bf::System::Type* type = obj->GetType();
+				bf::System::Type* type = obj->_GetType();
 				//auto pairVal = sizeMap.insert(std::make_pair(type, 0));
 				//int newSize = pairVal.first->second + elementSize;				
 				//pairVal.first->second = newSize;

+ 3 - 11
BeefRT/dbg/gc.h

@@ -436,15 +436,7 @@ namespace bf
 		{
 		private:
 			BFRT_EXPORT static void Init();
-			BFRT_EXPORT static void Run();
-			static void MarkAllStaticMembers()
-			{
-				gBfRtCallbacks.GC_MarkAllStaticMembers();
-			}
-			static bool CallRootCallbacks()
-			{
-				return gBfRtCallbacks.GC_CallRootCallbacks();
-			}
+			BFRT_EXPORT static void Run();						
 			BFRT_EXPORT static void ReportTLSMember(intptr tlsIndex, void* ptr, void* markFunc);
 			BFRT_EXPORT static void StopCollecting();
 			BFRT_EXPORT static void AddStackMarkableObject(Object* obj);
@@ -460,11 +452,11 @@ namespace bf
 			//static void ToLeakString(Object* obj, String* strBuffer);
 			static void DoMarkAllStaticMembers()
 			{
-				MarkAllStaticMembers();
+				BFRTCALLBACKS.GC_MarkAllStaticMembers();
 			}
 			static bool DoCallRootCallbacks()
 			{
-				return CallRootCallbacks();
+				return BFRTCALLBACKS.GC_CallRootCallbacks();
 			}
 			BFRT_EXPORT static void SetAutoCollectPeriod(intptr periodMS);
 			BFRT_EXPORT static void SetCollectFreeThreshold(intptr freeBytes);

+ 4 - 5
BeefRT/dbg/gc_raw.cpp

@@ -1,4 +1,3 @@
-
 #define _WIN32_WINNT _WIN32_WINNT_WIN8
 
 // This spits out interesting stats periodically to the console
@@ -74,7 +73,7 @@ void BFGC::RawInit()
 
 void BFGC::RawMarkSpan(tcmalloc_raw::Span* span, int expectedStartPage)
 {
-	if ((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) == 0)
+	if ((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) == 0)
 		return;
 
 	if (span->location != tcmalloc_raw::Span::IN_USE)
@@ -278,7 +277,7 @@ void BFGC::RawReportHandleSpan(tcmalloc_raw::Span* span, int expectedStartPage,
 				if (rawAllocData->mType != NULL)
 				{
 					int typeSize;
-					if ((gBfRtFlags & BfRtFlags_ObjectHasDebugFlags) != 0)
+					if ((gBfRtDbgFlags & BfRtFlags_ObjectHasDebugFlags) != 0)
 						typeSize = rawAllocData->mType->mSize;
 					else
 						typeSize = ((bf::System::Type_NOFLAGS*)rawAllocData->mType)->mSize;
@@ -449,8 +448,8 @@ void BFGC::RawShutdown()
 
 		BF_ASSERT(mSweepInfo.mLeakCount > 0);
 
-		gBfRtCallbacks.SetErrorString(gDbgErrorString.c_str());
-		gBfRtCallbacks.DebugMessageData_SetupError(errorStr.c_str(), 0);
+		gBfRtDbgCallbacks.SetErrorString(gDbgErrorString.c_str());
+		gBfRtDbgCallbacks.DebugMessageData_SetupError(errorStr.c_str(), 0);
 		BF_DEBUG_BREAK();
 	}
 	else

+ 13 - 5
BeefRT/rt/BfObjects.h

@@ -121,8 +121,16 @@ namespace bf
 	}
 }
 
-extern bf::System::Runtime::BfRtCallbacks gBfRtCallbacks;
-extern BfRtFlags gBfRtFlags;
+#ifdef BFRTDBG
+#define BFRTCALLBACKS gBfRtDbgCallbacks
+#define BFRTFLAGS gBfRtDbgFlags
+#else
+#define BFRTCALLBACKS gBfRtCallbacks
+#define BFRTFLAGS gBfRtFlags
+#endif
+
+extern bf::System::Runtime::BfRtCallbacks BFRTCALLBACKS;
+extern BfRtFlags BFRTFLAGS;
 
 namespace bf
 {
@@ -155,9 +163,9 @@ namespace bf
 			};
 #endif
 
-			Type* GetType()
+			Type* _GetType()
 			{
-				return gBfRtCallbacks.Object_GetType(this);
+				return BFRTCALLBACKS.Object_GetType(this);
 			}
 
 			Type* GetTypeSafe()
@@ -275,7 +283,7 @@ namespace bf
 
 			const char* CStr()
 			{
-				return gBfRtCallbacks.String_ToCStr(this);
+				return BFRTCALLBACKS.String_ToCStr(this);
 			}
 		};
 	}

+ 5 - 0
BeefRT/rt/Internal.cpp

@@ -261,6 +261,11 @@ void bf::System::Runtime::Init(int version, int flags, BfRtCallbacks* callbacks)
 	BfpSystem_Init(BFP_VERSION, sysInitFlags);
 	BfpSystem_AddCrashInfoFunc(GetCrashInfo);
 
+	if (gBfRtCallbacks.Alloc != NULL)
+	{
+		BfpSystem_FatalError(StrFormat("BeefRT already initialized. Multiple executable modules in the same process cannot dynamically link to the Beef runtime.").c_str(), "BEEF FATAL ERROR");
+	}
+
 	if (version != BFRT_VERSION)
 	{
         BfpSystem_FatalError(StrFormat("BeefRT build version '%d' does not match requested version '%d'", BFRT_VERSION, version).c_str(), "BEEF FATAL ERROR");        

+ 7 - 7
BeefRT/rt/Object.cpp

@@ -4,19 +4,19 @@ USING_NS_BF;
 
 Beefy::String bf::System::Object::GetTypeName()
 {
-	String* strObj = gBfRtCallbacks.String_Alloc();
-	Type* type = GetType();
-	gBfRtCallbacks.Type_GetFullName(type, strObj);
+	String* strObj = BFRTCALLBACKS.String_Alloc();
+	Type* type = _GetType();
+	BFRTCALLBACKS.Type_GetFullName(type, strObj);
 	Beefy::String str = strObj->CStr();
-	gBfRtCallbacks.Object_Delete(strObj);
+	BFRTCALLBACKS.Object_Delete(strObj);
 	return str;
 }
 
 Beefy::String bf::System::Type::GetFullName()
 {
-	String* strObj = gBfRtCallbacks.String_Alloc();
-	gBfRtCallbacks.Type_GetFullName(this, strObj);
+	String* strObj = BFRTCALLBACKS.String_Alloc();
+	BFRTCALLBACKS.Type_GetFullName(this, strObj);
 	Beefy::String str = strObj->CStr();
-	gBfRtCallbacks.Object_Delete(strObj);
+	BFRTCALLBACKS.Object_Delete(strObj);
 	return str;
 }

+ 5 - 5
BeefRT/rt/Thread.h

@@ -70,27 +70,27 @@ namespace bf
 
 				static Thread* Alloc()
 				{
-					return gBfRtCallbacks.Thread_Alloc();
+					return BFRTCALLBACKS.Thread_Alloc();
 				}
 
 				BfInternalThread* GetInternalThread()
 				{
-					return gBfRtCallbacks.Thread_GetInternalThread(this);
+					return BFRTCALLBACKS.Thread_GetInternalThread(this);
 				}
 
 				BfDbgInternalThread* Dbg_GetInternalThread()
 				{
-					return (BfDbgInternalThread*)gBfRtCallbacks.Thread_GetInternalThread(this);
+					return (BfDbgInternalThread*)BFRTCALLBACKS.Thread_GetInternalThread(this);
 				}
 
 				void SetInternalThread(BfInternalThread* internalThread)
 				{
-					gBfRtCallbacks.Thread_SetInternalThread(this, internalThread);
+					BFRTCALLBACKS.Thread_SetInternalThread(this, internalThread);
 				}
 
 				int GetMaxStackSize()
 				{
-					return gBfRtCallbacks.Thread_GetMaxStackSize(this);
+					return BFRTCALLBACKS.Thread_GetMaxStackSize(this);
 				}
 			};
 		}

+ 0 - 11
BeefTools/BeefInstall/BeefProj.toml

@@ -1,11 +0,0 @@
-FileVersion = 1
-
-[Project]
-Name = "BeefInstall"
-StartupObject = "BeefInstall.Program"
-
-[ProjectFolder]
-
-[[ProjectFolder.Items]]
-Type = "Source"
-Path = "../../IDE/src/util/Zip.bf"

+ 0 - 6
BeefTools/BeefInstall/BeefSpace.toml

@@ -1,6 +0,0 @@
-FileVersion = 1
-Projects = {BeefInstall = {Path = "."}}
-Unlocked = ["corlib"]
-
-[Workspace]
-StartupProject = "BeefInstall"

+ 0 - 136
BeefTools/BeefInstall/BeefSpace_User.toml

@@ -1,136 +0,0 @@
-FileVersion = 1
-LastConfig = "Debug"
-LastPlatform = "Win64"
-RecentFilesList = ["c:\\Beef\\BeefTools\\BeefInstall\\src\\Program.bf", "c:\\Beef\\IDE\\src\\util\\Zip.bf", "c:\\beef\\BeefLibs\\corlib\\src\\System\\String.bf"]
-
-[MainWindow]
-X = 148
-Y = 85
-Width = 1724
-Height = 1830
-
-[MainDockingFrame]
-Type = "DockingFrame"
-SplitType = 2
-
-[[MainDockingFrame.DockedWidgets]]
-RequestedWidth = 350.0
-RequestedHeight = 200.0
-SizePriority = 200.0
-Type = "DockingFrame"
-SplitType = 1
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets]]
-RequestedWidth = 200.0
-RequestedHeight = 200.0
-Type = "TabbedView"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-Active = true
-TabLabel = "Workspace"
-TabWidth = 115.0
-Type = "ProjectPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets]]
-IsFillWidget = true
-Permanent = true
-RequestedWidth = 150.0
-RequestedHeight = 150.0
-SizePriority = 150.0
-DefaultDocumentsTabbedView = true
-Type = "TabbedView"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "String.bf"
-TabWidth = 89.0
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\BeefLibs\\corlib\\src\\System\\String.bf"
-CursorPos = 41778
-VertPos = 24600.0
-ProjectName = "corlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Zip.bf"
-TabWidth = 63.0
-Type = "SourceViewPanel"
-FilePath = "c:\\Beef\\IDE\\src\\util\\Zip.bf"
-CursorPos = 3000
-VertPos = 540.0
-ProjectName = "BeefInstall"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-Active = true
-TabLabel = "Program.bf"
-TabWidth = 96.0
-Type = "SourceViewPanel"
-FilePath = "c:\\Beef\\BeefTools\\BeefInstall\\src\\Program.bf"
-CursorPos = 1398
-ProjectName = "BeefInstall"
-
-[[MainDockingFrame.DockedWidgets]]
-RequestedWidth = 250.0
-RequestedHeight = 250.0
-Type = "DockingFrame"
-SplitType = 1
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets]]
-RequestedWidth = 250.0
-RequestedHeight = 250.0
-SizePriority = 0.5
-Type = "TabbedView"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Memory"
-TabWidth = 99.0
-Type = "MemoryPanel"
-AutoResize = "Auto_Mul8"
-RequestedWidth = 300.0
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Watch"
-TabWidth = 86.0
-Type = "WatchPanel"
-Columns = [{Width = 200.0}, {Width = 200.0}, {Width = 200.0}]
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-Active = true
-TabLabel = "Auto"
-TabWidth = 77.0
-Type = "AutoWatchPanel"
-Columns = [{Width = 200.0}, {Width = 200.0}, {Width = 200.0}]
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets]]
-RequestedWidth = 250.0
-RequestedHeight = 250.0
-SizePriority = 0.5
-Type = "TabbedView"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Find Results"
-TabWidth = 119.0
-Type = "FindResultsPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Threads"
-TabWidth = 97.0
-Type = "ThreadPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Call Stack"
-TabWidth = 105.0
-Type = "CallStackPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Immediate"
-TabWidth = 111.0
-Type = "ImmediatePanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-Active = true
-TabLabel = "Output"
-TabWidth = 90.0
-Type = "OutputPanel"
-
-[DebuggerDisplayTypes.""]
-IntDisplayType = "Default"
-MmDisplayType = "Default"

+ 25 - 0
BeefTools/BeefInstall/Stub/BeefProj.toml

@@ -0,0 +1,25 @@
+FileVersion = 1
+
+[Project]
+Name = "Stub"
+StartupObject = "BIStub.Program"
+
+[Configs.Debug.Win64]
+TargetDirectory = "$(WorkspaceDir)/../dist"
+TargetName = "$(ProjectName)_d"
+BeefLibType = "Static"
+
+[Configs.Release.Win64]
+TargetDirectory = "$(WorkspaceDir)/../dist"
+
+[Configs.Paranoid.Win64]
+TargetDirectory = "$(WorkspaceDir)/../dist"
+
+[Configs.Test.Win64]
+TargetDirectory = "$(WorkspaceDir)/../dist"
+
+[ProjectFolder]
+
+[[ProjectFolder.Items]]
+Type = "Source"
+Path = "../../../IDE/src/util/Zip.bf"

+ 11 - 0
BeefTools/BeefInstall/Stub/BeefSpace.toml

@@ -0,0 +1,11 @@
+FileVersion = 1
+Projects = {Stub = {Path = "."}}
+Unlocked = ["corlib"]
+
+[Workspace]
+StartupProject = "Stub"
+
+[Configs.Debug.Win64]
+AllocType = "CRT"
+EnableObjectDebugFlags = false
+IntermediateType = "ObjectAndIRCode"

+ 2 - 1
BeefTools/BeefInstall/src/CabFile.bf → BeefTools/BeefInstall/Stub/src/CabFile.bf

@@ -1,6 +1,7 @@
 using System;
 using System.IO;
-namespace BeefInstall
+
+namespace System.Windows
 {
 	class CabFile
 	{

+ 236 - 0
BeefTools/BeefInstall/Stub/src/PEFile.bf

@@ -0,0 +1,236 @@
+using System;
+
+namespace System.Windows
+{
+	class PEFile
+	{
+		public const uint16 PE_MACHINE_X86 = 0x14c;
+		public const uint16 PE_MACHINE_X64 = 0x8664;
+
+		[CRepr]
+		public struct PEHeader
+		{
+			public uint16   e_magic;                     // Magic number
+			public uint16   e_cblp;                      // uint8s on last page of file
+			public uint16   e_cp;                        // Pages in file
+			public uint16   e_crlc;                      // Relocations
+			public uint16   e_cparhdr;                   // Size of header in paragraphs
+			public uint16   e_minalloc;                  // Minimum extra paragraphs needed
+			public uint16   e_maxalloc;                  // Maximum extra paragraphs needed
+			public uint16   e_ss;                        // Initial (relative) SS value
+			public uint16   e_sp;                        // Initial SP value
+			public uint16   e_csum;                      // Checksum
+			public uint16   e_ip;                        // Initial IP value
+			public uint16   e_cs;                        // Initial (relative) CS value
+			public uint16   e_lfarlc;                    // File address of relocation table
+			public uint16   e_ovno;                      // Overlay number
+			public uint16[4]   e_res;                    // Reserved uint16s
+			public uint16   e_oemid;                     // OEM identifier (for e_oeminfo)
+			public uint16   e_oeminfo;                   // OEM information; e_oemid specific
+			public uint16[10]   e_res2;                  // Reserved uint16s
+			public int32   e_lfanew;                    // File address of new exe header
+		};
+
+
+		[CRepr]
+		public struct PEFileHeader
+		{
+			public uint16    mMachine;
+			public uint16    mNumberOfSections;
+			public uint32   mTimeDateStamp;
+			public uint32   mPointerToSymbolTable;
+			public uint32   mNumberOfSymbols;
+			public uint16    mSizeOfOptionalHeader;
+			public uint16    mCharacteristics;
+		};
+
+		[CRepr]
+		public struct PEImportObjectHeader
+		{
+			public uint16    mSig1;
+			public uint16    mSig2;
+			public uint16    mVersion;
+			public uint16    mMachine;
+			public uint32   mTimeDateStamp;
+			public uint32   mDataSize;
+			public uint16    mHint;
+			public uint16    mType;
+		};
+
+		[CRepr]
+		public struct PEDataDirectory
+		{
+			public uint32   mVirtualAddress;
+			public uint32   mSize;
+		};
+
+		[CRepr]
+		public struct PEOptionalHeader32
+		{
+			//
+			// Standard fields.
+			//
+
+			public uint16    mMagic;
+			public uint8    mMajorLinkerVersion;
+			public uint8    mMinorLinkerVersion;
+			public uint32   mSizeOfCode;
+			public uint32   mSizeOfInitializedData;
+			public uint32   mSizeOfUninitializedData;
+			public uint32   mAddressOfEntryPoint;
+			public uint32   mBaseOfCode;
+			public uint32   mBaseOfData;
+
+			//
+			// NT additional fields.
+			//
+
+			public uint32   mImageBase;
+			public uint32   mSectionAlignment;
+			public uint32   mFileAlignment;
+			public uint16    mMajorOperatingSystemVersion;
+			public uint16    mMinorOperatingSystemVersion;
+			public uint16    mMajorImageVersion;
+			public uint16    mMinorImageVersion;
+			public uint16    mMajorSubsystemVersion;
+			public uint16    mMinorSubsystemVersion;
+			public uint32   mReserved1;
+			public uint32   mSizeOfImage;
+			public uint32   mSizeOfHeaders;
+			public uint32   mCheckSum;
+			public uint16    mSubsystem;
+			public uint16    mDllCharacteristics;
+			public uint32   mSizeOfStackReserve;
+			public uint32   mSizeOfStackCommit;
+			public uint32   mSizeOfHeapReserve;
+			public uint32   mSizeOfHeapCommit;
+			public uint32   mLoaderFlags;
+			public uint32   mNumberOfRvaAndSizes;
+			public PEDataDirectory[16] mDataDirectory;
+		};
+
+		[CRepr]
+		public struct PEOptionalHeader64
+		{
+			//
+			// Standard fields.
+			//
+
+			public uint16    mMagic;
+			public uint8    mMajorLinkerVersion;
+			public uint8    mMinorLinkerVersion;
+			public uint32   mSizeOfCode;
+			public uint32   mSizeOfInitializedData;
+			public uint32   mSizeOfUninitializedData;
+			public uint32   mAddressOfEntryPoint;
+			public uint32   mBaseOfCode;
+
+			//
+			// NT additional fields.
+			//
+
+			public uint64	mImageBase;
+			public uint32   mSectionAlignment;
+			public uint32   mFileAlignment;
+			public uint16    mMajorOperatingSystemVersion;
+			public uint16    mMinorOperatingSystemVersion;
+			public uint16    mMajorImageVersion;
+			public uint16    mMinorImageVersion;
+			public uint16    mMajorSubsystemVersion;
+			public uint16    mMinorSubsystemVersion;
+			public uint32   mReserved1;
+			public uint32   mSizeOfImage;
+			public uint32   mSizeOfHeaders;
+			public uint32   mCheckSum;
+			public uint16    mSubsystem;
+			public uint16    mDllCharacteristics;
+			public uint64  mSizeOfStackReserve;
+			public uint64  mSizeOfStackCommit;
+			public uint64  mSizeOfHeapReserve;
+			public uint64  mSizeOfHeapCommit;
+			public uint32   mLoaderFlags;
+			public uint32   mNumberOfRvaAndSizes;
+			public PEDataDirectory[16] mDataDirectory;
+		};
+
+		[CRepr]
+		struct PE_NTHeaders32
+		{
+			uint32 mSignature;
+			PEFileHeader mFileHeader;
+			PEOptionalHeader32 mOptionalHeader;
+		};
+
+		[CRepr]
+		public struct PE_NTHeaders64
+		{
+			public uint32 mSignature;
+			public PEFileHeader mFileHeader;
+			public PEOptionalHeader64 mOptionalHeader;
+		};
+
+		const int IMAGE_SIZEOF_SHORT_NAME              = 8;
+
+		[CRepr]
+		public struct PESectionHeader
+		{
+			public char8[IMAGE_SIZEOF_SHORT_NAME]    mName;	
+			public uint32   mVirtualSize;	
+			public uint32   mVirtualAddress;
+			public uint32   mSizeOfRawData;
+			public uint32   mPointerToRawData;
+			public uint32   mPointerToRelocations;
+			public uint32   mPointerToLineNumbers;
+			public uint16    mNumberOfRelocations;
+			public uint16    mNumberOfLineNumbers;
+			public uint32   mCharacteristics;
+		};
+
+		[CRepr]
+		struct COFFRelocation
+		{
+			uint32 mVirtualAddress;
+			uint32 mSymbolTableIndex;
+			uint16 mType;
+		};
+
+		[CRepr]
+		struct PE_SymInfo
+		{
+			[Union]
+			public struct Name
+			{
+				public char8[8] mName;
+				public int32[2] mNameOfs;
+			}
+
+			public Name mName;
+
+			/*union
+			{
+				char mName[8];
+				int32 mNameOfs[2];
+			};*/
+
+			public int32 mValue;
+			public uint16 mSectionNum;
+			public uint16 mType;
+			public int8 mStorageClass;
+			public int8 mNumOfAuxSymbols;
+		};
+
+		[CRepr]
+		struct PE_SymInfoAux
+		{
+			public uint32 mLength;
+			public uint16 mNumberOfRelocations;
+			public uint16 mNumberOfLinenumbers;
+			public uint32 mCheckSum;
+			public uint16 mNumber;
+			public uint8 mSelection;
+			public char8 mUnused;
+			public char8 mUnused2;
+			public char8 mUnused3;
+		};
+	}
+}

+ 179 - 0
BeefTools/BeefInstall/Stub/src/Program.bf

@@ -0,0 +1,179 @@
+using System;
+using IDE.Util;
+using System.IO;
+using System.Windows;
+
+namespace BIStub
+{
+	class Program
+	{
+		bool mFailed;
+
+		void Fail(StringView str)
+		{
+			if (mFailed)
+				return;
+			mFailed = true;
+			Windows.MessageBoxA(default, scope String..AppendF("ERROR: {}", str), "FATAL ERROR", Windows.MB_ICONHAND);
+		}
+
+		bool HandleCommandLineParam(String key, String value)
+		{
+			return false;
+		}
+
+		void UnhandledCommandLine(String key, String value)
+		{
+
+		}
+
+		void ParseCommandLine(String[] args)
+		{
+			for (var str in args)
+			{
+				int eqPos = str.IndexOf('=');
+				if (eqPos == -1)
+				{
+					if (!HandleCommandLineParam(str, null))
+						UnhandledCommandLine(str, null);
+				}	
+				else
+				{
+					var cmd = scope String(str, 0, eqPos);
+					var param = scope String(str, eqPos + 1);
+					if (!HandleCommandLineParam(cmd, param))
+						UnhandledCommandLine(cmd, param);
+				}
+			}
+		}
+
+		Result<void> ExtractTo(ZipFile zipFile, StringView destDir, StringView subStr)
+		{
+			String fileName = scope .();
+			String destPath = scope .();
+
+			for (int i < zipFile.GetNumFiles())
+			{
+				ZipFile.Entry entry = scope .();
+				if (zipFile.SelectEntry(i, entry) case .Err)
+					continue;
+
+				fileName.Clear();
+				entry.GetFileName(fileName);
+
+				if (!fileName.StartsWith(subStr))
+					continue;
+
+				destPath.Clear();
+				destPath.Append(destDir);
+				destPath.Append('/');
+				destPath.Append(fileName);
+
+				if (entry.IsDirectory)
+				{
+					if (Directory.CreateDirectory(destPath) case .Err)
+						return .Err;
+				}
+				else
+				{
+					if (entry.ExtractToFile(destPath) case .Err)
+						return .Err;
+				}
+			}
+
+			return .Ok;
+		}
+
+		void CheckPE()
+		{
+			let module = Windows.GetModuleHandleW(null);
+			uint8* moduleData = (uint8*)(int)module;
+			PEFile.PEHeader* header = (.)moduleData;
+
+			PEFile.PE_NTHeaders64* hdr64 = (.)(moduleData + header.e_lfanew);
+			if (hdr64.mFileHeader.mMachine == PEFile.PE_MACHINE_X64)
+			{
+				int fileEnd = 0;
+
+				for (int sectIdx < hdr64.mFileHeader.mNumberOfSections)
+				{
+					PEFile.PESectionHeader* sectHdrHead = (.)((uint8*)(hdr64 + 1)) + sectIdx;
+					fileEnd = Math.Max(fileEnd, sectHdrHead.mPointerToRawData + sectHdrHead.mSizeOfRawData);
+				}
+
+
+			}
+		}
+
+		public function void InstallFunc(StringView dest, StringView filter);
+		public function int ProgressFunc();
+		public function void CancelFunc();
+
+		public function void StartFunc(InstallFunc installFunc, ProgressFunc progressFunc, CancelFunc cancelFunc);
+
+		static void UI_Install(StringView dest, StringView filter)
+		{
+
+		}
+
+		static int UI_GetProgress()
+		{
+			return 0;
+		}
+
+		static void UI_Cancel()
+		{
+
+		}
+
+		void StartUI(StringView dir)
+		{
+			String destLib = scope .();
+			destLib.Append(dir);
+			destLib.Append("/../dist/StubUI_d.dll");
+
+			var lib = Windows.LoadLibraryW(destLib.ToScopedNativeWChar!());
+			if (lib.IsInvalid)
+			{
+				Fail(scope String()..AppendF("Failed to load installer UI '{}'", destLib));
+				return;
+			}
+
+			StartFunc startFunc = (.)Windows.GetProcAddress(lib, "Start");
+			if (startFunc == null)
+			{
+				Fail(scope String()..AppendF("Failed to initialize installer UI '{}'", destLib));
+				return;
+			}
+
+			startFunc(=> UI_Install, => UI_GetProgress, => UI_Cancel);
+		}
+
+		void Run()
+		{
+			String cwd = scope .();
+			Directory.GetCurrentDirectory(cwd);
+			StartUI(cwd);
+
+			CheckPE();
+
+			ZipFile zipFile = scope .();
+			zipFile.Open(@"c:\\temp\\build_1827.zip");
+			ExtractTo(zipFile, @"c:\temp\unzip", .());
+
+			CabFile cabFile = scope .();
+			cabFile.Init();
+			cabFile.Copy();
+		}
+
+		static int Main(String[] args)
+		{
+			
+			Program pg = new Program();
+			pg.ParseCommandLine(args);
+			pg.Run();
+			delete pg;
+			return 0;
+		}
+	}
+}

二進制
BeefTools/BeefInstall/StubUI/Beef042Dbg64.dll


二進制
BeefTools/BeefInstall/StubUI/Beef042RT64.dll


+ 24 - 0
BeefTools/BeefInstall/StubUI/BeefProj.toml

@@ -0,0 +1,24 @@
+FileVersion = 1
+Dependencies = {corlib = "*", Beefy2D = "*"}
+
+[Project]
+Name = "StubUI"
+TargetType = "BeefDynLib"
+StartupObject = "Program"
+DefaultNamespace = "BIStubUI"
+
+[Configs.Debug.Win64]
+TargetDirectory = "$(WorkspaceDir)/../dist"
+TargetName = "$(ProjectName)_d"
+OtherLinkFlags = "$(LinkFlags) BeefySysLib64_d.lib"
+PostBuildCmds = ["Sleep(1000)", "cmd.exe /c echo Hey!", "CopyFilesIfNewer(\"$(WorkspaceDir)/../../../IDE/dist/BeefySysLib*.*\", \"$(WorkspaceDir)/../dist\")"]
+DebugCommand = "$(WorkspaceDir)\\..\\dist\\Stub_d.exe"
+
+[Configs.Release.Win64]
+TargetDirectory = "$(WorkspaceDir)/../dist"
+
+[Configs.Paranoid.Win64]
+TargetDirectory = "$(WorkspaceDir)/../dist"
+
+[Configs.Test.Win64]
+TargetDirectory = "$(WorkspaceDir)/../dist"

+ 10 - 0
BeefTools/BeefInstall/StubUI/BeefSpace.toml

@@ -0,0 +1,10 @@
+FileVersion = 1
+Projects = {StubUI = {Path = "."}, Beefy2D = "*"}
+Unlocked = ["corlib"]
+
+[Workspace]
+StartupProject = "StubUI"
+
+[Configs.Debug.Win64]
+AllocType = "CRT"
+IntermediateType = "ObjectAndIRCode"

二進制
BeefTools/BeefInstall/StubUI/StubUI_d.dll


文件差異過大導致無法顯示
+ 1 - 0
BeefTools/BeefInstall/StubUI/StubUI_d.dll.build.txt


二進制
BeefTools/BeefInstall/StubUI/StubUI_d.exp


二進制
BeefTools/BeefInstall/StubUI/StubUI_d.lib


二進制
BeefTools/BeefInstall/StubUI/StubUI_d.pdb


+ 41 - 0
BeefTools/BeefInstall/StubUI/src/BIApp.bf

@@ -0,0 +1,41 @@
+using System;
+using Beefy;
+using Beefy.widgets;
+
+namespace BIStubUI
+{
+	class BIApp : BFApp
+	{
+		public function void InstallFunc(StringView dest, StringView filter);
+		public function int ProgressFunc();
+		public function void CancelFunc();
+
+		public InstallFunc mInstallFunc;
+		public ProgressFunc mProgressFunc;
+		public CancelFunc mCancelFunc;
+
+		Widget mRootWidget;
+		WidgetWindow mMainWindow;
+
+		const int cWidth = 700;
+		const int cHeight = 700;
+
+		public override void Init()
+		{
+			base.Init();
+
+			BFWindow.Flags windowFlags = BFWindow.Flags.Border | BFWindow.Flags.SysMenu | //| BFWindow.Flags.CaptureMediaKeys |
+			    BFWindow.Flags.Caption | BFWindow.Flags.Minimize | BFWindow.Flags.QuitOnClose;
+			
+			mRootWidget = new Widget();
+			mMainWindow = new WidgetWindow(null, "Beef Installer", 0, 0, cWidth, cHeight, windowFlags, mRootWidget);
+			mMainWindow.SetMinimumSize(480, 360);
+			mMainWindow.mIsMainWindow = true;
+		}
+	}
+
+	static
+	{
+		public static BIApp gApp;
+	}
+}

+ 38 - 0
BeefTools/BeefInstall/StubUI/src/Program.bf

@@ -0,0 +1,38 @@
+using System;
+using System.Diagnostics;
+
+namespace BIStubUI
+{
+	class Program
+	{
+		public static this()
+		{
+			Debug.WriteLine("Initializing StubUI");
+		}
+
+		public static ~this()
+		{
+			Debug.WriteLine("Deinitializing StubUI");
+		}
+
+		[Export]
+		public static void Start(BIApp.InstallFunc installFunc, BIApp.ProgressFunc progressFunc, BIApp.CancelFunc cancelFunc)
+		{
+			gApp = new BIApp();
+			gApp.mInstallFunc = installFunc;
+			gApp.mProgressFunc = progressFunc;
+			gApp.mCancelFunc = cancelFunc;
+			gApp.Run();
+		}
+
+		public static void Hello()
+		{
+			
+		}
+
+		public static int Main(String[] args)
+		{
+			return 0;
+		}
+	}
+}

+ 0 - 96
BeefTools/BeefInstall/src/Program.bf

@@ -1,96 +0,0 @@
-using System;
-using IDE.Util;
-using System.IO;
-
-namespace BeefInstall
-{
-	class Program
-	{
-		bool HandleCommandLineParam(String key, String value)
-		{
-			return false;
-		}
-
-		void UnhandledCommandLine(String key, String value)
-		{
-
-		}
-
-		void ParseCommandLine(String[] args)
-		{
-			for (var str in args)
-			{
-				int eqPos = str.IndexOf('=');
-				if (eqPos == -1)
-				{
-					if (!HandleCommandLineParam(str, null))
-						UnhandledCommandLine(str, null);
-				}	
-				else
-				{
-					var cmd = scope String(str, 0, eqPos);
-					var param = scope String(str, eqPos + 1);
-					if (!HandleCommandLineParam(cmd, param))
-						UnhandledCommandLine(cmd, param);
-				}
-			}
-		}
-
-		Result<void> ExtractTo(ZipFile zipFile, StringView destDir, StringView subStr)
-		{
-			String fileName = scope .();
-			String destPath = scope .();
-
-			for (int i < zipFile.GetNumFiles())
-			{
-				ZipFile.Entry entry = scope .();
-				if (zipFile.SelectEntry(i, entry) case .Err)
-					continue;
-
-				fileName.Clear();
-				entry.GetFileName(fileName);
-
-				if (!fileName.StartsWith(subStr))
-					continue;
-
-				destPath.Clear();
-				destPath.Append(destDir);
-				destPath.Append('/');
-				destPath.Append(fileName);
-
-				if (entry.IsDirectory)
-				{
-					if (Directory.CreateDirectory(destPath) case .Err)
-						return .Err;
-				}
-				else
-				{
-					if (entry.ExtractToFile(destPath) case .Err)
-						return .Err;
-				}
-			}
-
-			return .Ok;
-		}
-
-		void Run()
-		{
-			ZipFile zipFile = scope .();
-			zipFile.Open(@"c:\\temp\\build_1827.zip");
-			ExtractTo(zipFile, @"c:\temp\unzip", .());
-
-			CabFile cabFile = scope .();
-			cabFile.Init();
-			cabFile.Copy();
-		}
-
-		static int Main(String[] args)
-		{
-			Program pg = new Program();
-			pg.ParseCommandLine(args);
-			pg.Run();
-			delete pg;
-			return 0;
-		}
-	}
-}

+ 1 - 0
BeefySysLib/BeefySysLib.vcxproj

@@ -247,6 +247,7 @@
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;BFSYSLIB_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>./; ./platform/win/; third_party/agg-2.4/include; third_party/agg-2.4/include/platform/win32; third_party/; third_party/libffi/i686-pc-cygwin; third_party/libffi/i686-pc-cygwin/include; third_party/libffi/include</AdditionalIncludeDirectories>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <SupportJustMyCode>false</SupportJustMyCode>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>

+ 1 - 1
IDE/BeefProj.toml

@@ -27,7 +27,7 @@ TargetDirectory = "$(WorkspaceDir)/dist"
 TargetName = "BeefIDE_d"
 OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib BeefySysLib64_d.lib"
 CLibType = "Dynamic"
-DebugCommandArguments = "-proddir=C:\\Beef\\BeefTools\\BeefInstall"
+DebugCommandArguments = "-open=c:\\proj\\TestCPP\\TestCPP.bfdbg"
 DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest"
 EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
 

+ 355 - 22
IDE/BeefSpace_User.toml

@@ -1,13 +1,14 @@
 FileVersion = 1
 LastConfig = "Debug"
 LastPlatform = "Win64"
-RecentFilesList = ["c:\\beef\\ide\\src\\util\\Zip.bf", "c:\\beef\\ide\\src\\ui\\AutoComplete.bf"]
+RecentFilesList = ["c:\\beef\\ide\\src\\IDEApp.bf", "c:\\beef\\IDEHelper\\DebugManager.cpp", "c:\\beef\\IDEHelper\\Compiler\\BfModule.cpp", "c:\\beef\\IDEHelper\\Compiler\\BfCompiler.cpp", "c:\\beef\\ide\\src\\BuildContext.bf", "c:\\beef\\beefrt\\dbg\\gc.cpp", "c:\\beef\\ide\\src\\ScriptManager.bf", "c:\\beef\\ide\\src\\Project.bf", "c:\\beef\\ide\\src\\CommandQueueManager.bf", "c:\\Beef\\BeefLibs\\corlib\\src\\System\\String.bf"]
+StepFilters = ["System.StringView.operator System.StringView"]
 
 [MainWindow]
-X = 679
-Y = 504
-Width = 2487
-Height = 1554
+X = 1021
+Y = 227
+Width = 2206
+Height = 1810
 
 [MainDockingFrame]
 Type = "DockingFrame"
@@ -41,39 +42,346 @@ DefaultDocumentsTabbedView = true
 Type = "TabbedView"
 
 [[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-Active = true
-TabLabel = "Zip.bf"
-TabWidth = 73.0
+TabLabel = "DebugManager.cpp"
+TabWidth = 156.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\IDEHelper\\DebugManager.cpp"
+CursorPos = 15042
+VertPos = 8490.0
+ProjectName = "IDEHelper"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "CommandQueueManager.bf"
+TabWidth = 205.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\CommandQueueManager.bf"
+CursorPos = 896
+VertPos = 1170.0
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "ProjectProperties.bf"
+TabWidth = 145.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\ui\\ProjectProperties.bf"
+CursorPos = 1930
+VertPos = 270.0
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "ProjectPanel.bf"
+TabWidth = 116.0
 Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\src\\util\\Zip.bf"
-CursorPos = 2802
-VertPos = 780.0
+FilePath = "c:\\beef\\ide\\src\\ui\\ProjectPanel.bf"
+CursorPos = 58964
+VertPos = 25350.0
 ProjectName = "IDE"
 
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "Directory.bf"
+TabWidth = 98.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\IO\\Directory.bf"
+CursorPos = 294
+ProjectName = "corlib"
+
 [[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
 TabLabel = "AutoComplete.bf"
-TabWidth = 138.0
+TabWidth = 128.0
 Type = "SourceViewPanel"
 FilePath = "c:\\beef\\ide\\src\\ui\\AutoComplete.bf"
-CursorPos = 3588
-VertPos = 2205.0
+CursorPos = 5948
+VertPos = 3060.0
 ProjectName = "IDE"
 
 [[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Disassembly"
-TabWidth = 122.0
-Type = "DisassemblyPanel"
+TabLabel = "Stopwatch.bf"
+TabWidth = 105.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\Diagnostics\\Stopwatch.bf"
+CursorPos = 309
+ProjectName = "corlib"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "IComparable.bf"
+TabWidth = 120.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\IComparable.bf"
+CursorPos = 404
+ProjectName = "corlib"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "Dictionary.bf"
+TabWidth = 103.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\Collections\\Generic\\Dictionary.bf"
+CursorPos = 13141
+ProjectName = "corlib"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "Workspace.bf"
+TabWidth = 110.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\Workspace.bf"
+CursorPos = 10820
+VertPos = 5745.0
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "Project.bf"
+TabWidth = 85.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\Project.bf"
+CursorPos = 31286
+VertPos = 16875.0
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "gc.cpp"
+TabWidth = 69.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\beefrt\\dbg\\gc.cpp"
+CursorPos = 29571
+VertPos = 16845.0
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "String.bf"
+TabWidth = 79.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\String.bf"
+CursorPos = 20322
+VertPos = 11775.0
+ProjectName = "corlib"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "ImmediatePanel.bf"
+TabWidth = 137.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\ui\\ImmediatePanel.bf"
+CursorPos = 1248
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "StatusBar.bf"
+TabWidth = 98.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\ui\\StatusBar.bf"
+CursorPos = 11876
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "ImmediateWidget.bf"
+TabWidth = 148.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\ui\\ImmediateWidget.bf"
+CursorPos = 10575
+VertPos = 4425.0
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "ScriptManager.bf"
+TabWidth = 130.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\ScriptManager.bf"
+CursorPos = 46372
+VertPos = 29080.0
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "ListView.bf"
+TabWidth = 91.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\BeefLibs\\Beefy2D\\src\\widgets\\ListView.bf"
+CursorPos = 24610
+ProjectName = "Beefy2D"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "EditWidget.bf"
+TabWidth = 109.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\BeefLibs\\Beefy2D\\src\\widgets\\EditWidget.bf"
+CursorPos = 70859
+ProjectName = "Beefy2D"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "OpenFileInSolutionDialog.bf"
+TabWidth = 191.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\ui\\OpenFileInSolutionDialog.bf"
+CursorPos = 3378
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "InstalledProjectDialog.bf"
+TabWidth = 171.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\ui\\InstalledProjectDialog.bf"
+CursorPos = 2662
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "ClassViewPanel.bf"
+TabWidth = 133.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\ui\\ClassViewPanel.bf"
+CursorPos = 10536
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "BinaryDataWidget.bf"
+TabWidth = 149.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\ui\\BinaryDataWidget.bf"
+CursorPos = 87580
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "BfIRBuilder.cpp"
+TabWidth = 116.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfIRBuilder.cpp"
+CursorPos = 132547
+ProjectName = "IDEHelper"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "BfIRCodeGen.cpp"
+TabWidth = 131.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfIRCodeGen.cpp"
+CursorPos = 124783
+ProjectName = "IDEHelper"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "memory"
+TabWidth = 78.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\VC\\Tools\\MSVC\\14.21.27702\\include\\memory"
+CursorPos = 68115
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "Verifier.cpp"
+TabWidth = 96.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\IR\\Verifier.cpp"
+CursorPos = 189261
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "BfExprEvaluator.cpp"
+TabWidth = 145.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfExprEvaluator.cpp"
+CursorPos = 395532
+ProjectName = "IDEHelper"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "BfModule.cpp"
+TabWidth = 111.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfModule.cpp"
+CursorPos = 701696
+VertPos = 303765.0
+ProjectName = "IDEHelper"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "Result.bf"
+TabWidth = 80.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\Result.bf"
+CursorPos = 699
+ProjectName = "corlib"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "LegacyPassManager.cpp"
+TabWidth = 173.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\IR\\LegacyPassManager.cpp"
+CursorPos = 56552
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "LexicalScopes.cpp"
+TabWidth = 135.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\CodeGen\\LexicalScopes.cpp"
+CursorPos = 6263
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "TimeZoneInfo.bf"
+TabWidth = 124.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\TimeZoneInfo.bf"
+CursorPos = 118021
+ProjectName = "corlib"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "Windows.bf"
+TabWidth = 98.0
+Type = "SourceViewPanel"
+FilePath = "c:\\Beef\\BeefLibs\\corlib\\src\\System\\Windows.bf"
+CursorPos = 40234
+ProjectName = "corlib"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "Platform.cpp"
+TabWidth = 104.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\BeefySysLib\\platform\\win\\Platform.cpp"
+CursorPos = 59719
+ProjectName = "BeefySysLib"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "BfCompiler.bf"
+TabWidth = 108.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\Compiler\\BfCompiler.bf"
+CursorPos = 7397
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "BfCompiler.cpp"
+TabWidth = 118.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\IDEHelper\\Compiler\\BfCompiler.cpp"
+CursorPos = 181147
+VertPos = 82605.0
+ProjectName = "IDEHelper"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "WinDebugger.cpp"
+TabWidth = 135.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\IDEHelper\\WinDebugger.cpp"
+CursorPos = 120268
+ProjectName = "Debugger64"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+TabLabel = "BuildContext.bf"
+TabWidth = 117.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\BuildContext.bf"
+CursorPos = 3642
+VertPos = 1395.0
+ProjectName = "IDE"
+
+[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
+Active = true
+TabLabel = "IDEApp.bf"
+TabWidth = 88.0
+Type = "SourceViewPanel"
+FilePath = "c:\\beef\\ide\\src\\IDEApp.bf"
+CursorPos = 320852
+VertPos = 158655.0
+ProjectName = "IDE"
 
 [[MainDockingFrame.DockedWidgets]]
 RequestedWidth = 250.0
-RequestedHeight = 553.0
+RequestedHeight = 408.0
 Type = "DockingFrame"
 SplitType = 1
 
 [[MainDockingFrame.DockedWidgets.DockedWidgets]]
 RequestedWidth = 250.0
 RequestedHeight = 250.0
-SizePriority = 0.443346
+SizePriority = 0.4483547
 Type = "TabbedView"
 
 [[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
@@ -99,7 +407,7 @@ TabLabel = "Watch"
 TabWidth = 86.0
 Type = "WatchPanel"
 Columns = [{Width = 306.0}, {Width = 675.0}, {Width = 200.0}]
-Items = [""]
+Items = ["this", "instIdx", "mcBlock", "bfProject", "gApp", ""]
 
 [[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
 TabLabel = "Auto"
@@ -110,7 +418,7 @@ Columns = [{Width = 200.0}, {Width = 442.0}, {Width = 200.0}]
 [[MainDockingFrame.DockedWidgets.DockedWidgets]]
 RequestedWidth = 910.0
 RequestedHeight = 793.0
-SizePriority = 0.203422
+SizePriority = 0.1984133
 Type = "TabbedView"
 
 [[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
@@ -146,6 +454,31 @@ TabLabel = "Output"
 TabWidth = 90.0
 Type = "OutputPanel"
 
+[[Breakpoints]]
+File = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\IR\\Verifier.cpp"
+Line = 4875
+Column = 6
+
+[[Breakpoints]]
+File = "c:\\Beef\\extern\\llvm-project_8_0_0\\llvm\\lib\\IR\\Verifier.cpp"
+Line = 214
+Column = 4
+
+[[Breakpoints]]
+File = "c:\\beef\\ide\\src\\Workspace.bf"
+Line = 661
+Column = 3
+
+[[Bookmarks]]
+File = "c:\\beef\\ide\\src\\BuildContext.bf"
+Line = 465
+Column = 6
+
+[[Bookmarks]]
+File = "c:\\beef\\ide\\src\\BuildContext.bf"
+Line = 465
+Column = 6
+
 [DebuggerDisplayTypes.""]
-IntDisplayType = "Default"
+IntDisplayType = "Hexadecimal"
 MmDisplayType = "Default"

+ 5 - 0
IDE/Tests/BugW001/BeefProj.toml

@@ -0,0 +1,5 @@
+FileVersion = 1
+
+[Project]
+Name = "BugW001"
+StartupObject = "BugW001.Program"

+ 8 - 0
IDE/Tests/BugW001/BeefSpace.toml

@@ -0,0 +1,8 @@
+FileVersion = 1
+Projects = {BugW001 = {Path = "."}}
+
+[Workspace]
+StartupProject = "BugW001"
+
+[Configs.Debug.Win64]
+BfOptimizationLevel = "O0"

+ 9 - 0
IDE/Tests/BugW001/scripts/Test.txt

@@ -0,0 +1,9 @@
+# This tests extensions on Result<void*>, where the void* operator would be double-declared in the IR
+
+ShowFile("src/Program.bf")
+GotoText("//Main_Start")
+ToggleBreakpoint()
+RunWithCompiling()
+
+ToggleCommentAt("Result_Get")
+Compile()

+ 18 - 0
IDE/Tests/BugW001/src/Program.bf

@@ -0,0 +1,18 @@
+#pragma warning disable 168
+
+using System;
+
+namespace BugW001
+{
+	class Program
+	{
+		static void Main()
+		{
+			//Main_Start
+			Result<void*> result = .();
+			/*Result_Get
+			void* vp = result;
+			*/
+		}
+	}
+}

+ 1 - 0
IDE/mintest/BeefSpace.toml

@@ -10,6 +10,7 @@ IntermediateType = "ObjectAndIRCode"
 ConfigSelections = {mintest2 = {Enabled = false}}
 
 [Configs.Debug.Win64]
+BfOptimizationLevel = "O0"
 IntermediateType = "ObjectAndIRCode"
 COptimizationLevel = "Og"
 

+ 4 - 26
IDE/mintest/minlib/src/System/Attribute.bf

@@ -291,38 +291,16 @@ namespace System
 		public bool Profile;
 	}
 
-	namespace Runtime.InteropServices
+	public struct ImportAttribute : Attribute
 	{
-		public enum CallingConvention
+	    public this(String libName)
 		{
-		    Winapi          = 1,
-		    Cdecl           = 2,
-		    StdCall         = 3,
-		    ThisCall        = 4,
-		    FastCall        = 5,
-
-			Default = Cdecl
-		}
-	
-		[AttributeUsage(AttributeTargets.Method /*3*/)]
-	    public struct DllImportAttribute : Attribute
-	    {
-	        public this(String dllName)
-			{
-				CallingConvention = .Default;
-				CLink = false;
-			}
-
-			public CallingConvention CallingConvention;
-			public bool CLink;
 		}
 	}
 
-	public struct ImportAttribute : Attribute
+	public struct ExportAttribute : Attribute
 	{
-	    public this(String libName)
-		{
-		}
+
 	}
 
 	[AttributeUsage(AttributeTargets.StaticField | AttributeTargets.Field, .NotInherited)]

+ 0 - 1
IDE/mintest/minlib/src/System/Collections/Generic/List.bf

@@ -7,7 +7,6 @@
 #endif
 
 using System;
-using System.Runtime;
 using System.Diagnostics;
 using System.Diagnostics.Contracts;
 using System.Threading;

+ 0 - 1
IDE/mintest/minlib/src/System/Collections/IEnumerator.bf

@@ -1,5 +1,4 @@
 using System;
-using System.Runtime.InteropServices;
 
 namespace System.Collections
 {

+ 0 - 1
IDE/mintest/minlib/src/System/Double.bf

@@ -19,7 +19,6 @@ namespace System
 ///#if GENERICS_WORK
 ///    using System.Numerics;
 ///#endif
-    using System.Runtime.InteropServices;
     using System.Diagnostics.Contracts;
     
     public struct Double : double, IHashable, IOpComparable, IOpNegatable, ICanBeNaN /*: IComparable, IFormattable, IConvertible

+ 0 - 1
IDE/mintest/minlib/src/System/Math.bf

@@ -16,7 +16,6 @@ namespace System
 {
     //This class contains only static members and doesn't require serialization.
     using System;
-    using System.Runtime;
     using System.Diagnostics.Contracts;
 	using System.Diagnostics;
     

+ 0 - 1
IDE/mintest/minlib/src/System/Nullable.bf

@@ -1,6 +1,5 @@
 using System.Reflection;
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 
 namespace System

+ 0 - 1
IDE/mintest/minlib/src/System/Threading/Monitor.bf

@@ -20,7 +20,6 @@
 namespace System.Threading
 {
     using System;
-    using System.Runtime;
     using System.Threading;
     using System.Diagnostics.Contracts;
 	using System.Diagnostics;

+ 0 - 387
IDE/mintest/mintest.bfuser

@@ -1,387 +0,0 @@
-LastConfig = "Debug"
-LastPlatform = "Win64"
-RecentFilesList = ["c:\\beef\\ide\\mintest\\src\\main2.cs", "c:\\beef\\ide\\mintest\\src\\main3.cs", "c:\\beef\\ide\\mintest\\src\\main.cs", "c:\\beef\\ide\\mintest\\minlib\\src\\System\\String.cs", "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Collections\\Generic\\List.bf", "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Array.cs", "c:\\beef\\ide\\mintest\\minlib\\src\\System\\IComparable.cs", "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Collections\\Generic\\Dictionary.bf", "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Object.cs", "Disassembly"]
-
-[MainWindow]
-X = 128
-Y = 166
-Width = 2434
-Height = 1847
-
-[MainDockingFrame]
-Type = "DockingFrame"
-SplitType = 2
-
-[[MainDockingFrame.DockedWidgets]]
-RequestedWidth = 250.000000
-RequestedHeight = 1133.000000
-SizePriority = 1133.000000
-Type = "DockingFrame"
-SplitType = 1
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets]]
-RequestedWidth = 263.000000
-RequestedHeight = 250.000000
-SizePriority = 0.000000
-Type = "TabbedView"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Workspace"
-TabWidth = 95.000000
-Type = "ProjectPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets]]
-IsFillWidget = true
-RequestedWidth = 1639.000000
-RequestedHeight = 150.000000
-SizePriority = 1639.000000
-DefaultDocumentsTabbedView = true
-Type = "TabbedView"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Contracts.cs"
-TabWidth = 110.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Diagnostics\\Contracts\\Contracts.cs"
-CursorPos = 2270
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "internal.cpp"
-TabWidth = 108.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\beefrt\\rt\\internal.cpp"
-CursorPos = 20281
-VertPos = 0.000000
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "main4.cs"
-TabWidth = 90.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\mintest2\\src\\main4.cs"
-CursorPos = 182
-VertPos = 0.000000
-ProjectName = "mintest2"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Internal.cs"
-TabWidth = 98.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Internal.cs"
-CursorPos = 2881
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Array.cs"
-TabWidth = 86.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Array.cs"
-CursorPos = 608
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Variant.cs"
-TabWidth = 96.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Variant.cs"
-CursorPos = 4292
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "String.cs"
-TabWidth = 89.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\String.cs"
-CursorPos = 10914
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Runtime.bf"
-TabWidth = 102.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Runtime.bf"
-CursorPos = 2021
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "List.bf"
-TabWidth = 74.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Collections\\Generic\\List.bf"
-CursorPos = 9410
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Event.bf"
-TabWidth = 86.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Event.bf"
-CursorPos = 743
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "IEnumerator.cs"
-TabWidth = 125.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Collections\\IEnumerator.cs"
-CursorPos = 464
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Type.cs"
-TabWidth = 83.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Type.cs"
-CursorPos = 1538
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Disassembly"
-TabWidth = 112.000000
-Type = "DisassemblyPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Object.cs"
-TabWidth = 93.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Object.cs"
-CursorPos = 452
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "main2.cs"
-TabWidth = 90.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\src\\main2.cs"
-CursorPos = 2845
-VertPos = 3060.000000
-ProjectName = "mintest"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "main3.cs"
-TabWidth = 90.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\src\\main3.cs"
-CursorPos = 1954
-VertPos = 0.000000
-ProjectName = "mintest"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "main.cs"
-TabWidth = 83.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\src\\main.cs"
-CursorPos = 4383
-VertPos = 0.000000
-ProjectName = "mintest"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Nullable.cs"
-TabWidth = 103.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Nullable.cs"
-CursorPos = 623
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "GC.cs"
-TabWidth = 72.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\GC.cs"
-CursorPos = 1934
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "testdll.cpp"
-TabWidth = 100.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\beeftools\\testdll\\testdll.cpp"
-CursorPos = 939
-VertPos = 0.000000
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "stdio.h"
-TabWidth = 79.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\program files (x86)\\windows kits\\10\\include\\10.0.16299.0\\ucrt\\stdio.h"
-CursorPos = 27765
-VertPos = 0.000000
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Profiler.bf"
-TabWidth = 96.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Diagnostics\\Profiler.bf"
-CursorPos = 450
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Dictionary.bf"
-TabWidth = 113.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\Collections\\Generic\\Dictionary.bf"
-CursorPos = 3575
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "IComparable.cs"
-TabWidth = 130.000000
-Type = "SourceViewPanel"
-FilePath = "c:\\beef\\ide\\mintest\\minlib\\src\\System\\IComparable.cs"
-CursorPos = 75
-VertPos = 0.000000
-ProjectName = "minlib"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets]]
-RequestedWidth = 291.000000
-RequestedHeight = 250.000000
-SizePriority = 0.000000
-Type = "TabbedView"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Properties"
-TabWidth = 90.000000
-Type = "PropertiesPanel"
-
-[[MainDockingFrame.DockedWidgets]]
-RequestedWidth = 250.000000
-RequestedHeight = 540.000000
-SizePriority = 0.000000
-Type = "DockingFrame"
-SplitType = 1
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets]]
-RequestedWidth = 920.000000
-RequestedHeight = 250.000000
-SizePriority = 0.396523
-Type = "TabbedView"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Auto"
-TabWidth = 150.000000
-Type = "AutoWatchPanel"
-Items = ["args", "str", ""]
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs.Columns]]
-Width = 225.000000
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs.Columns]]
-Width = 498.000000
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs.Columns]]
-Width = 275.000000
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Watch"
-TabWidth = 150.000000
-Type = "WatchPanel"
-Items = ["args", "z", ""]
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs.Columns]]
-Width = 264.000000
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs.Columns]]
-Width = 984.000000
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs.Columns]]
-Width = 275.000000
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Memory"
-TabWidth = 150.000000
-Type = "MemoryPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Breakpoints"
-TabWidth = 150.000000
-Type = "BreakpointPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets]]
-RequestedWidth = 777.000000
-RequestedHeight = 250.000000
-SizePriority = 0.603477
-Type = "TabbedView"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Threads"
-TabWidth = 150.000000
-Type = "ThreadPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Immediate"
-TabWidth = 150.000000
-Type = "ImmediatePanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Output"
-TabWidth = 150.000000
-Type = "OutputPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Find Results"
-TabWidth = 150.000000
-Type = "FindResultsPanel"
-
-[[MainDockingFrame.DockedWidgets.DockedWidgets.Tabs]]
-TabLabel = "Call Stack"
-TabWidth = 150.000000
-Type = "CallStackPanel"
-
-[[Bookmarks]]
-File = "c:\\beef\\IDE\\mintest\\main.cs"
-Line = 306
-Column = 3
-
-[[Bookmarks]]
-File = "c:\\beef\\IDE\\mintest\\main.cs"
-Line = 56
-Column = 2
-
-[[Bookmarks]]
-File = "c:\\beef\\IDE\\mintest\\main2.cs"
-Line = 8
-Column = 0
-
-[[Bookmarks]]
-File = "c:\\beef\\IDE\\mintest\\main3.cs"
-Line = 177
-Column = 2
-
-[DebuggerDisplayTypes]
-
-[DebuggerDisplayTypes.""]
-IntDisplayType = "Hexadecimal"
-MmDisplayType = "Default"
-
-[[StepFilters]]
-Filter = "System::Internal::ThrowIndexOutOfRange"
-
-[[StepFilters]]
-Filter = "BfObjectStackInit"
-
-[[StepFilters]]
-Filter = "[].this"
-
-[[StepFilters]]
-Filter = "std::basic_string<>::basic_string<>"
-
-[[StepFilters]]
-Filter = "System.StringView.this"
-
-[[StepFilters]]
-Filter = "TestA::TestA"

+ 8 - 4
IDE/mintest/src/main.bf

@@ -15,7 +15,6 @@ using System;
 using System.Threading;
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 using System.Collections.Generic;
 using System.Collections;
@@ -178,13 +177,18 @@ namespace Hey.Dude.Bro
 
 		public static int Main(String[] args)
 		{
-			while (true)
+			Blurg.Hey();
+
+			/*while (true)
 			{
 				int a = 0;
 			}
 
 			int* iPtr = null;
-			*iPtr = 123;
+			*iPtr = 123;*/
+
+			GC.SetAutoCollectPeriod(20);
+			Thread.Sleep(1000);
 
 			String str = scope .("Boops!");
 			int len = str.GetLength();
@@ -196,7 +200,7 @@ namespace Hey.Dude.Bro
 
 			//Thread.Sleep(500);
 
-			Test2(1, 2, 3, 4);
+			//Test2(1, 2, 3, 4);
 
 			thread.Join();
 

+ 7 - 0
IDE/mintest/src/main2.bf

@@ -0,0 +1,7 @@
+class Snorf
+{
+	struct Bloog
+	{
+		int mA;
+	}
+}

+ 13 - 57
IDE/mintest/src/main3.bf

@@ -80,13 +80,6 @@ class ClassF : ClassE
 
 }
 
-class Snorf
-{
-	public static void Borf(ClassD cd)
-	{
-		cd.Poo();
-	}
-}
 
 [NoDiscard("Use this value!")]
 struct TestStruct
@@ -97,70 +90,33 @@ struct TestStruct
 
 class Blurg
 {
-	public static void UseTS(TestStruct ts)
+	[Export, CLink, StdCall]
+	public static void Poof()
 	{
-		int c = ts.mA;
+		PrintF("Poofs!\n");
 	}
 
-	[NoDiscard("Why you no use me?")]
-	public static int UseMe()
+	[Export, CLink, StdCall]
+	public static void Poof2()
 	{
-		return 999;
-	}
-
-	public static TestStruct UseIt()
-	{
-		return .();
-	}
-
-	mixin FartOut(int a)
-	{
-		a = 0;
-
-		//let c = 1;
-		//c = 3;
-		//int b = 123;
-		//int c = 99;
+		PrintF("Poofs2!\n");
 	}
 
 	public static void Hey()
 	{
-		mixin Fart(int a)
-		{
-			//a = 0;
-			//int b = 123;
-			//int c = 99;
-		}
-
-		/*int c = 222;
-		Fart!(c);*/
-
-		//int __CRASH_AUTOVARIABLE__ = 123;
+		Snorf sn = scope .();
 
-		//UseIt();
+		Result<void*> voidPtrResult = default;
 
-		//UseMe();
+		//void* val = voidPtrResult;
 
-		//int a;
 
+		//Result<TestStruct> ts = .Ok(.());
 
-		for (int i < 10)
-		{
-			int a = 0;
-		}
+		//let val = ts.Get();
+		//Snorf.Bloog bl = .();
 
-		TestStruct ts = .();
-		ts.mA = 111;
-		ts.mB = 222;
-		UseTS(ts);
-
-		ClassD cd = null;
-		//let str = cd.mStr;
-
-
-#if A || B
-		ClassC cc = scope .();
-#endif
+		//Poof();
 	}
 
 }

+ 1062 - 0
IDE/src/BuildContext.bf

@@ -0,0 +1,1062 @@
+using System.Collections.Generic;
+using System;
+using IDE.Compiler;
+using System.IO;
+using System.Diagnostics;
+using Beefy;
+using IDE.util;
+
+namespace IDE
+{
+	class BuildContext
+	{
+		public Project mHotProject;
+		public Workspace.Options mWorkspaceOptions;
+		public Dictionary<Project, String> mImpLibMap = new .() ~
+		{
+			for (let val in _.Values)
+				delete val;
+			delete _;
+		};
+		public ScriptManager mScriptManager ~ delete _;
+
+		public bool Failed
+		{
+			get
+			{
+				if (mScriptManager != null)
+					return mScriptManager.mFailed;
+				return false;
+			}
+		}
+
+		public enum CustomBuildCommandResult
+		{
+			NoCommands,
+			HadCommands,
+			Failed
+		}
+
+		public CustomBuildCommandResult QueueProjectCustomBuildCommands(Project project, String targetPath, Project.BuildCommandTrigger trigger, List<String> cmdList)
+		{
+			if (cmdList.IsEmpty)
+				return .NoCommands;
+
+			if (trigger == .Never)
+				return .NoCommands;
+
+			if ((trigger == .IfFilesChanged) && (!project.mForceCustomCommands))
+			{
+				int64 highestDateTime = 0;
+
+				int64 targetDateTime = File.GetLastWriteTime(targetPath).Get().ToFileTime();
+
+				bool forceRebuild = false;
+
+				for (var depName in project.mDependencies)
+				{
+					var depProject = gApp.mWorkspace.FindProject(depName.mProjectName);
+					if (depProject != null)
+					{
+						if (depProject.mLastDidBuild)
+							forceRebuild = true;
+					}
+				}
+
+				project.WithProjectItems(scope [&] (projectItem) =>
+					{
+						var projectSource = projectItem as ProjectSource;
+						var importPath = scope String();
+						projectSource.GetFullImportPath(importPath);
+						Result<DateTime> fileDateTime = File.GetLastWriteTime(importPath);
+						if (fileDateTime case .Ok)
+						{
+							let date = fileDateTime.Get().ToFileTime();
+							/*if (date > targetDateTime)
+								Console.WriteLine("Custom build higher time: {0}", importPath);*/
+							highestDateTime = Math.Max(highestDateTime, date);
+						}
+					});
+
+				if ((highestDateTime <= targetDateTime) && (!forceRebuild))
+					return .NoCommands;
+
+				project.mLastDidBuild = true;
+			}
+
+			Workspace.Options workspaceOptions = gApp.GetCurWorkspaceOptions();
+			Project.Options options = gApp.GetCurProjectOptions(project);
+
+			bool didCommands = false;
+
+			let targetName = scope String("Project ", project.mProjectName);
+
+			//Console.WriteLine("Executing custom command {0} {1} {2}", highestDateTime, targetDateTime, forceRebuild);
+			for (let origCustomCmd in cmdList)
+			{
+				bool isCommand = false;
+				for (let c in origCustomCmd.RawChars)
+				{
+					if ((c == '\"') || (c == '$'))
+						break;
+					if (c == '(')
+						isCommand = true;
+				}
+
+				String customCmd = scope String();
+
+				if (isCommand)
+				{
+					customCmd.Append(origCustomCmd);
+				}
+				else
+				{
+					customCmd.Append("%exec ");
+					gApp.ResolveConfigString(workspaceOptions, project, options, origCustomCmd, "custom command", customCmd);
+				}
+
+				if (customCmd.IsWhiteSpace)
+					continue;
+
+				if (mScriptManager == null)
+				{
+					mScriptManager = new .();
+					mScriptManager.mProjectName = new String(project.mProjectName);
+					mScriptManager.mAllowCompiling = true;
+					mScriptManager.mSoftFail = true;
+					mScriptManager.mVerbosity = gApp.mVerbosity;
+					didCommands = true;
+				}
+
+				mScriptManager.QueueCommands(customCmd, project.mProjectName, .NoLines);
+				continue;
+			}
+
+			if (didCommands)
+			{
+				mScriptManager.QueueCommands(scope String()..AppendF("%targetComplete {}", project.mProjectName), targetName, .NoLines);
+
+				let targetCompleteCmd = new IDEApp.TargetCompletedCmd(project);
+				targetCompleteCmd.mIsReady = false;
+				gApp.mExecutionQueue.Add(targetCompleteCmd);
+				project.mNeedsTargetRebuild = true;
+			}
+
+			return didCommands ? .HadCommands : .Failed;
+		}
+
+		bool QueueProjectGNULink(Project project, String targetPath, Workspace.Options workspaceOptions, Project.Options options, String objectsArg)
+		{
+			bool isDebug = gApp.mConfigName.IndexOf("Debug", true) != -1;
+
+#if BF_PLATFORM_WINDOWS
+			String llvmDir = scope String(IDEApp.sApp.mInstallDir);
+			IDEUtils.FixFilePath(llvmDir);
+			llvmDir.Append("llvm/");
+#else
+		    String llvmDir = "";
+#endif
+
+		    //String error = scope String();
+
+			bool isExe = project.mGeneralOptions.mTargetType != Project.TargetType.BeefLib;
+			if (isExe)
+			{
+			    String linkLine = scope String(isDebug ? "-g " : "-g -O2 "); //-O2 -Rpass=inline 
+																 //(doClangCPP ? "-lc++abi " : "") +
+			    
+			    linkLine.Append("-o ");
+			    IDEUtils.AppendWithOptionalQuotes(linkLine, targetPath);
+			    linkLine.Append(" ");
+
+			    /*if (options.mBuildOptions.mLinkerType == Project.LinkerType.GCC)
+			    {
+					// ...
+			    }
+			    else
+			    {
+					linkLine.Append("--target=");
+					GetTargetName(workspaceOptions, linkLine);
+					linkLine.Append(" ");
+			    }*/
+
+			    if ((project.mGeneralOptions.mTargetType == Project.TargetType.BeefWindowsApplication) ||
+			        (project.mGeneralOptions.mTargetType == Project.TargetType.C_WindowsApplication))
+			    {
+			        linkLine.Append("-mwindows ");
+			    }
+
+				linkLine.Append("-no-pie ");
+
+			    linkLine.Append(objectsArg);
+
+				//var destDir = scope String();
+				//Path.GetDirectoryName();
+
+				//TODO: Make an option
+			    if (options.mBuildOptions.mCLibType == Project.CLibType.Static)
+			    {
+			        linkLine.Append("-static-libgcc -static-libstdc++ ");
+			    }
+			    else
+			    {
+#if BF_PLATFORM_WINDOWS
+			        String[] mingwFiles;
+			        String fromDir;
+			        if (workspaceOptions.mMachineType == Workspace.MachineType.x86)
+			        {
+			            fromDir = scope:: String(llvmDir, "i686-w64-mingw32/bin/");
+			            mingwFiles = scope:: String[] { "libgcc_s_dw2-1.dll", "libstdc++-6.dll" };
+			        }
+			        else
+			        {
+			            fromDir = scope:: String(llvmDir, "x86_64-w64-mingw32/bin/");
+			            mingwFiles = scope:: String[] { "libgcc_s_seh-1.dll", "libstdc++-6.dll", "libwinpthread-1.dll" };
+			        }
+			        for (var mingwFile in mingwFiles)
+			        {
+			            String fromPath = scope String(fromDir, mingwFile);
+						//string toPath = projectBuildDir + "/" + mingwFile;
+			            String toPath = scope String();
+			            Path.GetDirectoryPath(targetPath, toPath);
+			            toPath.Append("/", mingwFile);
+			            if (!File.Exists(toPath))
+						{
+							if (File.Copy(fromPath, toPath) case .Err)
+							{
+								gApp.OutputLineSmart("ERROR: Failed to copy mingw file {0}", fromPath);
+								return false;
+							}
+						}
+			        }
+#endif
+			    }
+
+			    List<Project> depProjectList = scope List<Project>();
+			    gApp.GetDependentProjectList(project, depProjectList);
+			    if (depProjectList.Count > 0)
+			    {
+			        for (var dep in project.mDependencies)
+			        {
+			            var depProject = gApp.mWorkspace.FindProject(dep.mProjectName);
+			            if (depProject == null)
+			            {
+			                gApp.OutputLine("Failed to locate dependent library: {0}", dep.mProjectName);
+			                return false;
+			            }
+			            else
+			            {                                                        
+		                    /*if (depProject.mNeedsTargetRebuild)
+		                        project.mNeedsTargetRebuild = true;*/
+
+		                    var depOptions = gApp.GetCurProjectOptions(depProject);
+
+		                    if (depOptions.mClangObjectFiles != null)
+		                    {
+		                        var argBuilder = scope IDEApp.ArgBuilder(linkLine, true);
+
+		                        for (var fileName in depOptions.mClangObjectFiles)
+		                        {
+		                            //AppendWithOptionalQuotes(linkLine, fileName);
+		                            argBuilder.AddFileName(fileName);
+		                            argBuilder.AddSep();
+		                        }
+		                    }
+
+
+		                    /*String depLibTargetPath = scope String();
+		                    ResolveConfigString(depProject, depOptions, "$(TargetPath)", error, depLibTargetPath);
+		                    IDEUtils.FixFilePath(depLibTargetPath);
+
+		                    String depDir = scope String();
+		                    Path.GetDirectoryName(depLibTargetPath, depDir);
+		                    String depFileName = scope String();
+		                    Path.GetFileNameWithoutExtension(depLibTargetPath, depFileName);
+
+		                    AppendWithOptionalQuotes(linkLine, depLibTargetPath);
+		                    linkLine.Append(" ");*/
+			            }
+			        }
+			    }
+
+#if BF_PLATFORM_WINDOWS
+			    String gccExePath = "c:/mingw/bin/g++.exe";
+			    String clangExePath = scope String(llvmDir, "bin/clang++.exe");
+#else
+		        String gccExePath = "/usr/bin/c++";
+		        String clangExePath = scope String("/usr/bin/c++");
+#endif
+
+			    if (project.mNeedsTargetRebuild)
+			    {
+			        if (File.Delete(targetPath) case .Err)
+					{
+					    gApp.OutputLine("Failed to delete {0}", targetPath);
+					    return false;
+					}
+
+					if (workspaceOptions.mToolsetType == .GNU)
+					{
+			            if (workspaceOptions.mMachineType == Workspace.MachineType.x86)
+			            {
+			            }
+			            else
+			            {
+							IDEUtils.AppendWithOptionalQuotes(linkLine, scope String("-L", llvmDir, "/x86_64-w64-mingw32/lib"));
+							linkLine.Append(" ");
+							IDEUtils.AppendWithOptionalQuotes(linkLine, scope String("-L", llvmDir, "/lib/gcc/x86_64-w64-mingw32/5.2.0"));
+							linkLine.Append(" ");
+			            }
+					}
+					else // Microsoft
+					{
+						if (workspaceOptions.mMachineType == Workspace.MachineType.x86)
+						{
+							//linkLine.Append("-L\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.10586.0\\ucrt\\x86\" ");
+							for (var libPath in gApp.mSettings.mVSSettings.mLib32Paths)
+							{
+								linkLine.AppendF("-L\"{0}\" ", libPath);
+							}
+						}
+						else
+						{
+							/*linkLine.Append("-L\"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\lib\\amd64\" ");
+							linkLine.Append("-L\"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\atlmfc\\lib\\amd64\" ");
+							linkLine.Append("-L\"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.14393.0\\ucrt\\x64\" ");
+							linkLine.Append("-L\"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.14393.0\\um\\x64\" ");*/
+							for (var libPath in gApp.mSettings.mVSSettings.mLib64Paths)
+							{
+								linkLine.AppendF("-L\"{0}\" ", libPath);
+							}
+						}
+					}
+
+					if (options.mBuildOptions.mOtherLinkFlags.Length != 0)
+					{
+						var linkFlags = scope String();
+						gApp.ResolveConfigString(workspaceOptions, project, options, options.mBuildOptions.mOtherLinkFlags, "link flags", linkFlags);
+						linkLine.Append(linkFlags, " ");
+					}
+
+			        String compilerExePath = (workspaceOptions.mToolsetType == .GNU) ? gccExePath : clangExePath;
+					String workingDir = scope String();
+					if (!llvmDir.IsEmpty)
+					{
+						workingDir.Append(llvmDir, "bin");
+					}
+					else
+					{
+						workingDir.Append(gApp.mInstallDir);
+					}
+
+			        var runCmd = gApp.QueueRun(compilerExePath, linkLine, workingDir, .UTF8);
+			        runCmd.mOnlyIfNotFailed = true;
+			        var tagetCompletedCmd = new IDEApp.TargetCompletedCmd(project);
+			        tagetCompletedCmd.mOnlyIfNotFailed = true;
+			        gApp.mExecutionQueue.Add(tagetCompletedCmd);
+
+					String logStr = scope String();
+					logStr.AppendF("IDE Process {0}\r\n", Platform.BfpProcess_GetCurrentId());
+					logStr.Append(linkLine);
+					String targetLogPath = scope String(targetPath, ".build.txt");
+					Utils.WriteTextFile(targetLogPath, logStr);
+
+					project.mLastDidBuild = true;
+			    }
+			}
+
+			return true;
+		}
+
+		public static void GetPdbPath(String targetPath, Workspace.Options workspaceOptions, Project.Options options, String outPdbPath)
+		{
+			int lastDotPos = targetPath.LastIndexOf('.');
+			outPdbPath.Append(targetPath, 0, lastDotPos);
+			if (workspaceOptions.mToolsetType == .LLVM)
+				outPdbPath.Append("_lld");
+			outPdbPath.Append(".pdb");
+		}
+
+		public static void GetRtLibNames(Workspace.Options workspaceOptions, Project.Options options, bool dynName, String outRt, String outDbg)
+		{
+			if ((!dynName) || (options.mBuildOptions.mBeefLibType != .Static))
+			{
+				outRt.Append("Beef", IDEApp.sRTVersionStr, "RT");
+				outRt.Append((workspaceOptions.mMachineType == .x86) ? "32" : "64");
+				switch (options.mBuildOptions.mBeefLibType)
+				{
+				case .Dynamic:
+				case .DynamicDebug: outRt.Append("_d");
+				case .Static:
+					switch (options.mBuildOptions.mCLibType)
+					{
+					case .None:
+					case .Dynamic, .SystemMSVCRT: outRt.Append("_s");
+					case .DynamicDebug: outRt.Append("_sd");
+					case .Static: outRt.Append("_ss");
+					case .StaticDebug: outRt.Append("_ssd");
+					}
+				}
+				outRt.Append(dynName ? ".dll" : ".lib");
+			}
+
+			if ((workspaceOptions.mEnableObjectDebugFlags) || (workspaceOptions.mAllocType == .Debug))
+			{
+				outDbg.Append("Beef", IDEApp.sRTVersionStr, "Dbg");
+				outDbg.Append((workspaceOptions.mMachineType == .x86) ? "32" : "64");
+				if (options.mBuildOptions.mBeefLibType == .DynamicDebug)
+					outDbg.Append("_d");
+				outDbg.Append(dynName ? ".dll" : ".lib");
+			}
+
+			/*if ((workspaceOptions.mEnableObjectDebugFlags) &&
+				((!dynName) || (options.mBuildOptions.mBeefLibType != .Static)))
+			{
+				outDbg.Append("Beef", IDEApp.sRTVersionStr, "Dbg");
+				outDbg.Append((workspaceOptions.mMachineType == .x86) ? "32" : "64");
+				switch (options.mBuildOptions.mBeefLibType)
+				{
+				case .Dynamic:
+				case .DynamicDebug: outDbg.Append("_d");
+				case .Static:
+					switch (options.mBuildOptions.mCLibType)
+					{
+					case .None:
+					case .Dynamic, .SystemMSVCRT: outDbg.Append("_s");
+					case .DynamicDebug: outDbg.Append("_sd");
+					case .Static: outDbg.Append("_ss");
+					case .StaticDebug: outDbg.Append("_ssd");
+					}
+				}
+				outDbg.Append(dynName ? ".dll" : ".lib");
+			}*/
+		}
+
+		bool QueueProjectMSLink(Project project, String targetPath, String configName, Workspace.Options workspaceOptions, Project.Options options, String objectsArg)
+		{
+			String llvmDir = scope String(IDEApp.sApp.mInstallDir);
+			IDEUtils.FixFilePath(llvmDir);
+			llvmDir.Append("llvm/");
+
+			TestManager.ProjectInfo testProjectInfo = null;
+			if (gApp.mTestManager != null)
+				testProjectInfo = gApp.mTestManager.GetProjectInfo(project);
+
+			bool isExe = (project.mGeneralOptions.mTargetType != Project.TargetType.BeefLib) || (testProjectInfo != null);
+			if (isExe)
+			{
+				String linkLine = scope String();
+			    
+			    linkLine.Append("-out:");
+			    IDEUtils.AppendWithOptionalQuotes(linkLine, targetPath);
+			    linkLine.Append(" ");
+
+				if (testProjectInfo != null)
+					linkLine.Append("-subsystem:console ");
+			    else if (project.mGeneralOptions.mTargetType == .BeefWindowsApplication)
+					linkLine.Append("-subsystem:windows ");
+			    else if (project.mGeneralOptions.mTargetType == .C_WindowsApplication)
+			    	linkLine.Append("-subsystem:console ");
+				else if (project.mGeneralOptions.mTargetType == .BeefDynLib)
+				{
+					linkLine.Append("-dll ");
+
+					if (targetPath.EndsWith(".dll", .InvariantCultureIgnoreCase))
+					{
+						linkLine.Append("-implib:\"");
+						linkLine.Append(targetPath, 0, targetPath.Length - 4);
+						linkLine.Append(".lib\" ");
+					}
+				}
+
+			    linkLine.Append(objectsArg);
+
+				//var destDir = scope String();
+				//Path.GetDirectoryName();
+
+				//TODO: Allow selecting lib file.  Check date when copying instead of just ALWAYS copying...
+				LibBlock:
+			    {
+			        List<String> stdLibFileNames = scope .(2);
+			        String fromDir;
+			        
+		            fromDir = scope String(gApp.mInstallDir);
+
+					bool AddLib(String dllName)
+					{
+						stdLibFileNames.Add(dllName);
+
+						String fromPath = scope String(fromDir, dllName);
+						String toPath = scope String();
+						Path.GetDirectoryPath(targetPath, toPath);
+						toPath.Append("/", dllName);
+						if (File.CopyIfNewer(fromPath, toPath) case .Err)
+						{
+							gApp.OutputLine("Failed to copy lib file {0}", fromPath);
+							return false;
+						}
+						return true;
+					}
+
+					String rtName = scope String();
+					String dbgName = scope String();
+					GetRtLibNames(workspaceOptions, options, true, rtName, dbgName);
+					if (!rtName.IsEmpty)
+						if (!AddLib(rtName))
+							return false;
+					if (!dbgName.IsEmpty)
+						if (!AddLib(dbgName))
+							return false;
+					switch (workspaceOptions.mAllocType)
+					{
+					case .JEMalloc:
+						if (!AddLib("jemalloc.dll"))
+							return false;
+					default:
+					}
+			    }
+
+			    List<Project> depProjectList = scope List<Project>();
+			    gApp.GetDependentProjectList(project, depProjectList);
+			    if (depProjectList.Count > 0)
+			    {
+			        for (var dep in project.mDependencies)
+			        {
+			            var depProject = gApp.mWorkspace.FindProject(dep.mProjectName);
+			            if (depProject == null)
+			            {
+			                gApp.OutputLine("Failed to locate dependent library: {0}", dep.mProjectName);
+			                return false;
+			            }
+			            else
+			            {
+			                /*if (depProject.mNeedsTargetRebuild)
+			                    project.mNeedsTargetRebuild = true;*/
+
+			                var depOptions = gApp.GetCurProjectOptions(depProject);
+							if (depOptions != null)
+							{
+								if (depOptions.mClangObjectFiles != null)
+		                        {
+									var argBuilder = scope IDEApp.ArgBuilder(linkLine, true);
+
+									for (var fileName in depOptions.mClangObjectFiles)
+									{
+										//AppendWithOptionalQuotes(linkLine, fileName);
+										argBuilder.AddFileName(fileName);
+										argBuilder.AddSep();
+									}
+								}    
+							}
+
+							if (depProject.mGeneralOptions.mTargetType == .BeefDynLib)
+							{
+								if (mImpLibMap.TryGetValue(depProject, var libPath))
+								{
+									IDEUtils.AppendWithOptionalQuotes(linkLine, libPath);
+									linkLine.Append(" ");
+								}
+							}
+
+
+			                /*String depLibTargetPath = scope String();
+			                ResolveConfigString(depProject, depOptions, "$(TargetPath)", error, depLibTargetPath);
+							IDEUtils.FixFilePath(depLibTargetPath);
+
+			                String depDir = scope String();
+			                Path.GetDirectoryName(depLibTargetPath, depDir);
+			                String depFileName = scope String();
+			                Path.GetFileNameWithoutExtension(depLibTargetPath, depFileName);
+
+							AppendWithOptionalQuotes(linkLine, depLibTargetPath);
+							linkLine.Append(" ");*/
+			            }
+			        }
+			    }
+
+			    if (project.mNeedsTargetRebuild)
+			    {
+			        /*if (File.Delete(targetPath).Failed(true))
+					{
+					    OutputLine("Failed to delete {0}", targetPath);
+					    return false;
+					}*/
+
+					switch (options.mBuildOptions.mCLibType)
+					{
+					case .None:
+						linkLine.Append("-nodefaultlib ");
+					case .Dynamic:
+						//linkLine.Append((workspaceOptions.mMachineType == .x86) ? "-defaultlib:msvcprt " : "-defaultlib:msvcrt ");
+						linkLine.Append("-defaultlib:msvcrt ");
+					case .Static:
+						//linkLine.Append((workspaceOptions.mMachineType == .x86) ? "-defaultlib:libcpmt " : "-defaultlib:libcmt ");
+						linkLine.Append("-defaultlib:libcmt ");
+					case .DynamicDebug:
+						//linkLine.Append((workspaceOptions.mMachineType == .x86) ? "-defaultlib:msvcprtd " : "-defaultlib:msvcrtd ");
+						linkLine.Append("-defaultlib:msvcrtd ");
+					case .StaticDebug:
+						//linkLine.Append((workspaceOptions.mMachineType == .x86) ? "-defaultlib:libcpmtd " : "-defaultlib:libcmtd ");
+						linkLine.Append("-defaultlib:libcmtd ");
+					case .SystemMSVCRT:
+						linkLine.Append("-nodefaultlib ");
+
+						String minRTModName = scope String();
+						if ((project.mGeneralOptions.mTargetType == .BeefWindowsApplication) ||
+							(project.mGeneralOptions.mTargetType == .C_WindowsApplication))
+							minRTModName.Append("g");
+						if (options.mBuildOptions.mBeefLibType == .DynamicDebug)
+							minRTModName.Append("d");
+						if (!minRTModName.IsEmpty)
+							minRTModName.Insert(0, "_");
+
+						if (workspaceOptions.mMachineType == .x86)
+							linkLine.Append(gApp.mInstallDir, @"lib\x86\msvcrt.lib Beef", IDEApp.sRTVersionStr,"MinRT32", minRTModName, ".lib ");
+						else
+							linkLine.Append(gApp.mInstallDir, @"lib\x64\msvcrt.lib Beef", IDEApp.sRTVersionStr,"MinRT64", minRTModName, ".lib ");
+						linkLine.Append("ntdll.lib user32.lib kernel32.lib gdi32.lib winmm.lib shell32.lib ole32.lib rpcrt4.lib chkstk.obj -ignore:4049 -ignore:4217 ");
+					}
+					linkLine.Append("-nologo ");
+					//linkLine.Append("-fixed ");
+
+					// Incremental just seems to be slower for Beef.  Test on larger projects to verify
+					linkLine.Append("-incremental:no ");
+
+					if (options.mBuildOptions.mStackSize > 0)
+						linkLine.AppendF("-stack:{} ", options.mBuildOptions.mStackSize);
+
+					linkLine.Append("-pdb:");
+					let pdbName = scope String();
+					GetPdbPath(targetPath, workspaceOptions, options, pdbName);
+					IDEUtils.AppendWithOptionalQuotes(linkLine, pdbName);
+					linkLine.Append(" ");
+
+					//TODO: Only add -debug if we have some debug info?
+					//if (isDebug)
+					if (workspaceOptions.mEmitDebugInfo != .No)
+						linkLine.Append("-debug ");
+
+					if (workspaceOptions.mBfOptimizationLevel.IsOptimized())
+						//linkLine.Append("-opt:ref -verbose ");
+						linkLine.Append("-opt:ref ");
+					else
+						linkLine.Append("-opt:noref ");
+
+					if (workspaceOptions.mMachineType == .x86)
+					{
+						//linkLine.Append("-libpath:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.10586.0\\ucrt\\x86\" ");
+						for (var libPath in gApp.mSettings.mVSSettings.mLib32Paths)
+						{
+							linkLine.AppendF("-libpath:\"{0}\" ", libPath);
+						}
+						linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x86\" ");
+					}
+					else
+					{
+						/*linkLine.Append("-libpath:\"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\lib\\amd64\" ");
+						linkLine.Append("-libpath:\"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\atlmfc\\lib\\amd64\" ");
+						linkLine.Append("-libpath:\"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.14393.0\\ucrt\\x64\" ");
+						linkLine.Append("-libpath:\"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.14393.0\\um\\x64\" ");*/
+						for (var libPath in gApp.mSettings.mVSSettings.mLib64Paths)
+						{
+							linkLine.AppendF("-libpath:\"{0}\" ", libPath);
+						}
+						linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x64\" ");
+					}
+
+					String targetDir = scope String();
+					Path.GetDirectoryPath(targetPath, targetDir);
+					linkLine.Append("-libpath:");
+					IDEUtils.AppendWithOptionalQuotes(linkLine, targetDir);
+					linkLine.Append(" ");
+
+					if (options.mBuildOptions.mOtherLinkFlags.Length != 0)
+					{
+						var linkFlags = scope String();
+						gApp.ResolveConfigString(workspaceOptions, project, options, options.mBuildOptions.mOtherLinkFlags, "link flags", linkFlags);
+						linkLine.Append(linkFlags, " ");
+					}
+
+					let winOptions = project.mWindowsOptions;
+					/*if (!String.IsNullOrWhiteSpace(project.mWindowsOptions.mManifestFile))
+					{
+						String manifestPath = scope String();
+						String error = scope String();
+						ResolveConfigString(project, options, winOptions.mManifestFile, error, manifestPath);
+						if (!manifestPath.IsWhiteSpace)
+						{
+							linkLine.Append("/MANIFEST:EMBED /MANIFESTINPUT:");
+							IDEUtils.AppendWithOptionalQuotes(linkLine, manifestPath);
+							linkLine.Append(" ");
+						}
+					}*/
+
+					// Put back
+					if ((!String.IsNullOrWhiteSpace(project.mWindowsOptions.mIconFile)) ||
+						(!String.IsNullOrWhiteSpace(project.mWindowsOptions.mManifestFile)) ||
+		                (winOptions.HasVersionInfo()))
+					{						
+						String projectBuildDir = scope String();
+						gApp.GetProjectBuildDir(project, projectBuildDir);
+
+						String resOutPath = scope String();
+						resOutPath.Append(projectBuildDir, "\\Resource.res");
+
+						String iconPath = scope String();
+						gApp.ResolveConfigString(workspaceOptions, project, options, winOptions.mIconFile, "icon file", iconPath);
+						
+						// Generate resource
+						Result<void> CreateResourceFile()
+						{
+		                    ResourceGen resGen = scope ResourceGen();
+							if (resGen.Start(resOutPath) case .Err)
+							{
+								gApp.OutputErrorLine("Failed to create resource file '{0}'", resOutPath);
+								return .Err;
+							}
+							if (!iconPath.IsWhiteSpace)
+							{
+								Path.GetAbsolutePath(scope String(iconPath), project.mProjectDir, iconPath..Clear());
+								if (resGen.AddIcon(iconPath) case .Err)
+								{
+									gApp.OutputErrorLine("Failed to add icon");
+									return .Err;
+								}
+							}
+
+							let targetFileName = scope String();
+							Path.GetFileName(targetPath, targetFileName);
+
+							if (resGen.AddVersion(winOptions.mDescription, winOptions.mComments, winOptions.mCompany, winOptions.mProduct,
+		                        winOptions.mCopyright, winOptions.mFileVersion, winOptions.mProductVersion, targetFileName) case .Err)
+							{
+								gApp.OutputErrorLine("Failed to add version");
+								return .Err;
+							}
+
+							String manifestPath = scope String();
+							gApp.ResolveConfigString(workspaceOptions, project, options, winOptions.mManifestFile, "manifest file", manifestPath);
+							if (!manifestPath.IsWhiteSpace)
+							{
+								Path.GetAbsolutePath(scope String(manifestPath), project.mProjectDir, manifestPath..Clear());
+								if (resGen.AddManifest(manifestPath) case .Err)
+								{
+									gApp.OutputErrorLine("Failed to add manifest file");
+									return .Err;
+								}
+							}
+
+							Try!(resGen.Finish());
+							return .Ok;
+						}
+
+						if (CreateResourceFile() case .Err)
+						{
+							gApp.OutputErrorLine("Failed to generate resource file: {0}", resOutPath);
+							return false;
+						}
+
+						IDEUtils.AppendWithOptionalQuotes(linkLine, resOutPath);
+					}
+					
+
+			        //String linkerPath = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe";
+
+					let binPath = (workspaceOptions.mMachineType == .x86) ? gApp.mSettings.mVSSettings.mBin32Path : gApp.mSettings.mVSSettings.mBin64Path;
+					if (binPath.IsWhiteSpace)
+					{
+						gApp.OutputErrorLine("Visual Studio tool path not configured. Check Visual Studio configuration in File\\Preferences\\Settings.");
+						return false;
+					}
+
+					String linkerPath = scope String();
+					linkerPath.Append(binPath);
+					linkerPath.Append("/link.exe");
+					if (workspaceOptions.mToolsetType == .LLVM)
+					{
+						linkerPath.Clear();
+						linkerPath.Append(gApp.mInstallDir);
+						linkerPath.Append(@"llvm\bin\lld-link.exe");
+						//linkerPath = @"C:\Program Files\LLVM\bin\lld-link.exe";
+
+						var ltoType = workspaceOptions.mLTOType;
+						if (options.mBeefOptions.mLTOType != null)
+							ltoType = options.mBeefOptions.mLTOType.Value;
+
+						if (ltoType == .Thin)
+						{
+							linkLine.Append(" /lldltocache:");
+
+							String ltoPath = scope String();
+							Path.GetDirectoryPath(targetPath, ltoPath);
+							ltoPath.Append("/ltocache");
+							IDEUtils.AppendWithOptionalQuotes(linkLine, ltoPath);
+						}
+					}
+					//String linkerPath = "C:\\Beef\\IDE\\dist\\BeefLink.exe";
+
+					//QueueRun(compilerExePath, linkLine, @"c:\mingw\bin", (options.mGeneralOptions.mLinkerType == Project.LinkerType.Clang) && (linkLine.Length > 1024));
+					//QueueRun(compilerExePath, linkLine, @"c:\mingw\bin", (linkLine.Length > 1024));
+
+			        var runCmd = gApp.QueueRun(linkerPath, linkLine, gApp.mInstallDir, .UTF16WithBom);
+			        runCmd.mOnlyIfNotFailed = true;
+			        var tagetCompletedCmd = new IDEApp.TargetCompletedCmd(project);
+			        tagetCompletedCmd.mOnlyIfNotFailed = true;
+			        gApp.mExecutionQueue.Add(tagetCompletedCmd);
+
+					String logStr = scope String();
+					logStr.AppendF("IDE Process {0}\r\n", Platform.BfpProcess_GetCurrentId());
+					logStr.Append(linkLine);
+					String targetLogPath = scope String(targetPath, ".build.txt");
+					Utils.WriteTextFile(targetLogPath, logStr);
+
+					project.mLastDidBuild = true;
+			    }
+			}
+
+			return true;
+		}
+
+		public bool QueueProjectCompile(Project project, Project hotProject, IDEApp.BuildCompletedCmd completedCompileCmd, List<String> hotFileNames, bool runAfter)
+		{
+			project.mLastDidBuild = false;
+
+			TestManager.ProjectInfo testProjectInfo = null;
+			if (gApp.mTestManager != null)
+				testProjectInfo = gApp.mTestManager.GetProjectInfo(project);
+
+			var configSelection = gApp.GetCurConfigSelection(project);
+		    Project.Options options = gApp.GetCurProjectOptions(project);
+		    if (options == null)
+		        return true;
+
+		    Workspace.Options workspaceOptions = gApp.GetCurWorkspaceOptions();
+		    BfCompiler bfCompiler = gApp.mBfBuildCompiler;            
+		    var bfProject = gApp.mBfBuildSystem.mProjectMap[project];
+		    bool bfHadOutputChanges;
+		    List<String> bfFileNames = scope List<String>();
+			bfCompiler.GetOutputFileNames(bfProject, true, out bfHadOutputChanges, bfFileNames);
+			defer ClearAndDeleteItems(bfFileNames);//DeleteAndClearItems!(bfFileNames);
+		    if (bfHadOutputChanges)
+		        project.mNeedsTargetRebuild = true;
+
+		    List<ProjectSource> allFileNames = scope List<ProjectSource>();
+		    List<String> clangAllObjNames = scope List<String>();
+		    //List<String> clangObjNames = scope List<String>();            
+
+		    gApp.GetClangFiles(project.mRootFolder, allFileNames);
+
+		    String workspaceBuildDir = scope String();
+		    gApp.GetWorkspaceBuildDir(workspaceBuildDir);
+		    String projectBuildDir = scope String();
+		    gApp.GetProjectBuildDir(project, projectBuildDir);
+			if (!projectBuildDir.IsEmpty)
+		    	Directory.CreateDirectory(projectBuildDir).IgnoreError();
+
+		    //List<String> buildFileNames = new List<String>();
+
+			String targetPath = scope String();
+
+		    String outputDir = scope String();
+			String absOutputDir = scope String();
+			
+			if (testProjectInfo != null)
+			{
+				absOutputDir.Append(projectBuildDir);
+				outputDir = absOutputDir;
+				targetPath.Append(outputDir, "/", project.mProjectName);
+#if BF_PLATFORM_WINDOWS
+				targetPath.Append(".exe");
+#endif
+
+				Debug.Assert(testProjectInfo.mTestExePath == null);
+				testProjectInfo.mTestExePath = new String(targetPath);
+			}
+			else
+		    {
+				gApp.ResolveConfigString(workspaceOptions, project, options, options.mBuildOptions.mTargetDirectory, "target directory", outputDir);
+				Path.GetAbsolutePath(project.mProjectDir, outputDir, absOutputDir);
+				outputDir = absOutputDir;
+				gApp.ResolveConfigString(workspaceOptions, project, options, "$(TargetPath)", "target path", targetPath);
+			}
+			IDEUtils.FixFilePath(targetPath);
+		    if (!File.Exists(targetPath))
+			{
+		        project.mNeedsTargetRebuild = true;
+
+				String targetDir = scope String();
+				Path.GetDirectoryPath(targetPath, targetDir);
+				if (!targetDir.IsEmpty)
+					Directory.CreateDirectory(targetDir).IgnoreError();
+			}
+
+			if (project.mGeneralOptions.mTargetType == .BeefDynLib)
+			{
+				if (targetPath.EndsWith(".dll", .InvariantCultureIgnoreCase))
+				{
+					String libPath = new .();
+					libPath.Append(targetPath, 0, targetPath.Length - 4);
+					libPath.Append(".lib");
+					mImpLibMap.Add(project, libPath);
+				}
+			}
+
+			switch (QueueProjectCustomBuildCommands(project, targetPath, runAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPostBuildCmds))
+			{
+			case .NoCommands:
+			case .HadCommands:
+			case .Failed:
+				completedCompileCmd.mFailed = true;
+			}
+				
+			if (project.mGeneralOptions.mTargetType == .CustomBuild)
+			{
+				return true; 
+			}
+
+#if IDE_C_SUPPORT
+		    bool buildAll = false;
+		    String buildStringFilePath = scope String();
+		    mDepClang.GetBuildStringFileName(projectBuildDir, project, buildStringFilePath);
+		    String newBuildString = scope String();
+		    GetClangBuildString(project, options, workspaceOptions, true, newBuildString);
+			String clangBuildString = scope String();
+			GetClangBuildString(project, options, workspaceOptions, false, clangBuildString);
+		    newBuildString.Append("|", clangBuildString);
+
+		    if (mDepClang.mDoDependencyCheck)
+		    {   
+		     	String prependStr = scope String();
+				options.mCOptions.mCompilerType.ToString(prependStr);
+				prependStr.Append("|");
+		        newBuildString.Insert(0, prependStr);
+		        String oldBuildString;
+		        mDepClang.mProjectBuildString.TryGetValue(project, out oldBuildString);
+
+				if (oldBuildString == null)
+				{
+					oldBuildString = new String();
+		            File.ReadAllText(buildStringFilePath, oldBuildString).IgnoreError();
+					mDepClang.mProjectBuildString[project] = oldBuildString;
+				}
+
+		        if (newBuildString != oldBuildString)
+		        {
+		            buildAll = true;
+		            
+		            if (case .Err = File.WriteAllText(buildStringFilePath, newBuildString))
+						OutputLine("Failed to write {0}", buildStringFilePath);
+					
+					delete oldBuildString;
+		            mDepClang.mProjectBuildString[project] = new String(newBuildString);
+		        }
+		    }            			
+
+		    using (mDepClang.mMonitor.Enter())
+		    {
+				if (options.mClangObjectFiles == null)
+					options.mClangObjectFiles = new List<String>();
+				else
+					ClearAndDeleteItems(options.mClangObjectFiles);
+
+		        for (var projectSource in allFileNames)
+		        {
+		            var fileEntry = mDepClang.GetProjectEntry(projectSource);
+		            Debug.Assert((fileEntry != null) || (!mDepClang.mCompileWaitsForQueueEmpty));
+
+		            String filePath = scope String();
+		            projectSource.GetFullImportPath(filePath);
+		            String baseName = scope String();
+		            Path.GetFileNameWithoutExtension(filePath, baseName);
+		            String objName = stack String();
+		            objName.Append(projectBuildDir, "/", baseName, (options.mCOptions.mGenerateLLVMAsm ? ".ll" : ".obj"));
+
+					if (filePath.Contains("test2.cpp"))
+					{
+						NOP!();
+					}	
+
+		            bool needsRebuild = true;
+		            if ((!buildAll) && (fileEntry != null))
+		            {
+		                mDepClang.SetEntryObjFileName(fileEntry, objName);
+		                mDepClang.SetEntryBuildStringFileName(fileEntry, buildStringFilePath);                        
+		                needsRebuild = mDepClang.DoesEntryNeedRebuild(fileEntry);
+		            }
+		            if (needsRebuild)
+		            {
+		                if (hotProject != null)
+		                {
+		                    OutputLine("Hot swap detected disallowed C/C++ change: {0}", filePath);                            
+		                    return false;
+		                }
+
+		                project.mNeedsTargetRebuild = true;                        
+		                var runCmd = CompileSource(project, workspaceOptions, options, filePath);
+		                runCmd.mParallelGroup = 1;
+		            }
+
+					options.mClangObjectFiles.Add(new String(objName));
+
+					if (hotProject != null)
+						continue;
+
+		            clangAllObjNames.Add(objName);
+
+		            IdSpan sourceCharIdData;
+		            String sourceCode = scope String();
+		            FindProjectSourceContent(projectSource, out sourceCharIdData, true, sourceCode);
+		            mWorkspace.ProjectSourceCompiled(projectSource, sourceCode, sourceCharIdData);
+					sourceCharIdData.Dispose();
+
+					String* fileEntryPtr;
+		            if (completedCompileCmd.mClangCompiledFiles.Add(filePath, out fileEntryPtr))
+						*fileEntryPtr = new String(filePath);
+		        }
+		    }
+#endif
+
+		    String llvmDir = scope String(IDEApp.sApp.mInstallDir);
+		    IDEUtils.FixFilePath(llvmDir);
+		    llvmDir.Append("llvm/");
+		    
+		    if (hotProject != null)
+		    {
+		        if ((hotProject == project) || (hotProject.HasDependency(project.mProjectName)))
+		        {
+		            for (var fileName in bfFileNames)
+		                hotFileNames.Add(new String(fileName));
+		        }
+		    
+		        return true;
+		    }
+
+		    String objectsArg = scope String();
+			var argBuilder = scope IDEApp.ArgBuilder(objectsArg, workspaceOptions.mToolsetType != .GNU);
+		    for (var bfFileName in bfFileNames)
+		    {
+				argBuilder.AddFileName(bfFileName);
+				argBuilder.AddSep();
+		    }
+
+		    for (var objName in clangAllObjNames)
+		    {                
+		        IDEUtils.AppendWithOptionalQuotes(objectsArg, objName);
+		        objectsArg.Append(" ");
+		    }
+
+			if (workspaceOptions.mToolsetType == .GNU)
+			{
+				if (!QueueProjectGNULink(project, targetPath, workspaceOptions, options, objectsArg))
+					return false;
+			}
+			else // MS
+			{
+				if (!QueueProjectMSLink(project, targetPath, configSelection.mConfig, workspaceOptions, options, objectsArg))
+					return false;
+			}
+
+		    return true;
+		}
+	}
+}

+ 0 - 1
IDE/src/Clang/ClangCompiler.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 using System.IO;
 using Beefy.widgets;

+ 0 - 1
IDE/src/Clang/ClangHelper.bf

@@ -5,7 +5,6 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using Beefy.widgets;
 using IDE.Compiler;
 

+ 0 - 1
IDE/src/Compiler/BfCompiler.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using System.Threading;
 using System.Diagnostics;
 using Beefy.widgets;

+ 0 - 1
IDE/src/Compiler/BfParser.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 using Beefy.widgets;
 using Beefy.utils;

+ 0 - 1
IDE/src/Compiler/BfPassInstance.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using Beefy.utils;
 using System.Diagnostics;
 using System.Threading;

+ 0 - 1
IDE/src/Compiler/BfProject.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 
 namespace IDE.Compiler

+ 0 - 1
IDE/src/Compiler/BfResolvePassData.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 
 namespace IDE.Compiler
 {

+ 0 - 1
IDE/src/Compiler/BfSystem.bf

@@ -3,7 +3,6 @@ using System.Collections.Generic;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 
 namespace IDE.Compiler

+ 0 - 1
IDE/src/Debugger/Breakpoint.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using Beefy.gfx;
 using Beefy.theme.dark;
 using System.IO;

+ 0 - 1
IDE/src/Debugger/Callbacks.bf

@@ -1,5 +1,4 @@
 using System;
-using System.Runtime.InteropServices;
 using IDE;
 
 namespace Debugger

+ 0 - 1
IDE/src/Debugger/DebugManager.bf

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices;
 using System.Diagnostics;
 using Beefy.utils;
 using IDE.util;

部分文件因文件數量過多而無法顯示