netclass: Make pointer to base class const

The base class type is not owned by a class and is shared. For this reason
it must not be modified. To ensure this mark the base class pointer as
const.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-03-17 12:25:28 +01:00
parent b3f7ce6020
commit 583a7ddc35
2 changed files with 4 additions and 4 deletions

View File

@ -23,8 +23,8 @@
using namespace std;
netclass_t::netclass_t(perm_string name, netclass_t*sup)
: name_(name), super_(sup), class_scope_(0), definition_scope_(0)
netclass_t::netclass_t(perm_string name, const netclass_t*super)
: name_(name), super_(super), class_scope_(0), definition_scope_(0)
{
}

View File

@ -35,7 +35,7 @@ class PExpr;
class netclass_t : public ivl_type_s {
public:
netclass_t(perm_string class_name, netclass_t*par);
netclass_t(perm_string class_name, const netclass_t*super);
~netclass_t();
// Set the property of the class during elaboration. Set the
@ -120,7 +120,7 @@ class netclass_t : public ivl_type_s {
perm_string name_;
// If this is derived from another base class, point to it
// here.
netclass_t*super_;
const netclass_t*super_;
// Map property names to property table index.
std::map<perm_string,size_t> properties_;
// Vector of properties.