From 607f3972349a17b9d06aca0ce733789f16f573c1 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 19 Mar 2015 16:48:54 +0100 Subject: added externalType for ArrayType --- Types.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Types.cpp') diff --git a/Types.cpp b/Types.cpp index 016f0b23..6fe8a641 100644 --- a/Types.cpp +++ b/Types.cpp @@ -742,6 +742,23 @@ string ArrayType::toString() const return ret + "]"; } +TypePointer ArrayType::externalType() const +{ + if (m_location != Location::CallData) + return TypePointer(); + if (m_isByteArray) + return shared_from_this(); + if (!(m_baseType->externalType())) + return TypePointer(); + if (dynamic_cast(m_baseType.get()) && m_baseType->isDynamicallySized()) + return TypePointer(); + + if (m_baseType->isDynamicallySized()) + return std::make_shared(Location::CallData, m_baseType->externalType()); + else + return std::make_shared(Location::CallData, m_baseType->externalType(), m_length); +} + shared_ptr ArrayType::copyForLocation(ArrayType::Location _location) const { auto copy = make_shared(_location); -- cgit