From abec0dcce60ec407f150cddd40fe7e29730b1964 Mon Sep 17 00:00:00 2001 From: Jake Hillion Date: Tue, 20 Dec 2022 04:55:47 -0800 Subject: [PATCH] remove funcgeninternal.h The container information added by `FuncGenInternal.h` has been made redundant by the pluggable containers feature. Remove this legacy difference. --- src/FuncGen.cpp | 19 ------------------- src/FuncGen.h | 2 -- src/OICodeGen.cpp | 25 ------------------------- 3 files changed, 46 deletions(-) diff --git a/src/FuncGen.cpp b/src/FuncGen.cpp index ab1ebbe..5477ed4 100644 --- a/src/FuncGen.cpp +++ b/src/FuncGen.cpp @@ -23,10 +23,6 @@ #include "ContainerInfo.h" -#ifndef OSS_ENABLE -#include "cea/object-introspection/internal/FuncGenInternal.h" -#endif - namespace { const std::string typedValueFunc = R"( @@ -137,9 +133,6 @@ const std::string typedValueFunc = R"( } )"; -const std::map defaultTypeToDeclMap = {}; - -const std::map defaultTypeToFuncMap = {}; } // namespace void FuncGen::DeclareGetSize(std::string& testCode, const std::string& type) { @@ -461,18 +454,6 @@ void FuncGen::DeclareGetContainer(std::string& testCode) { testCode.append(func); } -// TODO: remove map initialisation once all container configs are removed from -// the code -FuncGen::FuncGen() - : typeToDeclMap(defaultTypeToDeclMap), typeToFuncMap(defaultTypeToFuncMap) { -#ifndef OSS_ENABLE - typeToDeclMap.insert(typeToDeclMapInternal.begin(), - typeToDeclMapInternal.end()); - typeToFuncMap.insert(typeToFuncMapInternal.begin(), - typeToFuncMapInternal.end()); -#endif -} - bool FuncGen::RegisterContainer(ContainerTypeEnum ctype, const fs::path& path) { toml::table container; try { diff --git a/src/FuncGen.h b/src/FuncGen.h index 2c47d2a..cac587b 100644 --- a/src/FuncGen.h +++ b/src/FuncGen.h @@ -25,8 +25,6 @@ namespace fs = std::filesystem; class FuncGen { public: - // TODO: remove me once all containers are in toml files - FuncGen(); bool RegisterContainer(ContainerTypeEnum, const fs::path& path); void DeclareStoreData(std::string& testCode); diff --git a/src/OICodeGen.cpp b/src/OICodeGen.cpp index 8bab4ff..4af46fd 100644 --- a/src/OICodeGen.cpp +++ b/src/OICodeGen.cpp @@ -34,9 +34,6 @@ #include "OIParser.h" #include "PaddingHunter.h" #include "SymbolService.h" -#ifndef OSS_ENABLE -#include "cea/object-introspection/internal/FuncGenInternal.h" -#endif namespace fs = std::filesystem; @@ -46,13 +43,6 @@ static size_t g_level = 0; #define VLOG(verboselevel) \ LOG_IF(INFO, VLOG_IS_ON(verboselevel)) << std::string(2 * g_level, ' ') -// typeName, numTemplateParams, ctype, header, namespaces... -// formatting disabled due to line length becoming a mess -// clang-format off -static const std::vector defaultContainerInfoList = { -}; -// clang-format on - std::unique_ptr OICodeGen::buildFromConfig(const Config &c) { auto cg = std::unique_ptr(new OICodeGen(c)); @@ -66,22 +56,7 @@ std::unique_ptr OICodeGen::buildFromConfig(const Config &c) { return cg; } -// TODO: remove containerInfoList initialisation once all container configs are -// removed from the code OICodeGen::OICodeGen(const Config &c) : config{c} { -#ifndef OSS_ENABLE - containerInfoList.reserve(containerInfoListInternal.size() + - defaultContainerInfoList.size()); - for (const auto &el : containerInfoListInternal) { - containerInfoList.push_back(std::make_unique(el)); - } -#endif - - containerInfoList.reserve(defaultContainerInfoList.size()); - for (const auto &el : defaultContainerInfoList) { - containerInfoList.push_back(std::make_unique(el)); - } - // TODO: Should folly::Range just be added as a container? auto typesToStub = std::array{ "SharedMutex",