diff options
Diffstat (limited to 'tools/standalone_miri/module_tree.hpp')
-rw-r--r-- | tools/standalone_miri/module_tree.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/standalone_miri/module_tree.hpp b/tools/standalone_miri/module_tree.hpp index 5da8439f..299aa51c 100644 --- a/tools/standalone_miri/module_tree.hpp +++ b/tools/standalone_miri/module_tree.hpp @@ -49,6 +49,8 @@ class ModuleTree // Hack: Tuples are stored as `::""::<A,B,C,...>` ::std::map<::HIR::GenericPath, ::std::unique_ptr<DataType>> data_types; + ::std::set<FunctionType> function_types; // note: insertion doesn't invaliate pointers. + ::std::map<::std::string, const Function*> ext_functions; public: ModuleTree(); @@ -95,3 +97,21 @@ struct DataType }; ::std::vector<VariantValue> variants; }; + +struct FunctionType +{ + bool unsafe; + ::std::string abi; + ::std::vector<HIR::TypeRef> args; + HIR::TypeRef ret; + + bool operator<(const FunctionType& x) const { + #define _(f) if(f != x.f) return f < x.f + _(unsafe); + _(abi); + _(args); + _(ret); + #undef _ + return false; + } +}; |