Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved diagnostic output in CheckIgnoredDecls. #729

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions src/Generator/Passes/CheckIgnoredDecls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ public override bool VisitDeclaration(Declaration decl)

if (!CheckDeclarationAccess(decl))
{
Diagnostics.Debug("Decl '{0}' was ignored due to invalid access",
decl.Name);
Diagnostics.Debug("'{0}' was ignored due to invalid access",
decl.QualifiedName);
decl.GenerationKind = decl is Field ? GenerationKind.Internal : GenerationKind.None;
return true;
}

if (decl.IsDependent)
{
decl.GenerationKind = decl is Field ? GenerationKind.Internal : GenerationKind.None;
Diagnostics.Debug("Decl '{0}' was ignored due to dependent context",
decl.Name);
Diagnostics.Debug("'{0}' was ignored due to dependent context",
decl.QualifiedName);
return true;
}

Expand Down Expand Up @@ -95,8 +95,8 @@ public override bool VisitFieldDecl(Field field)
var cppTypePrinter = new CppTypePrinter();
var typeName = field.Type.Visit(cppTypePrinter);

Diagnostics.Debug("Field '{0}::{1}' was ignored due to {2} type '{3}'",
@class.Name, field.Name, msg, typeName);
Diagnostics.Debug("'{0}' was ignored due to {1} type '{2}'",
field.QualifiedName, msg, typeName);

return true;
}
Expand All @@ -112,8 +112,8 @@ public override bool VisitFunctionDecl(Function function)
if (HasInvalidType(ret.Type, function.TranslationUnit.Module, out msg))
{
function.ExplicitlyIgnore();
Diagnostics.Debug("Function '{0}' was ignored due to {1} return decl",
function.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} return decl",
function.QualifiedName, msg);
return false;
}

Expand All @@ -122,25 +122,25 @@ public override bool VisitFunctionDecl(Function function)
if (HasInvalidDecl(param, out msg))
{
function.ExplicitlyIgnore();
Diagnostics.Debug("Function '{0}' was ignored due to {1} param",
function.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} param",
function.QualifiedName, msg);
return false;
}

if (HasInvalidType(param.Type, function.TranslationUnit.Module, out msg))
{
function.ExplicitlyIgnore();
Diagnostics.Debug("Function '{0}' was ignored due to {1} param",
function.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} param",
function.QualifiedName, msg);
return false;
}

var decayedType = param.Type.Desugar() as DecayedType;
if (decayedType != null)
{
function.ExplicitlyIgnore();
Diagnostics.Debug("Function '{0}' was ignored due to unsupported decayed type param",
function.Name);
Diagnostics.Debug("'{0}' was ignored due to unsupported decayed type param",
function.QualifiedName);
return false;
}

Expand All @@ -152,8 +152,8 @@ public override bool VisitFunctionDecl(Function function)
{
function.ExplicitlyIgnore();
Diagnostics.Debug(
"Function '{0}' was ignored due to an indirect return param not of a tag type",
function.Name);
"'{0}' was ignored due to an indirect return param not of a tag type",
function.QualifiedName);
return false;
}
}
Expand All @@ -180,8 +180,8 @@ bool CheckIgnoredBaseOverridenMethod(Method method)
if (HasIgnoredBaseClass(method, @class, out ignoredBase))
{
Diagnostics.Debug(
"Virtual method '{0}' was ignored due to ignored base '{1}'",
method.QualifiedOriginalName, ignoredBase.Name);
"'{0}' was ignored due to ignored base '{1}'",
method.QualifiedName, ignoredBase.Name);

method.ExplicitlyIgnore();
return false;
Expand Down Expand Up @@ -226,8 +226,8 @@ public override bool VisitTypedefDecl(TypedefDecl typedef)
if (HasInvalidType(typedef.Type, typedef.TranslationUnit.Module, out msg))
{
typedef.ExplicitlyIgnore();
Diagnostics.Debug("Typedef '{0}' was ignored due to {1} type",
typedef.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} type",
typedef.QualifiedName, msg);
return false;
}

Expand All @@ -243,16 +243,16 @@ public override bool VisitProperty(Property property)
if (HasInvalidDecl(property, out msg))
{
property.ExplicitlyIgnore();
Diagnostics.Debug("Property '{0}' was ignored due to {1} decl",
property.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} decl",
property.QualifiedName, msg);
return false;
}

if (HasInvalidType(property.Type, property.TranslationUnit.Module, out msg))
{
property.ExplicitlyIgnore();
Diagnostics.Debug("Property '{0}' was ignored due to {1} type",
property.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} type",
property.QualifiedName, msg);
return false;
}

Expand All @@ -268,16 +268,16 @@ public override bool VisitVariableDecl(Variable variable)
if (HasInvalidDecl(variable, out msg))
{
variable.ExplicitlyIgnore();
Diagnostics.Debug("Variable '{0}' was ignored due to {1} decl",
variable.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} decl",
variable.QualifiedName, msg);
return false;
}

if (HasInvalidType(variable.Type, variable.TranslationUnit.Module, out msg))
{
variable.ExplicitlyIgnore();
Diagnostics.Debug("Variable '{0}' was ignored due to {1} type",
variable.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} type",
variable.QualifiedName, msg);
return false;
}

Expand All @@ -293,8 +293,8 @@ public override bool VisitEvent(Event @event)
if (HasInvalidDecl(@event, out msg))
{
@event.ExplicitlyIgnore();
Diagnostics.Debug("Event '{0}' was ignored due to {1} decl",
@event.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} decl",
@event.QualifiedName, msg);
return false;
}

Expand All @@ -303,16 +303,16 @@ public override bool VisitEvent(Event @event)
if (HasInvalidDecl(param, out msg))
{
@event.ExplicitlyIgnore();
Diagnostics.Debug("Event '{0}' was ignored due to {1} param",
@event.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} param",
@event.QualifiedName, msg);
return false;
}

if (HasInvalidType(param.Type, @event.TranslationUnit.Module, out msg))
{
@event.ExplicitlyIgnore();
Diagnostics.Debug("Event '{0}' was ignored due to {1} param",
@event.Name, msg);
Diagnostics.Debug("'{0}' was ignored due to {1} param",
@event.QualifiedName, msg);
return false;
}
}
Expand Down