Skip to content

Commit 46a2b58

Browse files
committed
Revise topology code gen
Use fully-qualified names for instance defs
1 parent 2753fd4 commit 46a2b58

11 files changed

+22
-27
lines changed

compiler/lib/src/main/scala/codegen/CppWriter/TopologyCppWriter/TopologyCppWriterUtils.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,8 @@ abstract class TopologyCppWriterUtils(
5252
def getComponentNameAsQualIdent(ci: ComponentInstance): String =
5353
getNameAsQualIdent(getComponentName(ci))
5454

55-
def getShortName(name: Name.Qualified): Name.Qualified = {
56-
val ens = s.a.getEnclosingNames(symbol)
57-
name.shortName(ens)
58-
}
59-
6055
def getNameAsQualIdent(name: Name.Qualified): String =
61-
CppWriter.writeQualifiedName(getShortName(name))
56+
CppWriter.writeQualifiedName(name)
6257

6358
def getSpecifierForPhase (phase: Int) (ci: ComponentInstance):
6459
Option[InitSpecifier] = ci.initSpecifierMap.get(phase)

compiler/tools/fpp-to-cpp/test/top/BasicTopologyAc.ref.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace M {
1414

15-
Active active1(FW_OPTIONAL_NAME("active1"));
15+
M::Active active1(FW_OPTIONAL_NAME("active1"));
1616

1717
}
1818

@@ -23,13 +23,13 @@ namespace M {
2323

2424
namespace M {
2525

26-
Active active3(FW_OPTIONAL_NAME("active3"));
26+
M::Active active3(FW_OPTIONAL_NAME("active3"));
2727

2828
}
2929

3030
namespace M {
3131

32-
Passive passive1(FW_OPTIONAL_NAME("passive1"));
32+
M::Passive passive1(FW_OPTIONAL_NAME("passive1"));
3333

3434
}
3535

compiler/tools/fpp-to-cpp/test/top/BasicTopologyAc.ref.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,28 @@
1818
namespace M {
1919

2020
//! active1
21-
extern Active active1;
21+
extern M::Active active1;
2222

2323
}
2424

2525
namespace M {
2626

2727
//! active2
28-
extern Active active2;
28+
extern M::Active active2;
2929

3030
}
3131

3232
namespace M {
3333

3434
//! active3
35-
extern Active active3;
35+
extern M::Active active3;
3636

3737
}
3838

3939
namespace M {
4040

4141
//! passive1
42-
extern Passive passive1;
42+
extern M::Passive passive1;
4343

4444
}
4545

compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
namespace M {
1414

15-
C c1(FW_OPTIONAL_NAME("c1"));
15+
M::C c1(FW_OPTIONAL_NAME("c1"));
1616

1717
}
1818

1919
namespace M {
2020

21-
C c2(FW_OPTIONAL_NAME("c2"));
21+
M::C c2(FW_OPTIONAL_NAME("c2"));
2222

2323
}
2424

compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
namespace M {
1818

1919
//! c1
20-
extern C c1;
20+
extern M::C c1;
2121

2222
}
2323

2424
namespace M {
2525

2626
//! c2
27-
extern C c2;
27+
extern M::C c2;
2828

2929
}
3030

compiler/tools/fpp-to-cpp/test/top/HealthTopologyAc.ref.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
namespace M {
1414

15-
C c1(FW_OPTIONAL_NAME("c1"));
15+
M::C c1(FW_OPTIONAL_NAME("c1"));
1616

1717
}
1818

1919
namespace M {
2020

21-
C c2(FW_OPTIONAL_NAME("c2"));
21+
M::C c2(FW_OPTIONAL_NAME("c2"));
2222

2323
}
2424

compiler/tools/fpp-to-cpp/test/top/HealthTopologyAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
namespace M {
1919

2020
//! c1
21-
extern C c1;
21+
extern M::C c1;
2222

2323
}
2424

2525
namespace M {
2626

2727
//! c2
28-
extern C c2;
28+
extern M::C c2;
2929

3030
}
3131

compiler/tools/fpp-to-cpp/test/top/NestedNamespacesTopologyAc.ref.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Component instances
1111
// ----------------------------------------------------------------------
1212

13-
N::O::C c(FW_OPTIONAL_NAME("c"));
13+
M::N::O::C c(FW_OPTIONAL_NAME("c"));
1414

1515
namespace M {
1616

compiler/tools/fpp-to-cpp/test/top/NestedNamespacesTopologyAc.ref.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// ----------------------------------------------------------------------
1616

1717
//! c
18-
extern N::O::C c;
18+
extern M::N::O::C c;
1919

2020
namespace M {
2121

compiler/tools/fpp-to-cpp/test/top/ParamsTopologyAc.ref.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
namespace M {
1414

15-
C c1(FW_OPTIONAL_NAME("c1"));
15+
M::C c1(FW_OPTIONAL_NAME("c1"));
1616

1717
}
1818

1919
namespace M {
2020

21-
C c2(FW_OPTIONAL_NAME("c2"));
21+
M::C c2(FW_OPTIONAL_NAME("c2"));
2222

2323
}
2424

0 commit comments

Comments
 (0)