diff --git a/include/anvill/Declarations.h b/include/anvill/Declarations.h index 537dac533..777fc7b1c 100644 --- a/include/anvill/Declarations.h +++ b/include/anvill/Declarations.h @@ -66,6 +66,9 @@ struct ValueDecl { // Type of this value. llvm::Type *type{nullptr}; + + // Untranslated type string of this value. + std::string type_string; }; // A value declaration corresponding with a named parameter. @@ -105,6 +108,9 @@ struct VariableDecl { // `0x14` there is also an `int`. llvm::Type *type{nullptr}; + // Untranslated type string of this variable. + std::string type_string; + // Address of this global variable. std::uint64_t address{0}; diff --git a/lib/JSON.cpp b/lib/JSON.cpp index 1dea0a896..3da895f9b 100644 --- a/lib/JSON.cpp +++ b/lib/JSON.cpp @@ -361,6 +361,7 @@ JSONTranslator::DecodeValue(const llvm::json::Object *obj, const char *desc, if (auto maybe_type_str = obj->getString("type")) { std::string spec = maybe_type_str->str(); + decl.type_string = spec; auto type_spec_res = type_translator.DecodeFromString(spec); if (!type_spec_res.Succeeded()) { std::stringstream ss; @@ -754,6 +755,7 @@ JSONTranslator::DecodeGlobalVar(const llvm::json::Object *obj) const { anvill::VariableDecl decl; decl.type = type; + decl.type_string = spec; decl.address = address; return decl; } diff --git a/libraries/doctest/src b/libraries/doctest/src new file mode 160000 index 000000000..f0ab4e793 --- /dev/null +++ b/libraries/doctest/src @@ -0,0 +1 @@ +Subproject commit f0ab4e793fa863d4a5929ff263ddd3bebec8767e