IR dot3 print v2 + true IR deep copy#1069
Open
keptsecret wants to merge 11 commits into
Open
Conversation
… changes in deepCopy and print
| #define HASH_OPTIONALS_HASH(HANDLE) if (HANDLE) {HASH_REQUIREDS_HASH(HANDLE);} else {hasher << core::blake3_hash_t::EmptyInput();} | ||
|
|
||
| virtual _typed_pointer_type<INode> copy(CTrueIR* ir) const = 0; | ||
| #define COPY_DEFAULT_IMPL inline _typed_pointer_type<INode> copy(CTrueIR* ir) const override final \ |
Member
There was a problem hiding this comment.
missing undef for this
Comment on lines
+369
to
+379
| inline typed_pointer_type<INode> getChildHandle_impl(const uint8_t ix) const override final { return block_allocator_type::_static_cast<INode>(child[0]); } | ||
| inline void setChild_impl(const uint8_t ix, _typed_pointer_type<INode> newChild) override final { child[0] = block_allocator_type::_static_cast<IFactor>(newChild); } | ||
|
|
||
| inline _typed_pointer_type<INode> copy(CTrueIR* ir) const override final | ||
| { | ||
| auto& pool = ir->getObjectPool(); | ||
| const auto copyH = pool.emplace<std::remove_const_t<std::remove_pointer_t<decltype(this)> > >(getState()); | ||
| if (auto* const copy = pool.deref(copyH); copyH) | ||
| *copy = *this; | ||
| return copyH; | ||
| } |
There was a problem hiding this comment.
these are wrong, child is variable size/length
|
|
||
| inline typed_pointer_type<INode> getChildHandle_impl(const uint8_t ix) const override final | ||
| { | ||
| return ix ? block_allocator_type::_static_cast<INode>(factor) : block_allocator_type::_static_cast<INode>(contributor); |
There was a problem hiding this comment.
you don't need to static cast up the hierarchy, handle should do it by itself, the probelm stems from you trying to return a typed<T> instead of a typed<const T>
| public: | ||
| inline EFinalType getFinalType() const override {return EFinalType::CCorellatedTransmission;} | ||
|
|
||
| inline uint8_t getChildCount() const override final { return 3; } // TODO: or 4? |
Comment on lines
214
to
218
| const auto visited = visitedNodes.find(childHandle); | ||
| if (visited != visitedNodes.end()) | ||
| continue; | ||
| nodeStack.push_back(childHandle); | ||
| visitedNodes.insert(childHandle); |
There was a problem hiding this comment.
use the std::bind insert pattern
| } | ||
| } | ||
|
|
||
| uint32_t CTrueIR::deepCopy(typed_pointer_type<const INode>* out, |
There was a problem hiding this comment.
hmm actually the out could be pointer to non-const handles
| pushedChildren++; | ||
| } | ||
|
|
||
| // TODO: how to handle coated in CorrelatedTransmission? |
There was a problem hiding this comment.
treat it as a child
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.