Browse Source

Added CheckIgnoredDeclsPass.CheckDecayedTypes option.

This is used for Embeddinator-4000 and could be removed once we improve our support for custom types.
pull/778/head
Joao Matos 9 years ago
parent
commit
3b6cfd70f5
  1. 17
      src/Generator/Passes/CheckIgnoredDecls.cs

17
src/Generator/Passes/CheckIgnoredDecls.cs

@ -7,6 +7,8 @@ namespace CppSharp.Passes
{ {
public class CheckIgnoredDeclsPass : TranslationUnitPass public class CheckIgnoredDeclsPass : TranslationUnitPass
{ {
public bool CheckDecayedTypes { get; set; } = true;
public bool CheckDeclarationAccess(Declaration decl) public bool CheckDeclarationAccess(Declaration decl)
{ {
var generateNonPublicDecls = Options.IsCSharpGenerator; var generateNonPublicDecls = Options.IsCSharpGenerator;
@ -135,13 +137,16 @@ namespace CppSharp.Passes
return false; return false;
} }
var decayedType = param.Type.Desugar() as DecayedType; if (CheckDecayedTypes)
if (decayedType != null)
{ {
function.ExplicitlyIgnore(); var decayedType = param.Type.Desugar() as DecayedType;
Diagnostics.Debug("Function '{0}' was ignored due to unsupported decayed type param", if (decayedType != null)
function.Name); {
return false; function.ExplicitlyIgnore();
Diagnostics.Debug("Function '{0}' was ignored due to unsupported decayed type param",
function.Name);
return false;
}
} }
if (param.Kind == ParameterKind.IndirectReturnType) if (param.Kind == ParameterKind.IndirectReturnType)

Loading…
Cancel
Save