visual-decaf / decaf-compiler

Compiler of decaf language
1 stars 3 forks source link

合并常量池类型 #46

Closed DistinctWind closed 1 year ago

DistinctWind commented 1 year ago

考虑到C++中,不能按照返回值重载函数,基类里的get_constant根本没用。

template<typename T>
class BasicConstantPool {
public:
    using index_type = size_t;
    virtual index_type add_constant(const T&) = 0;
    virtual T get_constant(index_type) = 0;
};

就把这一整段都删除了吧