diff options
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 |
