[llvm-commits] [bug_122] CVS: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp

LLVM llvm at cs.uiuc.edu
Wed May 12 11:33:51 PDT 2004


Changes in directory llvm/lib/ExecutionEngine/Interpreter:

ExternalFunctions.cpp updated: 1.73 -> 1.73.2.1

---
Log message:

Change SymbolTable to not subclass from std::map but to embed one instead 
and cleanup use of SymbolTable in rest of LLVM. Also, add some new methods
to SymbolTable for small/utility cases and substitute calls to them in 
LLVM.


---
Diffs of the changes:  (+2 -32)

Index: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.73 llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.73.2.1
--- llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.73	Sat May  1 01:42:15 2004
+++ llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp	Wed May 12 11:33:43 2004
@@ -547,38 +547,8 @@
 // change the FILE into the REAL stdio stream.
 // 
 static FILE *getFILE(void *Ptr) {
-  static Module *LastMod = 0;
-  static PointerTy IOBBase = 0;
-  static unsigned FILESize;
-
-  if (LastMod != &TheInterpreter->getModule()) { // Module change or initialize?
-    Module *M = LastMod = &TheInterpreter->getModule();
-
-    // Check to see if the currently loaded module contains an __iob symbol...
-    GlobalVariable *IOB = 0;
-    SymbolTable &ST = M->getSymbolTable();
-    for (SymbolTable::iterator I = ST.begin(), E = ST.end(); I != E; ++I) {
-      SymbolTable::VarMap &M = I->second;
-      for (SymbolTable::VarMap::iterator J = M.begin(), E = M.end();
-           J != E; ++J)
-        if (J->first == "__iob")
-          if ((IOB = dyn_cast<GlobalVariable>(J->second)))
-            break;
-      if (IOB) break;
-    }
-  }
-
-  // Check to see if this is a reference to __iob...
-  if (IOBBase) {
-    unsigned FDNum = ((unsigned long)Ptr-IOBBase)/FILESize;
-    if (FDNum == 0)
-      return stdin;
-    else if (FDNum == 1)
-      return stdout;
-    else if (FDNum == 2)
-      return stderr;
-  }
-
+    // Content of this function was excised because it had no effect.
+    // Probably need to avoid its use .
   return (FILE*)Ptr;
 }
 





More information about the llvm-commits mailing list