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

Merge changes from FE #21

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
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
527 changes: 231 additions & 296 deletions include/ifc/abstract-sgraph.hxx

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions include/ifc/operators.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ namespace ifc {
PseudoDtorCall, // p->~T(), with T a scalar type
LookupGlobally, // ::x
Artificial, // Compiler-generated expression wrapper
MetaDescriptor, // a runtime reification of a type

Msvc = 0x0400,
MsvcAssume, // __assume(x)
Expand Down Expand Up @@ -137,6 +138,7 @@ namespace ifc {
// This operator attempts to catch these offending dependent expression values.
MsvcConfusedSubstitution, // Represents a template parameter substitution 'P -> expr' where 'expr' could be a type or a non-type argument replacement.
MsvcConfusedAggregateReturn, // Decorates a return statement which returns an aggregate class type with a user-defined destructor.
MsvcConfusedVftblPointerInit, // An initialization of a derived class's vftbl pointer.

Last
};
Expand Down
1 change: 0 additions & 1 deletion include/ifc/reader.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ namespace ifc {
case ExprSort::HierarchyConversion: return std::forward<F>(f)(get<symbolic::HierarchyConversionExpr>(index));
case ExprSort::ProductTypeValue: return std::forward<F>(f)(get<symbolic::ProductTypeValueExpr>(index));
case ExprSort::SumTypeValue: return std::forward<F>(f)(get<symbolic::SumTypeValueExpr>(index));
case ExprSort::SubobjectValue: return std::forward<F>(f)(get<symbolic::SubobjectValueExpr>(index));
case ExprSort::ArrayValue: return std::forward<F>(f)(get<symbolic::ArrayValueExpr>(index));
case ExprSort::DynamicDispatch: return std::forward<F>(f)(get<symbolic::DynamicDispatchExpr>(index));
case ExprSort::VirtualFunctionConversion: return std::forward<F>(f)(get<symbolic::VirtualFunctionConversionExpr>(index));
Expand Down
5 changes: 0 additions & 5 deletions src/ifc-dom/exprs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,6 @@ namespace ifc::util {
{
node.props.emplace("ref", ctx.ref(expr.variant));
node.props.emplace("index", std::to_string((int)expr.active_member));
add_child(expr.value.value); // reach inside. no need to have it doubly nested
}

void operator()(const symbolic::SubobjectValueExpr& expr)
{
add_child(expr.value);
}

Expand Down
16 changes: 8 additions & 8 deletions src/ifc-dom/types.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ namespace ifc::util {

std::string operator()(const symbolic::ExpansionType& type)
{
return ctx.ref(type.operand) + to_string(type.mode);
return ctx.ref(type.pack) + to_string(type.mode);
}

std::string operator()(const symbolic::PointerType& ptr)
{
return ctx.ref(ptr.operand) + "*";
return ctx.ref(ptr.pointee) + "*";
}

std::string operator()(const symbolic::PointerToMemberType& ptr)
Expand All @@ -48,11 +48,11 @@ namespace ifc::util {

std::string operator()(const symbolic::LvalueReferenceType& type)
{
return ctx.ref(type.operand) + "&";
return ctx.ref(type.referee) + "&";
}
std::string operator()(const symbolic::RvalueReferenceType& type)
{
return ctx.ref(type.operand) + "&&";
return ctx.ref(type.referee) + "&&";
}
std::string operator()(const symbolic::FunctionType& type)
{
Expand Down Expand Up @@ -186,12 +186,12 @@ namespace ifc::util {
void operator()(const symbolic::ExpansionType& type)
{
node.props.emplace("mode", to_string(type.mode));
add_child(type.operand);
add_child(type.pack);
}

void operator()(const symbolic::PointerType& ptr)
{
add_child(ptr.operand);
add_child(ptr.pointee);
}

void operator()(const symbolic::PointerToMemberType& ptr)
Expand All @@ -202,12 +202,12 @@ namespace ifc::util {

void operator()(const symbolic::LvalueReferenceType& type)
{
add_child(type.operand);
add_child(type.referee);
}

void operator()(const symbolic::RvalueReferenceType& type)
{
add_child(type.operand);
add_child(type.referee);
}

void operator()(const symbolic::FunctionType& type)
Expand Down
2 changes: 1 addition & 1 deletion src/ifc-reader/util.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ namespace ifc::util {

std::string to_string(symbolic::TypeBasis basis)
{
return to_string(symbolic::FundamentalType{basis, {}, {}});
return to_string(symbolic::FundamentalType{.basis = basis});
}

} // namespace ifc::util
2 changes: 1 addition & 1 deletion src/sgraph.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace ifc {
{ExprSort::HierarchyConversion, "expr.hierarchy-conversion"},
{ExprSort::ProductTypeValue, "expr.product-type-value"},
{ExprSort::SumTypeValue, "expr.sum-type-value"},
{ExprSort::SubobjectValue, "expr.class-subobject-value"},
{ExprSort::UnusedSort1, "expr.unused1"},
{ExprSort::ArrayValue, "expr.array-value"},
{ExprSort::DynamicDispatch, "expr.dynamic-dispatch"},
{ExprSort::VirtualFunctionConversion, "expr.virtual-function-conversion"},
Expand Down