Deprecate init_class and IDScope in another way.

This also renamed init_class to InitClass for consistency.
This commit is contained in:
Tim Wojtulewicz 2020-06-30 13:06:34 -07:00
parent 361ad8f2f7
commit 7ee8e11a8f
9 changed files with 50 additions and 68 deletions

View file

@ -120,12 +120,6 @@ ID::ID(const char* arg_name, IDScope arg_scope, bool arg_is_export)
SetLocationInfo(&start_location, &end_location);
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
ID::ID(const char* arg_name, ::IDScope arg_scope, bool arg_is_export) :
ID(arg_name, static_cast<IDScope>(arg_scope), arg_is_export) {}
#pragma GCC diagnostic pop
ID::~ID()
{
delete [] name;
@ -175,7 +169,7 @@ void ID::SetVal(IntrusivePtr<Val> v)
}
}
void ID::SetVal(IntrusivePtr<Val> v, init_class c)
void ID::SetVal(IntrusivePtr<Val> v, InitClass c)
{
if ( c == INIT_NONE || c == INIT_FULL )
{
@ -213,7 +207,7 @@ void ID::SetVal(IntrusivePtr<Val> v, init_class c)
}
}
void ID::SetVal(IntrusivePtr<Expr> ev, init_class c)
void ID::SetVal(IntrusivePtr<Expr> ev, InitClass c)
{
const auto& a = attrs->Find(c == INIT_EXTRA ? ATTR_ADD_FUNC : ATTR_DEL_FUNC);
@ -223,19 +217,6 @@ void ID::SetVal(IntrusivePtr<Expr> ev, init_class c)
EvalFunc(a->GetExpr(), std::move(ev));
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
void ID::SetVal(IntrusivePtr<Val> v, ::init_class c)
{
SetVal(v, static_cast<init_class>(c));
}
void ID::SetVal(IntrusivePtr<Expr> ev, ::init_class c)
{
SetVal(ev, static_cast<init_class>(c));
}
#pragma GCC diagnostic pop
bool ID::IsRedefinable() const
{
return GetAttr(ATTR_REDEF) != nullptr;