diff options
| author | Nagi5Yeq <wu@x-nagi.com> | 2020-05-31 17:49:34 +0800 |
|---|---|---|
| committer | Nagi5Yeq <wu@x-nagi.com> | 2020-05-31 17:49:34 +0800 |
| commit | c2c6e5c7e620c32e7f420e8b9ac21df8855b444c (patch) | |
| tree | c790ec3650c2f6caed9b59b304bc6a8bbdef1da8 /TypeManager.cc | |
| parent | 4a5bc55769804d003d6cd9f8c16eefb76bb53d1b (diff) | |
support for extern functions
Diffstat (limited to 'TypeManager.cc')
| -rw-r--r-- | TypeManager.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/TypeManager.cc b/TypeManager.cc index 977d3bc..9c484e4 100644 --- a/TypeManager.cc +++ b/TypeManager.cc @@ -227,9 +227,10 @@ std::shared_ptr<RecordType> return NewType; } -std::shared_ptr<FunctionType> TypeManager::CreateFunctionType( - std::shared_ptr<Type> ReturnType, - std::vector<std::shared_ptr<Type>> ArgTypes) { +std::shared_ptr<FunctionType> + TypeManager::CreateFunctionType(std::shared_ptr<Type> ReturnType, + std::vector<std::shared_ptr<Type>> ArgTypes, + bool IsVariadic) { decltype(ArgTypes)::const_iterator ArgIt = ArgTypes.cbegin(); std::string name = " (*)("; if (!ArgTypes.empty()) { @@ -240,15 +241,16 @@ std::shared_ptr<FunctionType> TypeManager::CreateFunctionType( } } std::shared_ptr<FunctionType> NewType = std::make_shared<FunctionType>( - ReturnType, ArgTypes, ReturnType->GetCommonName() + name + ")"); + ReturnType, ArgTypes, ReturnType->GetCommonName() + name + ")", + IsVariadic); FunctionTypes_.push_back(NewType); return NewType; } -std::shared_ptr<Type> TypeManager::GetPointerIndexType_() { +std::shared_ptr<Type> TypeManager::GetPointerIndexType() { return PointerIndexType_; } -std::shared_ptr<Type> TypeManager::GetPointerDifferenceType_() { +std::shared_ptr<Type> TypeManager::GetPointerDifferenceType() { return PointerDifferenceType_; } |
