2017-01-18 11:22:19 +03:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
using Mono.Cecil;
|
|
|
|
using Mono.Linker;
|
|
|
|
|
2017-01-18 12:25:58 +03:00
|
|
|
using XamCore.Registrar;
|
|
|
|
|
2017-01-18 11:22:19 +03:00
|
|
|
namespace Xamarin.Tuner
|
|
|
|
{
|
|
|
|
public class DerivedLinkContext : LinkContext
|
|
|
|
{
|
2017-01-18 12:25:58 +03:00
|
|
|
internal StaticRegistrar StaticRegistrar;
|
2017-01-18 11:29:46 +03:00
|
|
|
Dictionary<string, List<MemberReference>> required_symbols;
|
2017-01-18 12:25:58 +03:00
|
|
|
Dictionary<string, TypeDefinition> objectivec_classes;
|
2017-01-18 11:29:46 +03:00
|
|
|
|
2017-02-10 09:45:42 +03:00
|
|
|
// SDK candidates - they will be preserved only if the application (not the SDK) uses it
|
|
|
|
List<ICustomAttributeProvider> srs_data_contract = new List<ICustomAttributeProvider> ();
|
|
|
|
List<ICustomAttributeProvider> xml_serialization = new List<ICustomAttributeProvider> ();
|
|
|
|
|
|
|
|
HashSet<TypeDefinition> cached_isnsobject;
|
|
|
|
HashSet<TypeDefinition> needs_isdirectbinding_check;
|
|
|
|
HashSet<MethodDefinition> generated_code;
|
|
|
|
|
|
|
|
public HashSet<TypeDefinition> CachedIsNSObject {
|
|
|
|
get { return cached_isnsobject; }
|
|
|
|
set { cached_isnsobject = value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public HashSet<TypeDefinition> NeedsIsDirectBindingCheck {
|
|
|
|
get { return needs_isdirectbinding_check; }
|
|
|
|
set { needs_isdirectbinding_check = value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public HashSet<MethodDefinition> GeneratedCode {
|
|
|
|
get { return generated_code; }
|
|
|
|
set { generated_code = value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public IList<ICustomAttributeProvider> DataContract {
|
|
|
|
get {
|
|
|
|
return srs_data_contract;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public IList<ICustomAttributeProvider> XmlSerialization {
|
|
|
|
get {
|
|
|
|
return xml_serialization;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 11:29:46 +03:00
|
|
|
public List<MemberReference> GetRequiredSymbolList (string symbol)
|
|
|
|
{
|
|
|
|
List<MemberReference> rv;
|
|
|
|
if (!RequiredSymbols.TryGetValue (symbol, out rv))
|
|
|
|
required_symbols [symbol] = rv = new List<MemberReference> ();
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Dictionary<string, List<MemberReference>> RequiredSymbols {
|
2017-01-18 11:22:19 +03:00
|
|
|
get {
|
|
|
|
if (required_symbols == null)
|
2017-01-18 11:29:46 +03:00
|
|
|
required_symbols = new Dictionary<string, List<MemberReference>> ();
|
2017-01-18 11:22:19 +03:00
|
|
|
return required_symbols;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 12:25:58 +03:00
|
|
|
public Dictionary<string, TypeDefinition> ObjectiveCClasses {
|
|
|
|
get {
|
|
|
|
if (objectivec_classes == null)
|
|
|
|
objectivec_classes = new Dictionary<string, TypeDefinition> ();
|
|
|
|
return objectivec_classes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 11:22:19 +03:00
|
|
|
public DerivedLinkContext (Pipeline pipeline, AssemblyResolver resolver)
|
|
|
|
: base (pipeline, resolver)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|