Skip to content

Commit 0315344

Browse files
committed
1 parent 557b56a commit 0315344

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

OMCompiler/Compiler/FrontEndCpp/Class.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ constexpr int TYPED_DERIVED = 7;
1717
constexpr int DAE_TYPE = 8;
1818

1919
extern record_description NFModifier_Modifier_NOMOD__desc;
20-
const MetaModelica::Record emptyMod(2, NFModifier_Modifier_NOMOD__desc, {});
21-
2220
extern record_description NFClass_Prefixes_PREFIXES__desc;
2321

2422
std::unique_ptr<Class> Class::fromAbsyn(const Absyn::Class &cls, InstNode *scope)
@@ -59,6 +57,8 @@ PartialClass::PartialClass(const Absyn::ClassParts &definition, bool isClassExte
5957

6058
MetaModelica::Value PartialClass::toMetaModelica() const
6159
{
60+
static const MetaModelica::Record emptyMod(2, NFModifier_Modifier_NOMOD__desc, {});
61+
6262
return MetaModelica::Record(PARTIAL_CLASS, NFClass_PARTIAL__CLASS__desc, {
6363
_elements.toNF(),
6464
emptyMod,

OMCompiler/Compiler/FrontEndCpp/ClassNode.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ using namespace OpenModelica;
77
extern record_description NFInstNode_InstNode_CLASS__NODE__desc;
88

99
extern record_description NFClass_NOT__INSTANTIATED__desc;
10-
const MetaModelica::Value noClass = MetaModelica::Record(0, NFClass_NOT__INSTANTIATED__desc);
1110

1211
constexpr int NAME_INDEX = 0;
1312
constexpr int DEFINITION_INDEX = 1;
@@ -18,7 +17,6 @@ constexpr int PARENT_SCOPE_INDEX = 5;
1817
constexpr int NODE_TYPE_INDEX = 6;
1918

2019
extern record_description NFInstNode_CachedData_NO__CACHE__desc;
21-
const MetaModelica::Value noCache = MetaModelica::Record(0, NFInstNode_CachedData_NO__CACHE__desc);
2220

2321
ClassNode::ClassNode(Absyn::Class *cls, InstNode *parent)
2422
: ClassNode(cls, parent, std::make_unique<NormalClassType>())
@@ -68,6 +66,9 @@ void ClassNode::instantiate()
6866

6967
MetaModelica::Value ClassNode::toMetaModelica() const
7068
{
69+
static const MetaModelica::Value noClass = MetaModelica::Record(0, NFClass_NOT__INSTANTIATED__desc);
70+
static const MetaModelica::Value noCache = MetaModelica::Record(0, NFInstNode_CachedData_NO__CACHE__desc);
71+
7172
// Nodes need to be cached to deal with the cyclical dependencies between nodes.
7273
if (!_mmCache) {
7374
auto cls_ptr = MetaModelica::Pointer();

OMCompiler/Compiler/FrontEndCpp/Component.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ constexpr int INVALID_COMPONENT = 5;
2020
constexpr int WILD = 6;
2121

2222
extern record_description NFModifier_Modifier_NOMOD__desc;
23-
const MetaModelica::Record emptyMod(2, NFModifier_Modifier_NOMOD__desc, {});
2423

2524
Component::Component(Absyn::Component *definition)
2625
: _definition{definition}
@@ -36,6 +35,8 @@ ComponentDef::ComponentDef(Absyn::Component *definition)
3635

3736
MetaModelica::Value ComponentDef::toNF() const noexcept
3837
{
38+
static const MetaModelica::Record emptyMod(2, NFModifier_Modifier_NOMOD__desc, {});
39+
3940
return MetaModelica::Record{COMPONENT_DEF, NFComponent_COMPONENT__DEF__desc, {
4041
_definition->toSCode(),
4142
emptyMod

0 commit comments

Comments
 (0)