summaryrefslogtreecommitdiff
path: root/Type.hh
diff options
context:
space:
mode:
authorNagi5Yeq <wu@x-nagi.com>2020-05-31 13:11:44 +0800
committerNagi5Yeq <wu@x-nagi.com>2020-05-31 13:11:44 +0800
commit4a5bc55769804d003d6cd9f8c16eefb76bb53d1b (patch)
tree365756351275152391a812440f6a76b9f92cc854 /Type.hh
parentbd44c9eaef1f4dcbbd98d4489885566b6c7e5138 (diff)
full support of array, pointer and record stuffs
Diffstat (limited to 'Type.hh')
-rw-r--r--Type.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/Type.hh b/Type.hh
index e11a9ea..b686e28 100644
--- a/Type.hh
+++ b/Type.hh
@@ -197,6 +197,17 @@ class FunctionType : public Type {
std::shared_ptr<Type> ReturnType_;
std::vector<std::shared_ptr<Type>> ArgTypes_;
};
+
+using RecordMember = std::pair<std::string, std::shared_ptr<Type>>;
+
+class RecordType : public Type {
+ public:
+ RecordType(const std::vector<RecordMember>& members, std::string&& name);
+ std::pair<int, std::shared_ptr<Type>> GetMember(const std::string& name);
+
+ protected:
+ std::map<std::string, std::pair<int, std::shared_ptr<Type>>> members_;
+};
} // namespace pcc
#endif // PCC_TYPE_H