diff --git a/hecl/extern/Athena b/hecl/extern/Athena index 25de226e6..ffca1f189 160000 --- a/hecl/extern/Athena +++ b/hecl/extern/Athena @@ -1 +1 @@ -Subproject commit 25de226e65934377daac37364b53c92a510841ca +Subproject commit ffca1f18974293e9c59ebd01546c9910a22e3679 diff --git a/hecl/include/HECL/Backend/GX.hpp b/hecl/include/HECL/Backend/GX.hpp index d6413d9c3..5e956d1f7 100644 --- a/hecl/include/HECL/Backend/GX.hpp +++ b/hecl/include/HECL/Backend/GX.hpp @@ -222,6 +222,9 @@ struct GX : IBackend /* Convenience Links */ TEVStage* m_prev = nullptr; TEVStage* m_next = nullptr; + + /* Remember this for debugging */ + SourceLocation m_loc; }; unsigned m_tevCount = 0; TEVStage m_tevs[16]; diff --git a/hecl/lib/Backend/GX.cpp b/hecl/lib/Backend/GX.cpp index 0fc69fdb3..23693ac2a 100644 --- a/hecl/lib/Backend/GX.cpp +++ b/hecl/lib/Backend/GX.cpp @@ -58,6 +58,7 @@ GX::TEVStage& GX::addTEVStage(Diagnostics& diag, const SourceLocation& loc) if (m_tevCount >= 16) diag.reportBackendErr(loc, "GX TEV stage overflow"); GX::TEVStage& newTEV = m_tevs[m_tevCount]; + newTEV.m_loc = loc; if (m_tevCount) { newTEV.m_prev = &m_tevs[m_tevCount-1]; @@ -669,7 +670,7 @@ void GX::reset(const IR& ir, Diagnostics& diag) TEVStage& stage = m_tevs[i]; if (stage.m_regOut == TEVLAZY) { - int picked = pickCLazy(diag, SourceLocation()); + int picked = pickCLazy(diag, stage.m_loc); stage.m_regOut = TevRegID(TEVREG0 + picked); for (int j=i+1 ; j