chromium/third_party/spirv-tools/src/source/opt/instruction.cpp

// Copyright (c) 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "source/opt/instruction.h"

#include <initializer_list>

#include "OpenCLDebugInfo100.h"
#include "source/disassemble.h"
#include "source/opt/fold.h"
#include "source/opt/ir_context.h"
#include "source/opt/reflect.h"

namespace spvtools {
namespace opt {
namespace {
// Indices used to get particular operands out of instructions using InOperand.
constexpr uint32_t kTypeImageDimIndex =;
constexpr uint32_t kLoadBaseIndex =;
constexpr uint32_t kPointerTypeStorageClassIndex =;
constexpr uint32_t kVariableStorageClassIndex =;
constexpr uint32_t kTypeImageSampledIndex =;

// Constants for OpenCL.DebugInfo.100 / NonSemantic.Shader.DebugInfo.100
// extension instructions.
constexpr uint32_t kExtInstSetIdInIdx =;
constexpr uint32_t kExtInstInstructionInIdx =;
constexpr uint32_t kDebugScopeNumWords =;
constexpr uint32_t kDebugScopeNumWordsWithoutInlinedAt =;
constexpr uint32_t kDebugNoScopeNumWords =;

// Number of operands of an OpBranchConditional instruction
// with weights.
constexpr uint32_t kOpBranchConditionalWithWeightsNumOperands =;
}  // namespace

Instruction::Instruction(IRContext* c)
    :{}

Instruction::Instruction(IRContext* c, spv::Op op)
    :{}

Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst,
                         std::vector<Instruction>&& dbg_line)
    :{}

Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst,
                         const DebugScope& dbg_scope)
    :{}

Instruction::Instruction(IRContext* c, spv::Op op, uint32_t ty_id,
                         uint32_t res_id, const OperandList& in_operands)
    :{}

Instruction::Instruction(Instruction&& that)
    :{}

Instruction& Instruction::operator=(Instruction&& that) {}

Instruction* Instruction::Clone(IRContext* c) const {}

uint32_t Instruction::GetSingleWordOperand(uint32_t index) const {}

uint32_t Instruction::NumInOperandWords() const {}

bool Instruction::HasBranchWeights() const {}

void Instruction::ToBinaryWithoutAttachedDebugInsts(
    std::vector<uint32_t>* binary) const {}

void Instruction::ReplaceOperands(const OperandList& new_operands) {}

bool Instruction::IsReadOnlyLoad() const {}

Instruction* Instruction::GetBaseAddress() const {}

bool Instruction::IsReadOnlyPointer() const {}

bool Instruction::IsVulkanStorageImage() const {}

bool Instruction::IsVulkanSampledImage() const {}

bool Instruction::IsVulkanStorageTexelBuffer() const {}

bool Instruction::IsVulkanStorageBuffer() const {}

bool Instruction::IsVulkanStorageBufferVariable() const {}

bool Instruction::IsVulkanUniformBuffer() const {}

bool Instruction::IsReadOnlyPointerShaders() const {}

bool Instruction::IsReadOnlyPointerKernel() const {}

void Instruction::UpdateLexicalScope(uint32_t scope) {}

void Instruction::UpdateDebugInlinedAt(uint32_t new_inlined_at) {}

void Instruction::ClearDbgLineInsts() {}

void Instruction::UpdateDebugInfoFrom(const Instruction* from) {}

void Instruction::AddDebugLine(const Instruction* inst) {}

bool Instruction::IsDebugLineInst() const {}

bool Instruction::IsLineInst() const {}

bool Instruction::IsLine() const {}

bool Instruction::IsNoLine() const {}

Instruction* Instruction::InsertBefore(std::unique_ptr<Instruction>&& inst) {}

Instruction* Instruction::InsertBefore(
    std::vector<std::unique_ptr<Instruction>>&& list) {}

bool Instruction::IsValidBasePointer() const {}

OpenCLDebugInfo100Instructions Instruction::GetOpenCL100DebugOpcode() const {}

NonSemanticShaderDebugInfo100Instructions Instruction::GetShader100DebugOpcode()
    const {}

CommonDebugInfoInstructions Instruction::GetCommonDebugOpcode() const {}

bool Instruction::IsValidBaseImage() const {}

bool Instruction::IsOpaqueType() const {}

bool Instruction::IsFoldable() const {}

bool Instruction::IsFoldableByFoldScalar() const {}

bool Instruction::IsFoldableByFoldVector() const {}

bool Instruction::IsFloatingPointFoldingAllowed() const {}

std::string Instruction::PrettyPrint(uint32_t options) const {}

std::ostream& operator<<(std::ostream& str, const Instruction& inst) {}

void Instruction::Dump() const {}

bool Instruction::IsOpcodeCodeMotionSafe() const {}

bool Instruction::IsScalarizable() const {}

bool Instruction::IsOpcodeSafeToDelete() const {}

bool Instruction::IsNonSemanticInstruction() const {}

void DebugScope::ToBinary(uint32_t type_id, uint32_t result_id,
                          uint32_t ext_set,
                          std::vector<uint32_t>* binary) const {}

}  // namespace opt
}  // namespace spvtools