提交 13be935a 编写于 作者: T Tomas Matousek

Revert "Fix up namespaces"

This reverts commit c6a1c2c8.
上级 9d07339a
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Symbols;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
using ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode;
namespace Microsoft.CodeAnalysis.CSharp.CodeGen
{
......
......@@ -7,6 +7,7 @@
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Roslyn.Utilities;
using ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode;
namespace Microsoft.CodeAnalysis.CSharp.CodeGen
{
......
......@@ -4,11 +4,13 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode;
namespace Microsoft.CodeAnalysis.CSharp.CodeGen
{
using Roslyn.Reflection;
internal partial class CodeGenerator
{
private enum ArrayInitializerStyle
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Diagnostics;
using System.Reflection.Metadata;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
using ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode;
namespace Microsoft.CodeAnalysis.CSharp.CodeGen
{
......
......@@ -8,6 +8,7 @@
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Roslyn.Utilities;
using ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode;
namespace Microsoft.CodeAnalysis.CSharp.CodeGen
{
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Diagnostics;
using System.Reflection.Metadata;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
using ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode;
namespace Microsoft.CodeAnalysis.CSharp.CodeGen
{
......
......@@ -5,7 +5,6 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
......
......@@ -6,7 +6,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.Emit;
......@@ -16,6 +15,8 @@
namespace Microsoft.CodeAnalysis.UnitTests.Emit
{
using Roslyn.Reflection;
public class CustomDebugInfoTests
{
[Fact]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CodeGen
{
using Roslyn.Reflection;
using Roslyn.Reflection.Metadata;
internal partial class ILBuilder
{
internal enum BlockType
......
......@@ -878,7 +878,7 @@ private void RealizeBlocks()
for (int i = blockFirstMarker; i <= blockLastMarker; i++)
{
int blockOffset = _allocatedILMarkers[i].BlockOffset;
int absoluteOffset = writer.Count + blockOffset;
int absoluteOffset = writer.Position + blockOffset;
_allocatedILMarkers[i] = new ILMarker() { BlockOffset = blockOffset, AbsoluteOffset = absoluteOffset };
}
}
......
......@@ -4,11 +4,15 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CodeGen
{
using Roslyn.Reflection;
internal partial class ILBuilder
{
internal void AdjustStack(int stackAdjustment)
......
......@@ -23,6 +23,8 @@
namespace Microsoft.CodeAnalysis
{
using Roslyn.Reflection.Metadata.Ecma335;
/// <summary>
/// The compilation object is an immutable representation of a single invocation of the
/// compiler. Although immutable, a compilation is also on-demand, and will realize and cache
......
......@@ -2,11 +2,15 @@
using System;
using System.Diagnostics;
using System.Reflection.Metadata;
using System.Reflection;
using System.Reflection.Metadata.Ecma335;
using Roslyn.Reflection;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis
{
using Roslyn.Reflection;
internal enum ConstantValueTypeDiscriminator : byte
{
Nothing,
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis
{
using Roslyn.Reflection;
internal abstract class CryptographicHashProvider
{
private ImmutableArray<byte> _lazySHA1Hash;
......
......@@ -14,6 +14,9 @@
namespace Microsoft.CodeAnalysis.Emit
{
using Roslyn.Reflection.Metadata.Ecma335;
using Roslyn.Reflection.Metadata.Ecma335.Blobs;
internal sealed class DeltaMetadataWriter : MetadataWriter
{
private readonly EmitBaseline _previousGeneration;
......@@ -632,9 +635,9 @@ protected override StandaloneSignatureHandle SerializeLocalVariablesSignature(IM
var signature = local.Signature;
if (signature == null)
{
int start = writer.Count;
int start = writer.Position;
SerializeLocalVariableType(encoder.AddVariable(), local);
signature = writer.ToArray(start, writer.Count - start);
signature = writer.ToArray(start, writer.Position - start);
}
else
{
......@@ -644,6 +647,8 @@ protected override StandaloneSignatureHandle SerializeLocalVariablesSignature(IM
encInfos.Add(CreateEncLocalInfo(local, signature));
}
encoder.EndVariables();
BlobHandle blobIndex = metadata.GetOrAddBlob(writer);
localSignatureHandle = GetOrAddStandaloneSignatureHandle(blobIndex);
......
......@@ -5,11 +5,15 @@
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using Microsoft.CodeAnalysis.CodeGen;
namespace Microsoft.CodeAnalysis.Emit
{
using Roslyn.Reflection;
/// <summary>
/// Debugging information associated with the specified method that is emitted by the compiler to support Edit and Continue.
/// </summary>
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Reflection.Metadata;
using Roslyn.Reflection;
namespace Roslyn.Utilities
{
......
......@@ -21,6 +21,9 @@
namespace Microsoft.Cci
{
using Roslyn.Reflection;
using Roslyn.Reflection.PortableExecutable;
/// <summary>
/// Exception to enable callers to catch all of the exceptions originating
/// from writing PDBs. We resurface such exceptions as this type, to eventually
......
......@@ -12,6 +12,8 @@
namespace Microsoft.Cci
{
using Roslyn.Reflection.Metadata.Ecma335;
internal sealed class FullMetadataWriter : MetadataWriter
{
private readonly DefinitionIndex<ITypeDefinition> _typeDefs;
......
......@@ -3,14 +3,15 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection.Metadata;
using System.Globalization;
using Microsoft.CodeAnalysis;
using Roslyn.Utilities;
namespace Microsoft.Cci
{
using Roslyn.Reflection;
internal sealed class ManagedResource
{
private readonly Func<Stream> _streamProvider;
......
......@@ -4,11 +4,12 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection.Metadata;
using Roslyn.Utilities;
namespace Microsoft.Cci
{
using Roslyn.Reflection;
internal static class NativeResourceWriter
{
////
......@@ -247,7 +248,7 @@ private static void WriteDirectory(Directory directory, BlobBuilder writer, uint
{
int id;
string name;
uint nameOffset = (uint)dataWriter.Count + sizeOfDirectoryTree;
uint nameOffset = (uint)dataWriter.Position + sizeOfDirectoryTree;
uint directoryOffset = k;
Directory subDir = directory.Entries[i] as Directory;
if (subDir != null)
......@@ -275,7 +276,7 @@ private static void WriteDirectory(Directory directory, BlobBuilder writer, uint
IWin32Resource r = (IWin32Resource)directory.Entries[i];
id = level == 0 ? r.TypeId : level == 1 ? r.Id : (int)r.LanguageId;
name = level == 0 ? r.TypeName : level == 1 ? r.Name : null;
dataWriter.WriteUInt32((uint)(virtualAddressBase + sizeOfDirectoryTree + 16 + dataWriter.Count));
dataWriter.WriteUInt32((uint)(virtualAddressBase + sizeOfDirectoryTree + 16 + dataWriter.Position));
byte[] data = new List<byte>(r.Data).ToArray();
dataWriter.WriteUInt32((uint)data.Length);
dataWriter.WriteUInt32(r.CodePage);
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Reflection;
using Roslyn.Utilities;
using System.Reflection.Metadata;
namespace Microsoft.Cci
{
using Roslyn.Reflection;
internal sealed class PooledBlobBuilder : BlobBuilder
{
private const int PoolSize = 128;
......
......@@ -4,9 +4,12 @@ Imports System.Collections.Immutable
Imports System.Reflection.Metadata
Imports System.Runtime.InteropServices
Imports Microsoft.CodeAnalysis.CodeGen
Imports Microsoft.CodeAnalysis.Collections
Imports Microsoft.CodeAnalysis.Symbols
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Emit
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode
Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGen
Friend NotInheritable Class CodeGenerator
......
......@@ -3,6 +3,7 @@
Imports System.Reflection.Metadata
Imports Microsoft.CodeAnalysis.CodeGen
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode
Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGen
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System
Imports System.Collections.Generic
Imports System.Collections.Immutable
Imports System.Diagnostics
Imports System.Linq
Imports System.Reflection
Imports System.Reflection.Metadata
Imports System.Reflection.Metadata.Ecma335
Imports System.Runtime.InteropServices
Imports Microsoft.CodeAnalysis.CodeGen
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Imports BlobBuilder = Roslyn.Reflection.BlobBuilder
Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Imports ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode
Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGen
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Reflection.Metadata
Imports Microsoft.CodeAnalysis.CodeGen
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports PrimitiveTypeCode = Microsoft.Cci.PrimitiveTypeCode
Imports ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode
Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGen
......
......@@ -9,6 +9,7 @@ Imports System.Reflection.Metadata
Imports Microsoft.CodeAnalysis.CodeGen
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Imports ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode
Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGen
......
......@@ -3,6 +3,7 @@
Imports System.Reflection.Metadata
Imports Microsoft.CodeAnalysis.CodeGen
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode
Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGen
......
......@@ -7,6 +7,7 @@ Imports Microsoft.CodeAnalysis.CodeGen
Imports Microsoft.CodeAnalysis.Collections
Imports Microsoft.CodeAnalysis.Emit
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode
Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGen
......
......@@ -9,6 +9,7 @@
using Roslyn.Test.MetadataUtilities;
using Roslyn.Utilities;
using Cci = Microsoft.Cci;
using ILOpCode = Microsoft.CodeAnalysis.CodeGen.ILOpCode;
namespace Roslyn.Test.Utilities
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册