diff options
author | Chris Lattner <sabre@nondot.org> | 2007-09-21 18:30:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-09-21 18:30:39 +0000 |
commit | 27725bf13f188c2b46b0211fca0eb9d2bcbcafed (patch) | |
tree | 9c5a3a5a89e109a40c7aa55cbc58da8427127898 /lib/ExecutionEngine/Interpreter | |
parent | c369bd7c503dd748ae1697858f13291bfda6ed80 (diff) | |
download | external_llvm-27725bf13f188c2b46b0211fca0eb9d2bcbcafed.zip external_llvm-27725bf13f188c2b46b0211fca0eb9d2bcbcafed.tar.gz external_llvm-27725bf13f188c2b46b0211fca0eb9d2bcbcafed.tar.bz2 |
#ifdef out unsafe tracing code, which fixes PR1689
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index 53df544..95e2143 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -1338,20 +1338,6 @@ void Interpreter::callFunction(Function *F, StackFrame.VarArgs.assign(ArgVals.begin()+i, ArgVals.end()); } -static void PrintGenericValue(const GenericValue &Val, const Type* Ty) { - switch (Ty->getTypeID()) { - default: assert(0 && "Invalid GenericValue Type"); - case Type::VoidTyID: DOUT << "void"; break; - case Type::FloatTyID: DOUT << "float " << Val.FloatVal; break; - case Type::DoubleTyID: DOUT << "double " << Val.DoubleVal; break; - case Type::PointerTyID: DOUT << "void* " << intptr_t(Val.PointerVal); break; - case Type::IntegerTyID: - DOUT << "i" << Val.IntVal.getBitWidth() << " " - << Val.IntVal.toStringUnsigned(10) - << " (0x" << Val.IntVal.toStringUnsigned(16) << ")\n"; - break; - } -} void Interpreter::run() { while (!ECStack.empty()) { @@ -1364,12 +1350,28 @@ void Interpreter::run() { DOUT << "About to interpret: " << I; visit(I); // Dispatch to one of the visit* methods... +#if 0 + // This is not safe, as visiting the instruction could lower it and free I. #ifndef NDEBUG if (!isa<CallInst>(I) && !isa<InvokeInst>(I) && I.getType() != Type::VoidTy) { DOUT << " --> "; - PrintGenericValue(SF.Values[&I], I.getType()); + const GenericValue &Val = SF.Values[&I]; + switch (I.getType()->getTypeID()) { + default: assert(0 && "Invalid GenericValue Type"); + case Type::VoidTyID: DOUT << "void"; break; + case Type::FloatTyID: DOUT << "float " << Val.FloatVal; break; + case Type::DoubleTyID: DOUT << "double " << Val.DoubleVal; break; + case Type::PointerTyID: DOUT << "void* " << intptr_t(Val.PointerVal); + break; + case Type::IntegerTyID: + DOUT << "i" << Val.IntVal.getBitWidth() << " " + << Val.IntVal.toStringUnsigned(10) + << " (0x" << Val.IntVal.toStringUnsigned(16) << ")\n"; + break; + } } #endif +#endif } } |