mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 04:50:35 +00:00
Make required nextSSAId parameter reference not pointer
This commit is contained in:
@@ -2580,7 +2580,7 @@ void LLVMOrderAccumulator::processGlobals(Program *prog, bool doLiveChecking)
|
||||
}
|
||||
}
|
||||
|
||||
void LLVMOrderAccumulator::processFunction(const Function *f, uint32_t *nextSSAId)
|
||||
void LLVMOrderAccumulator::processFunction(const Function *f, uint32_t &nextSSAId)
|
||||
{
|
||||
const Function &func = *f;
|
||||
|
||||
@@ -2637,8 +2637,8 @@ void LLVMOrderAccumulator::processFunction(const Function *f, uint32_t *nextSSAI
|
||||
#if DISABLED(DXC_COMPATIBLE_DISASM)
|
||||
if(arg->slot == ~0U)
|
||||
{
|
||||
arg->slot = *nextSSAId;
|
||||
(*nextSSAId)++;
|
||||
arg->slot = nextSSAId;
|
||||
nextSSAId++;
|
||||
}
|
||||
#else
|
||||
if(arg->getName().isEmpty())
|
||||
@@ -2671,8 +2671,8 @@ void LLVMOrderAccumulator::processFunction(const Function *f, uint32_t *nextSSAI
|
||||
#if DISABLED(DXC_COMPATIBLE_DISASM)
|
||||
if(inst->slot == ~0U)
|
||||
{
|
||||
inst->slot = *nextSSAId;
|
||||
(*nextSSAId)++;
|
||||
inst->slot = nextSSAId;
|
||||
nextSSAId++;
|
||||
}
|
||||
#else
|
||||
if(inst->getName().isEmpty())
|
||||
|
||||
@@ -1387,7 +1387,7 @@ public:
|
||||
size_t firstFuncConst;
|
||||
size_t numFuncConsts;
|
||||
|
||||
void processFunction(const Function *f, uint32_t *nextSSAId = NULL);
|
||||
void processFunction(const Function *f, uint32_t &nextSSAId);
|
||||
void exitFunction();
|
||||
|
||||
private:
|
||||
|
||||
@@ -89,9 +89,11 @@ ProgramEditor::ProgramEditor(const DXBC::DXBCContainer *container, bytebuf &outB
|
||||
for(size_t idx = accum.firstConst; idx < accum.firstConst + accum.numConsts; idx++)
|
||||
m_Constants.push_back((Constant *)cast<const Constant>(accum.values[idx]));
|
||||
|
||||
uint32_t ssaID = 0;
|
||||
|
||||
for(Function *f : m_Functions)
|
||||
{
|
||||
accum.processFunction(f);
|
||||
accum.processFunction(f, ssaID);
|
||||
for(size_t idx = accum.firstFuncConst; idx < accum.firstFuncConst + accum.numFuncConsts; idx++)
|
||||
m_Constants.push_back((Constant *)cast<const Constant>(accum.values[idx]));
|
||||
accum.exitFunction();
|
||||
@@ -105,11 +107,13 @@ ProgramEditor::~ProgramEditor()
|
||||
LLVMOrderAccumulator accum;
|
||||
accum.processGlobals(this, true);
|
||||
|
||||
uint32_t ssaID = 0;
|
||||
|
||||
// delete any functions that aren't referenced by call instructions
|
||||
rdcarray<const Function *> keep;
|
||||
for(Function *f : m_Functions)
|
||||
{
|
||||
accum.processFunction(f);
|
||||
accum.processFunction(f, ssaID);
|
||||
accum.exitFunction();
|
||||
}
|
||||
|
||||
@@ -1065,6 +1069,8 @@ bytebuf ProgramEditor::EncodeProgram()
|
||||
} \
|
||||
}
|
||||
|
||||
uint32_t ssaID = 0;
|
||||
|
||||
for(Function *f : m_Functions)
|
||||
{
|
||||
if(f->external)
|
||||
@@ -1074,7 +1080,7 @@ bytebuf ProgramEditor::EncodeProgram()
|
||||
|
||||
writer.Record(LLVMBC::FunctionRecord::DECLAREBLOCKS, f->blocks.size());
|
||||
|
||||
accum.processFunction(f);
|
||||
accum.processFunction(f, ssaID);
|
||||
|
||||
if(accum.numFuncConsts)
|
||||
{
|
||||
|
||||
@@ -1064,7 +1064,7 @@ void Program::SettleIDs()
|
||||
uint32_t &nextMetaSlot = m_NextMetaSlot;
|
||||
for(size_t i = 0; i < m_Functions.size(); i++)
|
||||
{
|
||||
m_Accum.processFunction(m_Functions[i], &m_NextSSAId);
|
||||
m_Accum.processFunction(m_Functions[i], m_NextSSAId);
|
||||
|
||||
Function &func = *m_Functions[i];
|
||||
|
||||
@@ -1636,11 +1636,13 @@ void Program::MakeDXCDisassemblyString()
|
||||
m_Disassembly += DisassembleTypes(m_DisassemblyInstructionLine);
|
||||
m_Disassembly += DisassembleGlobalVars(m_DisassemblyInstructionLine);
|
||||
|
||||
uint32_t ssaID = 0;
|
||||
|
||||
for(size_t i = 0; i < m_Functions.size(); i++)
|
||||
{
|
||||
const Function &func = *m_Functions[i];
|
||||
|
||||
m_Accum.processFunction(m_Functions[i]);
|
||||
m_Accum.processFunction(m_Functions[i], ssaID);
|
||||
|
||||
if(func.attrs && func.attrs->functionSlot)
|
||||
{
|
||||
@@ -2709,11 +2711,13 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
|
||||
|
||||
const char *swizzle = "xyzw";
|
||||
|
||||
uint32_t ssaID = 0;
|
||||
|
||||
for(size_t i = 0; i < m_Functions.size(); i++)
|
||||
{
|
||||
const Function &func = *m_Functions[i];
|
||||
|
||||
m_Accum.processFunction(m_Functions[i]);
|
||||
m_Accum.processFunction(m_Functions[i], ssaID);
|
||||
|
||||
if(func.external)
|
||||
continue;
|
||||
@@ -4705,11 +4709,13 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
|
||||
|
||||
void Program::ParseReferences(const DXBC::Reflection *reflection)
|
||||
{
|
||||
uint32_t ssaID = 0;
|
||||
|
||||
for(size_t i = 0; i < m_Functions.size(); i++)
|
||||
{
|
||||
const Function &func = *m_Functions[i];
|
||||
|
||||
m_Accum.processFunction(m_Functions[i]);
|
||||
m_Accum.processFunction(m_Functions[i], ssaID);
|
||||
|
||||
if(func.external)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user