From 789d248558061fe4d65f664d6770a12b90fa2e34 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 26 Oct 2007 19:12:02 -0400 Subject: Hold a stack of temporaries so that we can redeclare them for all defined functions. Fixes crashes in function calls. --- src/mesa/pipe/llvm/storage.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/mesa/pipe/llvm/storage.cpp') diff --git a/src/mesa/pipe/llvm/storage.cpp b/src/mesa/pipe/llvm/storage.cpp index 88ef6711cfb..7300cdfef06 100644 --- a/src/mesa/pipe/llvm/storage.cpp +++ b/src/mesa/pipe/llvm/storage.cpp @@ -369,3 +369,24 @@ void Storage::popArguments() m_CONST = arg.cst; m_argStack.pop(); } + +void Storage::pushTemps() +{ + m_tempStack.push(m_temps); + std::vector oldTemps = m_temps; + m_temps = std::vector(32); + int i = 0; + for (std::vector::iterator itr = oldTemps.begin(); + itr != oldTemps.end(); ++itr) { + if (*itr) { + declareTemp(i); + } + ++i; + } +} + +void Storage::popTemps() +{ + m_temps = m_tempStack.top(); + m_tempStack.pop(); +} -- cgit v1.2.3