Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -24,7 +24,9 @@
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
#if !NO_SYMBOL_WRITER
using System.Diagnostics.SymbolStore;
#endif
using System.Diagnostics;
using IKVM.Reflection.Writer;
@@ -110,7 +112,9 @@ namespace IKVM.Reflection.Emit
private readonly List<int> labels = new List<int>();
private readonly List<int> labelStackHeight = new List<int>();
private readonly List<LabelFixup> labelFixups = new List<LabelFixup>();
#if !NO_SYMBOL_WRITER
private readonly List<SequencePoint> sequencePoints = new List<SequencePoint>();
#endif
private readonly List<ExceptionBlock> exceptions = new List<ExceptionBlock>();
private readonly Stack<ExceptionBlock> exceptionStack = new Stack<ExceptionBlock>();
private ushort maxStack;
@@ -183,12 +187,14 @@ namespace IKVM.Reflection.Emit
private struct SequencePoint
{
#if !NO_SYMBOL_WRITER
internal ISymbolDocumentWriter document;
internal int offset;
internal int startLine;
internal int startColumn;
internal int endLine;
internal int endColumn;
#endif
}
private sealed class Scope
@@ -402,10 +408,12 @@ namespace IKVM.Reflection.Emit
public void UsingNamespace(string usingNamespace)
{
#if !NO_SYMBOL_WRITER
if (moduleBuilder.symbolWriter != null)
{
moduleBuilder.symbolWriter.UsingNamespace(usingNamespace);
}
#endif
}
public LocalBuilder DeclareLocal(Type localType)
@@ -882,6 +890,7 @@ namespace IKVM.Reflection.Emit
}
}
#if !NO_SYMBOL_WRITER
public void MarkSequencePoint(ISymbolDocumentWriter document, int startLine, int startColumn, int endLine, int endColumn)
{
SequencePoint sp = new SequencePoint();
@@ -893,6 +902,7 @@ namespace IKVM.Reflection.Emit
sp.endColumn = endColumn;
sequencePoints.Add(sp);
}
#endif
public void ThrowException(Type excType)
{
@@ -928,6 +938,7 @@ namespace IKVM.Reflection.Emit
rva = WriteFatHeaderAndCode(bb, localVarSigTok, initLocals);
}
#if !NO_SYMBOL_WRITER
if (moduleBuilder.symbolWriter != null)
{
if (sequencePoints.Count != 0)
@@ -955,6 +966,7 @@ namespace IKVM.Reflection.Emit
WriteScope(scope, localVarSigTok);
}
#endif
return rva;
}
@@ -1111,6 +1123,7 @@ namespace IKVM.Reflection.Emit
}
}
#if !NO_SYMBOL_WRITER
private void WriteScope(Scope scope, int localVarSigTok)
{
moduleBuilder.symbolWriter.OpenScope(scope.startOffset);
@@ -1134,5 +1147,6 @@ namespace IKVM.Reflection.Emit
}
moduleBuilder.symbolWriter.CloseScope(scope.endOffset);
}
#endif
}
}