diff options
| author | Nagi5Yeq <wu@x-nagi.com> | 2020-06-01 21:34:58 +0800 |
|---|---|---|
| committer | Nagi5Yeq <wu@x-nagi.com> | 2020-06-01 21:34:58 +0800 |
| commit | cd1466f30c146e12faa0db7e1b53b508bf2274c6 (patch) | |
| tree | d938d02d17bbf4949b0dc1d21dee861afe171bdc /TypeManager.cc | |
| parent | f90115fba35887aea8d4064b57f4909cd6937134 (diff) | |
64 bit support
Diffstat (limited to 'TypeManager.cc')
| -rw-r--r-- | TypeManager.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/TypeManager.cc b/TypeManager.cc index 7402875..0cfbe75 100644 --- a/TypeManager.cc +++ b/TypeManager.cc @@ -5,11 +5,13 @@ namespace pcc { TypeManager::TypeManager() - : builtins_{std::make_shared<VoidType>(), std::make_shared<BooleanType>(), - std::make_shared<CharType>(), std::make_shared<IntegerType>(), - std::make_shared<RealType>()} { - PointerDifferenceType_ = GetBuiltinType(BuiltinType::INTEGER); - PointerIndexType_ = GetBuiltinType(BuiltinType::INTEGER); + : builtins_{std::make_shared<VoidType>(), std::make_shared<BooleanType>(), + std::make_shared<CharType>(), std::make_shared<IntegerType>(), + std::make_shared<Int64Type>(), std::make_shared<RealType>()} { + PointerIndexType_ = GetBuiltinType(BuiltinType::INT64); + PointerDifferenceType_ = GetBuiltinType(BuiltinType::INT64); + // llvm seems doesn't support GEP with i64 index type on records + RecordMemberIndexType_ = GetBuiltinType(BuiltinType::INTEGER); builtins_.push_back( GetPointerType(GetBuiltinType(BuiltinType::CHAR), "string")); // llvm doesn't have void* type, we use char* instead @@ -272,4 +274,8 @@ std::shared_ptr<Type> TypeManager::GetPointerDifferenceType() { return PointerDifferenceType_; } +std::shared_ptr<Type> TypeManager::GetRecordMemberIndexType() { + return RecordMemberIndexType_; +} + } // namespace pcc |
