From 9a3ccdbdfb06de99e1e2faa83a46f33ca41fe3db Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 21 Apr 2003 22:44:36 +0000 Subject: [PATCH] Make stderr, stdout, stdin work with LLI llvm-svn: 5832 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 96ca54a71120..3d190aa0f81d 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -213,6 +213,12 @@ void ExecutionEngine::emitGlobals() { DEBUG(std::cerr << "Global '" << I->getName() << "' -> " << (void*)GlobalAddress[I] << "\n"); + } else if (I->getName() == "stdout") { + GlobalAddress[I] = &stdout; + } else if (I->getName() == "stderr") { + GlobalAddress[I] = &stderr; + } else if (I->getName() == "stdin") { + GlobalAddress[I] = &stdin; } else { std::cerr << "Global: " << I->getName() << "\n"; assert(0 && "References to external globals not handled yet!");