#include "source/opt/debug_info_manager.h"
#include <cassert>
#include "source/opt/ir_context.h"
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) { … }
}
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) { … }
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) { … }
}
}
}