Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
304800ec
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
304800ec
编写于
1月 28, 2019
作者:
D
dotnet-automerge-bot
提交者:
GitHub
1月 28, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #32892 from dotnet/merges/master-to-dev16.1-preview1
Merge master to dev16.1-preview1
上级
adc50b04
6343601c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
8 deletion
+48
-8
src/Compilers/CSharp/Portable/FlowAnalysis/UnassignedAddressTakenVariablesWalker.cs
...ble/FlowAnalysis/UnassignedAddressTakenVariablesWalker.cs
+1
-2
src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.cs
...p/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.cs
+2
-2
src/Test/Utilities/Portable/Compilation/CompilationExtensions.cs
...t/Utilities/Portable/Compilation/CompilationExtensions.cs
+2
-1
src/Test/Utilities/Portable/Compilation/IRuntimeEnvironment.cs
...est/Utilities/Portable/Compilation/IRuntimeEnvironment.cs
+43
-3
未找到文件。
src/Compilers/CSharp/Portable/FlowAnalysis/UnassignedAddressTakenVariablesWalker.cs
浏览文件 @
304800ec
...
...
@@ -9,8 +9,7 @@
namespace
Microsoft.CodeAnalysis.CSharp
{
/// <summary>
/// An analysis that computes the set of variables that may be used
/// before being assigned anywhere within a method.
/// An analysis that computes all cases where the address is taken of a variable that has not yet been assigned
/// </summary>
internal
class
UnassignedAddressTakenVariablesWalker
:
DefiniteAssignmentPass
{
...
...
src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.cs
浏览文件 @
304800ec
...
...
@@ -1626,7 +1626,7 @@ static void M()
}"
;
var
compilation0
=
CreateCompilation
(
source0
,
options
:
TestOptions
.
DebugDll
);
var
v0
=
CompileAndVerify
(
compilation0
);
var
v0
=
CompileAndVerify
(
compilation0
,
emitOptions
:
EmitOptions
.
Default
);
v0
.
VerifyIL
(
"C.M"
,
@"
{
// Code size 93 (0x5d)
...
...
@@ -2167,7 +2167,7 @@ static void M()
var
compilation0
=
CreateCompilation
(
source0
,
options
:
TestOptions
.
DebugDll
);
var
compilation1
=
compilation0
.
WithSource
(
source1
);
var
v0
=
CompileAndVerify
(
compilation0
);
var
v0
=
CompileAndVerify
(
compilation0
,
emitOptions
:
EmitOptions
.
Default
);
// Validate presence of a hidden sequence point @IL_0007 that is required for proper function remapping.
v0
.
VerifyIL
(
"C.M"
,
@"
...
...
src/Test/Utilities/Portable/Compilation/CompilationExtensions.cs
浏览文件 @
304800ec
...
...
@@ -48,7 +48,8 @@ public static class CompilationExtensions
options
=
(
options
??
EmitOptions
.
Default
).
WithDebugInformationFormat
(
DebugInformationFormat
.
PortablePdb
);
}
pdbStream
=
new
MemoryStream
();
var
discretePdb
=
(
object
)
options
!=
null
&&
options
.
DebugInformationFormat
!=
DebugInformationFormat
.
Embedded
;
pdbStream
=
discretePdb
?
new
MemoryStream
()
:
null
;
}
var
emitResult
=
compilation
.
Emit
(
...
...
src/Test/Utilities/Portable/Compilation/IRuntimeEnvironment.cs
浏览文件 @
304800ec
...
...
@@ -6,6 +6,9 @@
using
System.IO
;
using
System.Linq
;
using
System.Reflection
;
using
System.Reflection.Metadata
;
using
System.Reflection.PortableExecutable
;
using
System.Runtime.InteropServices
;
using
System.Text
;
using
System.Threading
;
using
Microsoft.CodeAnalysis
;
...
...
@@ -42,7 +45,33 @@ internal struct EmitOutput
internal
EmitOutput
(
ImmutableArray
<
byte
>
assembly
,
ImmutableArray
<
byte
>
pdb
)
{
Assembly
=
assembly
;
if
(
pdb
.
IsDefault
)
{
// We didn't emit a discrete PDB file, so we'll look for an embedded PDB instead.
using
(
var
peReader
=
new
PEReader
(
Assembly
))
{
DebugDirectoryEntry
portablePdbEntry
=
peReader
.
ReadDebugDirectory
().
FirstOrDefault
(
e
=>
e
.
Type
==
DebugDirectoryEntryType
.
EmbeddedPortablePdb
);
if
(
portablePdbEntry
.
DataSize
!=
0
)
{
using
(
var
embeddedMetadataProvider
=
peReader
.
ReadEmbeddedPortablePdbDebugDirectoryData
(
portablePdbEntry
))
{
var
mdReader
=
embeddedMetadataProvider
.
GetMetadataReader
();
pdb
=
readMetadata
(
mdReader
);
}
}
}
}
Pdb
=
pdb
;
unsafe
ImmutableArray
<
byte
>
readMetadata
(
MetadataReader
mdReader
)
{
var
length
=
mdReader
.
MetadataLength
;
var
bytes
=
new
byte
[
length
];
Marshal
.
Copy
((
IntPtr
)
mdReader
.
MetadataPointer
,
bytes
,
0
,
length
);
return
ImmutableArray
.
Create
(
bytes
);
}
}
}
...
...
@@ -202,11 +231,22 @@ EmitOptions emitOptions
EmitOptions
emitOptions
)
{
if
(
emitOptions
is
null
)
{
emitOptions
=
EmitOptions
.
Default
.
WithDebugInformationFormat
(
DebugInformationFormat
.
Embedded
);
}
using
(
var
executableStream
=
new
MemoryStream
())
{
var
pdb
=
default
(
ImmutableArray
<
byte
>);
var
assembly
=
default
(
ImmutableArray
<
byte
>);
var
pdbStream
=
new
MemoryStream
();
var
pdbStream
=
(
emitOptions
.
DebugInformationFormat
!=
DebugInformationFormat
.
Embedded
)
?
new
MemoryStream
()
:
null
;
var
embeddedTexts
=
compilation
.
SyntaxTrees
.
Select
(
t
=>
(
filePath
:
t
.
FilePath
,
text
:
t
.
GetText
()))
.
Where
(
t
=>
t
.
text
.
CanBeEmbedded
&&
!
string
.
IsNullOrEmpty
(
t
.
filePath
))
.
Select
(
t
=>
EmbeddedText
.
FromSource
(
t
.
filePath
,
t
.
text
))
.
ToImmutableArray
();
EmitResult
result
;
try
...
...
@@ -221,9 +261,9 @@ EmitOptions emitOptions
options
:
emitOptions
,
debugEntryPoint
:
null
,
sourceLinkStream
:
null
,
embeddedTexts
:
null
,
embeddedTexts
,
testData
:
testData
,
cancellationToken
:
default
(
CancellationToken
)
);
cancellationToken
:
default
);
}
finally
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录