diff --git a/ts2panda/ts2abc/tests/type_adapter_test/type_adapter_test.cpp b/ts2panda/ts2abc/tests/type_adapter_test/type_adapter_test.cpp index 74fa91fa82214c99d57e71bbd5f1d55348ec21a6..4e8bf2f9a2bc80c2d4682405b9a7af9466a17dd5 100644 --- a/ts2panda/ts2abc/tests/type_adapter_test/type_adapter_test.cpp +++ b/ts2panda/ts2abc/tests/type_adapter_test/type_adapter_test.cpp @@ -17,6 +17,7 @@ #include "assembler/meta.h" #include "assembler/assembly-parser.h" +namespace ts2abc_type_adapter::type_adapter_test { using ArrayValue = panda::pandasm::ArrayValue; using ScalarValue = panda::pandasm::ScalarValue; using AnnotationData = panda::pandasm::AnnotationData; @@ -132,12 +133,14 @@ void TypeAdapterTest::TestVariablesArgsType() const const int32_t instruction_location = 8; CheckTypeExist(typeinfo, instruction_location, 1); } +} // namespace ts2abc_type_adapter::type_adapter_test -int main(int argc, const char *argv[]) +int main() { - TypeAdapterTest test; + ts2abc_type_adapter::type_adapter_test::TypeAdapterTest test; std::cout << "TypeAdapterTest TestVariablesArgsType: " << std::endl; test.TestVariablesArgsType(); std::cout << "PASS!" << std::endl; + return 0; // should enable TestBuiltinsType when builtins adaption is ready } diff --git a/ts2panda/ts2abc/ts2abc.cpp b/ts2panda/ts2abc/ts2abc.cpp index 802ac449b896c5e5152e441e991b5429b90273f4..75407dedb1ae9b16eab310149f737d03b380c1d4 100644 --- a/ts2panda/ts2abc/ts2abc.cpp +++ b/ts2panda/ts2abc/ts2abc.cpp @@ -44,6 +44,7 @@ namespace { bool g_displayTypeinfo = false; std::string g_optLogLevel = "error"; uint32_t g_literalArrayCount = 0; + using ts2abc_type_adapter::TypeAdapter; constexpr std::size_t BOUND_LEFT = 0; constexpr std::size_t BOUND_RIGHT = 0; diff --git a/ts2panda/ts2abc/type_adapter.cpp b/ts2panda/ts2abc/type_adapter.cpp index 8c383f175dc1bb79df23c39b460e1a7c5e972104..1ab1e303fc4515455e509c88e5101dbf51dafeb8 100644 --- a/ts2panda/ts2abc/type_adapter.cpp +++ b/ts2panda/ts2abc/type_adapter.cpp @@ -16,6 +16,7 @@ #include "type_adapter.h" #include "assembler/meta.h" +namespace ts2abc_type_adapter { void TypeAdapter::AdaptTypeForProgram(panda::pandasm::Program *prog) const { for (auto &[name, func] : prog->function_table) { @@ -151,3 +152,4 @@ void TypeAdapter::UpdateTypeAnnotation(panda::pandasm::Function *func, size_t an std::cout << "\n"; } } +} // namespace ts2abc_type_adapter diff --git a/ts2panda/ts2abc/type_adapter.h b/ts2panda/ts2abc/type_adapter.h index fb767c78ee5a23319121b0c92469ac2f283436d3..141cfcc89b16fca77b5eadca1317caccbbac8c3f 100644 --- a/ts2panda/ts2abc/type_adapter.h +++ b/ts2panda/ts2abc/type_adapter.h @@ -19,6 +19,7 @@ #include "assembler/assembly-program.h" #include "assembler/assembly-function.h" +namespace ts2abc_type_adapter { class TypeAdapter { public: TypeAdapter() {}; @@ -43,5 +44,6 @@ private: const std::unordered_map &order_type_map) const; bool display_typeinfo_ = false; }; +} // namespace ts2abc_type_adapter #endif // TS2PANDA_TS2ABC_TYPE_ADAPTER_H