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

// Copyright (c) 2020-2022 Google LLC
// Copyright (c) 2022 LunarG 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/debug_info_manager.h"

#include <cassert>

#include "source/opt/ir_context.h"

// Constants for OpenCL.DebugInfo.100 & NonSemantic.Shader.DebugInfo.100
// extension instructions.

namespace spvtools {
namespace opt {
namespace analysis {
namespace {
constexpr uint32_t kOpLineOperandLineIndex =;
constexpr uint32_t kLineOperandIndexDebugFunction =;
constexpr uint32_t kLineOperandIndexDebugLexicalBlock =;
constexpr uint32_t kLineOperandIndexDebugLine =;
constexpr uint32_t kDebugFunctionOperandFunctionIndex =;
constexpr uint32_t kDebugFunctionDefinitionOperandDebugFunctionIndex =;
constexpr uint32_t kDebugFunctionDefinitionOperandOpFunctionIndex =;
constexpr uint32_t kDebugFunctionOperandParentIndex =;
constexpr uint32_t kDebugTypeCompositeOperandParentIndex =;
constexpr uint32_t kDebugLexicalBlockOperandParentIndex =;
constexpr uint32_t kDebugInlinedAtOperandInlinedIndex =;
constexpr uint32_t kDebugExpressOperandOperationIndex =;
constexpr uint32_t kDebugDeclareOperandLocalVariableIndex =;
constexpr uint32_t kDebugDeclareOperandVariableIndex =;
constexpr uint32_t kDebugValueOperandExpressionIndex =;
constexpr uint32_t kDebugOperationOperandOperationIndex =;
constexpr uint32_t kOpVariableOperandStorageClassIndex =;
constexpr uint32_t kDebugLocalVariableOperandParentIndex =;
constexpr uint32_t kExtInstInstructionInIdx =;
constexpr uint32_t kDebugGlobalVariableOperandFlagsIndex =;
constexpr uint32_t kDebugLocalVariableOperandFlagsIndex =;

void SetInlinedOperand(Instruction* dbg_inlined_at, uint32_t inlined_operand) {}

uint32_t GetInlinedOperand(Instruction* dbg_inlined_at) {}

bool IsEmptyDebugExpression(Instruction* instr) {}

}  // namespace

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

uint32_t DebugInfoManager::GetDbgSetImportId() {}

Instruction* DebugInfoManager::GetDbgInst(uint32_t id) {}

void DebugInfoManager::RegisterDbgInst(Instruction* inst) {}

void DebugInfoManager::RegisterDbgFunction(Instruction* inst) {}

void DebugInfoManager::RegisterDbgDeclare(uint32_t var_id,
                                          Instruction* dbg_declare) {}

// Create new constant directly into global value area, bypassing the
// Constant manager. This is used when the DefUse or Constant managers
// are invalid and cannot be regenerated due to the module being in an
// inconsistent state e.g. in the middle of significant modification
// such as inlining. Invalidate Constant and DefUse managers if used.
uint32_t AddNewConstInGlobals(IRContext* context, uint32_t const_value) {}

uint32_t DebugInfoManager::CreateDebugInlinedAt(const Instruction* line,
                                                const DebugScope& scope) {}

DebugScope DebugInfoManager::BuildDebugScope(
    const DebugScope& callee_instr_scope,
    DebugInlinedAtContext* inlined_at_ctx) {}

uint32_t DebugInfoManager::BuildDebugInlinedAtChain(
    uint32_t callee_inlined_at, DebugInlinedAtContext* inlined_at_ctx) {}

Instruction* DebugInfoManager::GetDebugOperationWithDeref() {}

Instruction* DebugInfoManager::DerefDebugExpression(Instruction* dbg_expr) {}

Instruction* DebugInfoManager::GetDebugInfoNone() {}

Instruction* DebugInfoManager::GetEmptyDebugExpression() {}

Instruction* DebugInfoManager::GetDebugInlinedAt(uint32_t dbg_inlined_at_id) {}

Instruction* DebugInfoManager::CloneDebugInlinedAt(uint32_t clone_inlined_at_id,
                                                   Instruction* insert_before) {}

bool DebugInfoManager::IsVariableDebugDeclared(uint32_t variable_id) {}

bool DebugInfoManager::KillDebugDeclares(uint32_t variable_id) {}

uint32_t DebugInfoManager::GetParentScope(uint32_t child_scope) {}

bool DebugInfoManager::IsAncestorOfScope(uint32_t scope, uint32_t ancestor) {}

bool DebugInfoManager::IsDeclareVisibleToInstr(Instruction* dbg_declare,
                                               Instruction* scope) {}

bool DebugInfoManager::AddDebugValueForVariable(Instruction* scope_and_line,
                                                uint32_t variable_id,
                                                uint32_t value_id,
                                                Instruction* insert_pos) {}

Instruction* DebugInfoManager::AddDebugValueForDecl(
    Instruction* dbg_decl, uint32_t value_id, Instruction* insert_before,
    Instruction* scope_and_line) {}

uint32_t DebugInfoManager::GetVulkanDebugOperation(Instruction* inst) {}

uint32_t DebugInfoManager::GetVariableIdOfDebugValueUsedForDeclare(
    Instruction* inst) {}

bool DebugInfoManager::IsDebugDeclare(Instruction* instr) {}

void DebugInfoManager::ReplaceAllUsesInDebugScopeWithPredicate(
    uint32_t before, uint32_t after,
    const std::function<bool(Instruction*)>& predicate) {}

void DebugInfoManager::ClearDebugScopeAndInlinedAtUses(Instruction* inst) {}

void DebugInfoManager::AnalyzeDebugInst(Instruction* inst) {}

void DebugInfoManager::ConvertDebugGlobalToLocalVariable(
    Instruction* dbg_global_var, Instruction* local_var) {}

void DebugInfoManager::AnalyzeDebugInsts(Module& module) {}

void DebugInfoManager::ClearDebugInfo(Instruction* instr) {}

}  // namespace analysis
}  // namespace opt
}  // namespace spvtools