mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-10-18 19:20:05 +00:00
Document opt::Instruction::InsertBefore methods (#2751)
This commit is contained in:
parent
aa9e8f5380
commit
76b75c40a1
@ -372,6 +372,11 @@ uint32_t Instruction::GetTypeComponent(uint32_t element) const {
|
||||
return subtype;
|
||||
}
|
||||
|
||||
Instruction* Instruction::InsertBefore(std::unique_ptr<Instruction>&& i) {
|
||||
i.get()->InsertBefore(this);
|
||||
return i.release();
|
||||
}
|
||||
|
||||
Instruction* Instruction::InsertBefore(
|
||||
std::vector<std::unique_ptr<Instruction>>&& list) {
|
||||
Instruction* first_node = list.front().get();
|
||||
@ -382,11 +387,6 @@ Instruction* Instruction::InsertBefore(
|
||||
return first_node;
|
||||
}
|
||||
|
||||
Instruction* Instruction::InsertBefore(std::unique_ptr<Instruction>&& i) {
|
||||
i.get()->InsertBefore(this);
|
||||
return i.release();
|
||||
}
|
||||
|
||||
bool Instruction::IsValidBasePointer() const {
|
||||
uint32_t tid = type_id();
|
||||
if (tid == 0) {
|
||||
|
@ -398,8 +398,13 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> {
|
||||
inline bool operator!=(const Instruction&) const;
|
||||
inline bool operator<(const Instruction&) const;
|
||||
|
||||
Instruction* InsertBefore(std::vector<std::unique_ptr<Instruction>>&& list);
|
||||
// Takes ownership of the instruction owned by |i| and inserts it immediately
|
||||
// before |this|. Returns the insterted instruction.
|
||||
Instruction* InsertBefore(std::unique_ptr<Instruction>&& i);
|
||||
// Takes ownership of the instructions in |list| and inserts them in order
|
||||
// immediately before |this|. Returns the first inserted instruction.
|
||||
// Assumes the list is non-empty.
|
||||
Instruction* InsertBefore(std::vector<std::unique_ptr<Instruction>>&& list);
|
||||
using utils::IntrusiveNodeBase<Instruction>::InsertBefore;
|
||||
|
||||
// Returns true if |this| is an instruction defining a constant, but not a
|
||||
|
Loading…
Reference in New Issue
Block a user