Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/language/duchain/topducontextdynamicdata.cpp
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 78 | if(item.d_func()->isDynamic()) { | |||
---|---|---|---|---|---|
82 | DUChainItemSystem::self().copy(*item.d_func(), target, true); | 82 | DUChainItemSystem::self().copy(*item.d_func(), target, true); | ||
83 | Q_ASSERT(!target.isDynamic()); | 83 | Q_ASSERT(!target.isDynamic()); | ||
84 | if (!isSharedDataItem) { | 84 | if (!isSharedDataItem) { | ||
85 | item.setData(&target); | 85 | item.setData(&target); | ||
86 | } | 86 | } | ||
87 | disableDUChainReferenceCounting(data.back().array.data()); | 87 | disableDUChainReferenceCounting(data.back().array.data()); | ||
88 | }else{ | 88 | }else{ | ||
89 | //Just copy the data into another place, expensive copy constructors are not needed | 89 | //Just copy the data into another place, expensive copy constructors are not needed | ||
90 | #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 800) | ||||
91 | #pragma GCC diagnostic push | ||||
92 | #pragma GCC diagnostic ignored "-Wclass-memaccess" | ||||
90 | memcpy(&target, item.d_func(), size); | 93 | memcpy(&target, item.d_func(), size); | ||
94 | #pragma GCC diagnostic pop | ||||
95 | #endif | ||||
91 | if (!isSharedDataItem) { | 96 | if (!isSharedDataItem) { | ||
92 | item.setData(&target, false); | 97 | item.setData(&target, false); | ||
93 | } | 98 | } | ||
94 | } | 99 | } | ||
95 | 100 | | |||
96 | if (!isSharedDataItem) { | 101 | if (!isSharedDataItem) { | ||
97 | Q_ASSERT(item.d_func() == &target); | 102 | Q_ASSERT(item.d_func() == &target); | ||
98 | 103 | | |||
▲ Show 20 Lines • Show All 655 Lines • ▼ Show 20 Line(s) | 749 | TopDUContextDynamicData::ItemDataInfo TopDUContextDynamicData::writeDataInfo(const ItemDataInfo& info, const DUChainBaseData* data, uint& totalDataOffset) { | |||
754 | 759 | | |||
755 | ret.dataOffset = totalDataOffset; | 760 | ret.dataOffset = totalDataOffset; | ||
756 | 761 | | |||
757 | uint pos = m_data.back().position; | 762 | uint pos = m_data.back().position; | ||
758 | m_data.back().position += size; | 763 | m_data.back().position += size; | ||
759 | totalDataOffset += size; | 764 | totalDataOffset += size; | ||
760 | 765 | | |||
761 | auto target = reinterpret_cast<DUChainBaseData*>(m_data.back().array.data() + pos); | 766 | auto target = reinterpret_cast<DUChainBaseData*>(m_data.back().array.data() + pos); | ||
767 | #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 800) | ||||
768 | #pragma GCC diagnostic push | ||||
769 | #pragma GCC diagnostic ignored "-Wclass-memaccess" | ||||
762 | memcpy(target, data, size); | 770 | memcpy(target, data, size); | ||
771 | #pragma GCC diagnostic pop | ||||
772 | #endif | ||||
763 | 773 | | |||
764 | verifyDataInfo(ret, m_data); | 774 | verifyDataInfo(ret, m_data); | ||
765 | return ret; | 775 | return ret; | ||
766 | } | 776 | } | ||
767 | 777 | | |||
768 | uint TopDUContextDynamicData::allocateDeclarationIndex(Declaration* decl, bool temporary) | 778 | uint TopDUContextDynamicData::allocateDeclarationIndex(Declaration* decl, bool temporary) | ||
769 | { | 779 | { | ||
770 | return m_declarations.allocateItemIndex(decl, temporary); | 780 | return m_declarations.allocateItemIndex(decl, temporary); | ||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |