You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -1 +0,0 @@
|
||||
bb0089306539349ccfea3105af58ca74ffbfc0ee
|
||||
@@ -12,16 +12,18 @@ EXTRA_DISTFILES = \
|
||||
cs-parser.jay \
|
||||
mcs.exe.sources
|
||||
|
||||
LIB_REFS = System System.Core System.Xml
|
||||
|
||||
ifeq (basic, $(PROFILE))
|
||||
LOCAL_MCS_FLAGS += -r:System.dll -r:System.Core.dll -r:System.Xml.dll -debug
|
||||
|
||||
PROGRAM = basic.exe
|
||||
sourcefile = mcs.exe.sources
|
||||
else
|
||||
LIB_REFS = System System.Core System.Xml
|
||||
|
||||
PROGRAM_USE_INTERMEDIATE_FILE = true
|
||||
PROGRAM = mcs.exe
|
||||
the_libdir = $(topdir)/class/lib/build/
|
||||
LOCAL_MCS_FLAGS += -lib:$(topdir)/class/lib/build -debug
|
||||
LOCAL_MCS_FLAGS += -debug
|
||||
endif
|
||||
|
||||
LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
|
||||
|
||||
@@ -343,7 +343,7 @@ namespace Mono.CSharp {
|
||||
}
|
||||
|
||||
if (hoisted == null) {
|
||||
hoisted = new HoistedLocalVariable (this, localVariable, GetVariableMangledName (localVariable));
|
||||
hoisted = new HoistedLocalVariable (this, localVariable, GetVariableMangledName (ec, localVariable));
|
||||
localVariable.HoistedVariant = hoisted;
|
||||
|
||||
if (hoisted_locals == null)
|
||||
@@ -667,7 +667,7 @@ namespace Mono.CSharp {
|
||||
return f_ind;
|
||||
}
|
||||
|
||||
protected virtual string GetVariableMangledName (LocalVariable local_info)
|
||||
protected virtual string GetVariableMangledName (ResolveContext rc, LocalVariable local_info)
|
||||
{
|
||||
//
|
||||
// No need to mangle anonymous method hoisted variables cause they
|
||||
|
||||
@@ -77,6 +77,7 @@ namespace Mono.CSharp
|
||||
|
||||
// Win32 version info values
|
||||
string vi_product, vi_product_version, vi_company, vi_copyright, vi_trademark;
|
||||
string pa_file_version, pa_assembly_version;
|
||||
|
||||
protected AssemblyDefinition (ModuleContainer module, string name)
|
||||
{
|
||||
@@ -240,6 +241,7 @@ namespace Mono.CSharp
|
||||
SetCustomAttribute (ctor, cdata);
|
||||
} else {
|
||||
builder_extra.SetVersion (vinfo, a.Location);
|
||||
pa_assembly_version = vinfo.ToString ();
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -312,7 +314,7 @@ namespace Mono.CSharp
|
||||
return;
|
||||
}
|
||||
|
||||
builder_extra.AddTypeForwarder (t.GetDefinition (), a.Location);
|
||||
AddTypeForwarders (t, a.Location);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -357,15 +359,15 @@ namespace Mono.CSharp
|
||||
} else if (a.Type == pa.RuntimeCompatibility) {
|
||||
wrap_non_exception_throws_custom = true;
|
||||
} else if (a.Type == pa.AssemblyFileVersion) {
|
||||
vi_product_version = a.GetString ();
|
||||
if (string.IsNullOrEmpty (vi_product_version) || IsValidAssemblyVersion (vi_product_version, false) == null) {
|
||||
pa_file_version = a.GetString ();
|
||||
if (string.IsNullOrEmpty (pa_file_version) || IsValidAssemblyVersion (pa_file_version, false) == null) {
|
||||
Report.Warning (7035, 1, a.Location, "The specified version string `{0}' does not conform to the recommended format major.minor.build.revision",
|
||||
vi_product_version, a.Name);
|
||||
pa_file_version, a.Name);
|
||||
return;
|
||||
}
|
||||
|
||||
// File version info decoding from blob is not supported
|
||||
var cab = new CustomAttributeBuilder ((ConstructorInfo) ctor.GetMetaInfo (), new object[] { vi_product_version });
|
||||
var cab = new CustomAttributeBuilder ((ConstructorInfo)ctor.GetMetaInfo (), new object [] { pa_file_version });
|
||||
Builder.SetCustomAttribute (cab);
|
||||
return;
|
||||
} else if (a.Type == pa.AssemblyProduct) {
|
||||
@@ -378,6 +380,8 @@ namespace Mono.CSharp
|
||||
vi_trademark = a.GetString ();
|
||||
} else if (a.Type == pa.Debuggable) {
|
||||
has_user_debuggable = true;
|
||||
} else if (a.Type == pa.AssemblyInformationalVersion) {
|
||||
vi_product_version = a.GetString ();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -389,6 +393,22 @@ namespace Mono.CSharp
|
||||
SetCustomAttribute (ctor, cdata);
|
||||
}
|
||||
|
||||
void AddTypeForwarders (TypeSpec type, Location loc)
|
||||
{
|
||||
builder_extra.AddTypeForwarder (type.GetDefinition (), loc);
|
||||
|
||||
var ntypes = MemberCache.GetDeclaredNestedTypes (type);
|
||||
if (ntypes == null)
|
||||
return;
|
||||
|
||||
foreach (var nested in ntypes) {
|
||||
if (nested.IsPrivate)
|
||||
continue;
|
||||
|
||||
AddTypeForwarders (nested, loc);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// When using assembly public key attributes InternalsVisibleTo key
|
||||
// was not checked, we have to do it later when we actually know what
|
||||
@@ -801,7 +821,11 @@ namespace Mono.CSharp
|
||||
if (Compiler.Settings.Win32ResourceFile != null) {
|
||||
Builder.DefineUnmanagedResource (Compiler.Settings.Win32ResourceFile);
|
||||
} else {
|
||||
Builder.DefineVersionInfoResource (vi_product, vi_product_version, vi_company, vi_copyright, vi_trademark);
|
||||
Builder.DefineVersionInfoResource (vi_product,
|
||||
vi_product_version ?? pa_file_version ?? pa_assembly_version,
|
||||
vi_company,
|
||||
vi_copyright,
|
||||
vi_trademark);
|
||||
}
|
||||
|
||||
if (Compiler.Settings.Win32IconFile != null) {
|
||||
@@ -885,7 +909,7 @@ namespace Mono.CSharp
|
||||
Builder.Save (module.Builder.ScopeName, pekind, machine);
|
||||
}
|
||||
} catch (ArgumentOutOfRangeException) {
|
||||
Report.Error (16, "Output file `{0}' exceeds the 4GB limit");
|
||||
Report.Error (16, "Output file `{0}' exceeds the 4GB limit", name);
|
||||
} catch (Exception e) {
|
||||
Report.Error (16, "Could not write to file `{0}'. {1}", name, e.Message);
|
||||
}
|
||||
|
||||
@@ -719,9 +719,11 @@ namespace Mono.CSharp {
|
||||
this.loc = child.Location;
|
||||
}
|
||||
|
||||
public bool RequiresEmitWithAwait { get; set; }
|
||||
|
||||
public override bool ContainsEmitWithAwait ()
|
||||
{
|
||||
return child.ContainsEmitWithAwait ();
|
||||
return RequiresEmitWithAwait || child.ContainsEmitWithAwait ();
|
||||
}
|
||||
|
||||
public override Expression CreateExpressionTree (ResolveContext ec)
|
||||
|
||||
@@ -1700,6 +1700,7 @@ namespace Mono.CSharp {
|
||||
public readonly PredefinedAttribute AssemblyAlgorithmId;
|
||||
public readonly PredefinedAttribute AssemblyFlags;
|
||||
public readonly PredefinedAttribute AssemblyFileVersion;
|
||||
public readonly PredefinedAttribute AssemblyInformationalVersion;
|
||||
public readonly PredefinedAttribute ComImport;
|
||||
public readonly PredefinedAttribute CoClass;
|
||||
public readonly PredefinedAttribute AttributeUsage;
|
||||
@@ -1800,6 +1801,7 @@ namespace Mono.CSharp {
|
||||
AssemblyCompany = new PredefinedAttribute (module, "System.Reflection", "AssemblyCompanyAttribute");
|
||||
AssemblyCopyright = new PredefinedAttribute (module, "System.Reflection", "AssemblyCopyrightAttribute");
|
||||
AssemblyTrademark = new PredefinedAttribute (module, "System.Reflection", "AssemblyTrademarkAttribute");
|
||||
AssemblyInformationalVersion = new PredefinedAttribute (module, "System.Reflection", "AssemblyInformationalVersionAttribute");
|
||||
|
||||
AsyncStateMachine = new PredefinedStateMachineAttribute (module, "System.Runtime.CompilerServices", "AsyncStateMachineAttribute");
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
edc538e7d2ed66a09ab7b5cbd397aec15b3ac3d0
|
||||
8b331dd7c778f49c22197b98267d5bc59cd1200c
|
||||
@@ -317,20 +317,20 @@ namespace Mono.CSharp
|
||||
ig.BeginFinallyBlock ();
|
||||
}
|
||||
|
||||
public void BeginScope ()
|
||||
public void BeginScope (int scopeIndex)
|
||||
{
|
||||
if ((flags & Options.OmitDebugInfo) != 0)
|
||||
return;
|
||||
|
||||
methodSymbols.StartBlock (CodeBlockEntry.Type.Lexical, ig.ILOffset);
|
||||
methodSymbols.StartBlock (CodeBlockEntry.Type.Lexical, ig.ILOffset, scopeIndex);
|
||||
}
|
||||
|
||||
public void BeginCompilerScope ()
|
||||
public void BeginCompilerScope (int scopeIndex)
|
||||
{
|
||||
if ((flags & Options.OmitDebugInfo) != 0)
|
||||
return;
|
||||
|
||||
methodSymbols.StartBlock (CodeBlockEntry.Type.CompilerGenerated, ig.ILOffset);
|
||||
methodSymbols.StartBlock (CodeBlockEntry.Type.CompilerGenerated, ig.ILOffset, scopeIndex);
|
||||
}
|
||||
|
||||
public void EndExceptionBlock ()
|
||||
@@ -1263,10 +1263,15 @@ namespace Mono.CSharp
|
||||
|
||||
if (conditionalAccess) {
|
||||
if (!ec.ConditionalAccess.Statement) {
|
||||
if (ec.ConditionalAccess.Type.IsNullableType)
|
||||
Nullable.LiftedNull.Create (ec.ConditionalAccess.Type, Location.Null).Emit (ec);
|
||||
else
|
||||
var t = ec.ConditionalAccess.Type;
|
||||
if (t.IsNullableType)
|
||||
Nullable.LiftedNull.Create (t, Location.Null).Emit (ec);
|
||||
else {
|
||||
ec.EmitNull ();
|
||||
|
||||
if (t.IsGenericParameter)
|
||||
ec.Emit (OpCodes.Unbox_Any, t);
|
||||
}
|
||||
}
|
||||
|
||||
ec.Emit (OpCodes.Br, ec.ConditionalAccess.EndLabel);
|
||||
|
||||
@@ -115,7 +115,16 @@ namespace Mono.CSharp {
|
||||
const ResolveFlags flags = ResolveFlags.VariableOrValue | ResolveFlags.Type;
|
||||
|
||||
if (sn != null) {
|
||||
expr = sn.LookupNameExpression (rc, MemberLookupRestrictions.ReadAccess | MemberLookupRestrictions.ExactArity);
|
||||
var errors_printer = new SessionReportPrinter ();
|
||||
var old = rc.Report.SetPrinter (errors_printer);
|
||||
try {
|
||||
expr = sn.LookupNameExpression (rc, MemberLookupRestrictions.ReadAccess | MemberLookupRestrictions.ExactArity);
|
||||
} finally {
|
||||
rc.Report.SetPrinter (old);
|
||||
}
|
||||
|
||||
if (errors_printer.ErrorsCount != 0)
|
||||
return null;
|
||||
|
||||
//
|
||||
// Resolve expression which does have type set as we need expression type
|
||||
|
||||
@@ -116,6 +116,8 @@ namespace Mono.CSharp
|
||||
|
||||
public ExceptionStatement CurrentTryBlock { get; set; }
|
||||
|
||||
public TryCatch CurrentTryCatch { get; set; }
|
||||
|
||||
public LoopStatement EnclosingLoop { get; set; }
|
||||
|
||||
public LoopStatement EnclosingLoopOrSwitch { get; set; }
|
||||
|
||||
@@ -715,6 +715,12 @@ namespace Mono.CSharp {
|
||||
return false;
|
||||
}
|
||||
|
||||
var interpolated_string = expr as InterpolatedString;
|
||||
if (interpolated_string != null) {
|
||||
if (target_type == rc.Module.PredefinedTypes.IFormattable.TypeSpec || target_type == rc.Module.PredefinedTypes.FormattableString.TypeSpec)
|
||||
return true;
|
||||
}
|
||||
|
||||
return ImplicitStandardConversionExists (expr, target_type);
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
b0c771f7207b2eb26aa12a288bd58e11f811aae3
|
||||
bb2bd6e19718cad38c3cf37e8eb131b1b6581685
|
||||
@@ -2523,7 +2523,6 @@ namespace Mono.CSharp
|
||||
|
||||
int TokenizePragmaWarningIdentifier (ref int c, ref bool identifier)
|
||||
{
|
||||
|
||||
if ((c >= '0' && c <= '9') || is_identifier_start_character (c)) {
|
||||
int number;
|
||||
|
||||
@@ -2588,6 +2587,9 @@ namespace Mono.CSharp
|
||||
while (c == ' ' || c == '\t')
|
||||
c = get_char ();
|
||||
|
||||
if (c == '\n' || c == UnicodeLS || c == UnicodePS)
|
||||
advance_line ();
|
||||
|
||||
return number;
|
||||
}
|
||||
|
||||
|
||||
@@ -499,9 +499,7 @@ namespace Mono.CSharp {
|
||||
|
||||
public override Expression CreateExpressionTree (ResolveContext ec)
|
||||
{
|
||||
MemberAccess ma = new MemberAccess (new MemberAccess (new QualifiedAliasMember ("global", "System", loc), "Delegate", loc), "CreateDelegate", loc);
|
||||
|
||||
Arguments args = new Arguments (3);
|
||||
Arguments args = new Arguments (2);
|
||||
args.Add (new Argument (new TypeOf (type, loc)));
|
||||
|
||||
if (method_group.InstanceExpression == null)
|
||||
@@ -509,7 +507,21 @@ namespace Mono.CSharp {
|
||||
else
|
||||
args.Add (new Argument (method_group.InstanceExpression));
|
||||
|
||||
args.Add (new Argument (method_group.CreateExpressionTree (ec)));
|
||||
Expression ma;
|
||||
var create_v45 = ec.Module.PredefinedMembers.MethodInfoCreateDelegate.Get ();
|
||||
if (create_v45 != null) {
|
||||
//
|
||||
// .NET 4.5 has better API but it produces different instance than Delegate::CreateDelegate
|
||||
// and because csc uses this enhancement we have to as well to be fully compatible
|
||||
//
|
||||
var mg = MethodGroupExpr.CreatePredefined (create_v45, create_v45.DeclaringType, loc);
|
||||
mg.InstanceExpression = method_group.CreateExpressionTree (ec);
|
||||
ma = mg;
|
||||
} else {
|
||||
ma = new MemberAccess (new MemberAccess (new QualifiedAliasMember ("global", "System", loc), "Delegate", loc), "CreateDelegate", loc);
|
||||
args.Add (new Argument (method_group.CreateExpressionTree (ec)));
|
||||
}
|
||||
|
||||
Expression e = new Invocation (ma, args).Resolve (ec);
|
||||
if (e == null)
|
||||
return null;
|
||||
@@ -523,7 +535,7 @@ namespace Mono.CSharp {
|
||||
|
||||
void ResolveConditionalAccessReceiver (ResolveContext rc)
|
||||
{
|
||||
// LAMESPEC: Not sure why this is explicitly disalloed with very odd error message
|
||||
// LAMESPEC: Not sure why this is explicitly disallowed with very odd error message
|
||||
if (!rc.HasSet (ResolveContext.Options.DontSetConditionalAccessReceiver) && method_group.HasConditionalAccess ()) {
|
||||
Error_OperatorCannotBeApplied (rc, loc, "?", method_group.Type);
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
a581906d3e9b82d7ffd04ab74c4c1f8275e7efa5
|
||||
e0e5b6f4748d3a4f4da983f54eb16973b1859dd8
|
||||
@@ -1 +1 @@
|
||||
f649c2b1ac18409b8acd361e63e55ffa77ad5bd3
|
||||
f805523b76e0a16f41bd3320409ad98aba4cab8e
|
||||
@@ -615,7 +615,7 @@ namespace Mono.CSharp
|
||||
|
||||
public override void AddTypeForwarder (TypeSpec type, Location loc)
|
||||
{
|
||||
builder.__AddTypeForwarder (type.GetMetaInfo ());
|
||||
builder.__AddTypeForwarder (type.GetMetaInfo (), false);
|
||||
}
|
||||
|
||||
public override void DefineWin32IconResource (string fileName)
|
||||
|
||||
@@ -676,20 +676,16 @@ namespace Mono.CSharp
|
||||
if (!param.IsEmpty) {
|
||||
if (is_valid_property) {
|
||||
var index_name = declaringType.MemberDefinition.GetAttributeDefaultMember ();
|
||||
if (index_name == null) {
|
||||
if (index_name == null || index_name != pi.Name) {
|
||||
is_valid_property = false;
|
||||
} else {
|
||||
if (get != null) {
|
||||
if (get.IsStatic)
|
||||
is_valid_property = false;
|
||||
if (get.Name.IndexOf (index_name, StringComparison.Ordinal) != 4)
|
||||
is_valid_property = false;
|
||||
}
|
||||
if (set != null) {
|
||||
if (set.IsStatic)
|
||||
is_valid_property = false;
|
||||
if (set.Name.IndexOf (index_name, StringComparison.Ordinal) != 4)
|
||||
is_valid_property = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace Mono.CSharp
|
||||
protected T machine_initializer;
|
||||
int resume_pc;
|
||||
ExceptionStatement inside_try_block;
|
||||
TryCatch inside_catch_block;
|
||||
|
||||
protected YieldStatement (Expression expr, Location l)
|
||||
{
|
||||
@@ -69,6 +70,7 @@ namespace Mono.CSharp
|
||||
|
||||
machine_initializer = bc.CurrentAnonymousMethod as T;
|
||||
inside_try_block = bc.CurrentTryBlock;
|
||||
inside_catch_block = bc.CurrentTryCatch;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -80,7 +82,7 @@ namespace Mono.CSharp
|
||||
if (inside_try_block == null) {
|
||||
resume_pc = machine_initializer.AddResumePoint (this);
|
||||
} else {
|
||||
resume_pc = inside_try_block.AddResumePoint (this, resume_pc, machine_initializer);
|
||||
resume_pc = inside_try_block.AddResumePoint (this, resume_pc, machine_initializer, inside_catch_block);
|
||||
unwind_protect = true;
|
||||
inside_try_block = null;
|
||||
}
|
||||
@@ -202,7 +204,6 @@ namespace Mono.CSharp
|
||||
|
||||
Field pc_field;
|
||||
StateMachineMethod method;
|
||||
int local_name_idx;
|
||||
|
||||
protected StateMachine (ParametersBlock block, TypeDefinition parent, MemberBase host, TypeParameters tparams, string name, MemberKind kind)
|
||||
: base (block, parent, host, tparams, name, kind)
|
||||
@@ -244,12 +245,19 @@ namespace Mono.CSharp
|
||||
return base.DoDefineMembers ();
|
||||
}
|
||||
|
||||
protected override string GetVariableMangledName (LocalVariable local_info)
|
||||
protected override string GetVariableMangledName (ResolveContext rc, LocalVariable local_info)
|
||||
{
|
||||
if (local_info.IsCompilerGenerated)
|
||||
return base.GetVariableMangledName (local_info);
|
||||
return base.GetVariableMangledName (rc, local_info);
|
||||
|
||||
return "<" + local_info.Name + ">__" + local_name_idx++.ToString ("X");
|
||||
//
|
||||
// Special format which encodes original variable name and
|
||||
// it's scope to support lifted variables debugging. This
|
||||
// is same what csc does and allows to correctly set fields
|
||||
// scope information (like ambiguity, our of scope, etc).
|
||||
//
|
||||
var id = rc.CurrentBlock.Explicit.GetDebugSymbolScopeIndex ();
|
||||
return "<" + local_info.Name + ">__" + id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<Commandlineparameters>y.cs</Commandlineparameters>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user