For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index e2505cc..ff6d8f0 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -23,7 +23,6 @@
 #include "llvm/Constants.h"
 #include "llvm/InlineAsm.h"
 #include "llvm/Instructions.h"
-#include "llvm/SymbolTable.h"
 #include "llvm/TypeSymbolTable.h"
 #include "llvm/Bytecode/Format.h"
 #include "llvm/Config/alloca.h"
@@ -55,6 +54,7 @@
 inline void BytecodeReader::error(const std::string& err) {
   ErrorMsg = err + " (Vers=" + itostr(RevisionNum) + ", Pos=" 
     + itostr(At-MemStart) + ")";
+  if (Handler) Handler->handleError(ErrorMsg);
   longjmp(context,1);
 }
 
@@ -443,10 +443,6 @@
   // of opcodes.
   Instruction* Result = 0;
 
-  // We have enough info to inform the handler now.
-  if (Handler) 
-    Handler->handleInstruction(Opcode, InstTy, Oprnds, At-SaveAt);
-
   // First, handle the easy binary operators case
   if (Opcode >= Instruction::BinaryOpsBegin &&
       Opcode <  Instruction::BinaryOpsEnd  && Oprnds.size() == 2) {
@@ -861,6 +857,10 @@
   else
     TypeSlot = getTypeSlot(Result->getType());
 
+  // We have enough info to inform the handler now.
+  if (Handler) 
+    Handler->handleInstruction(Opcode, InstTy, Oprnds, Result, At-SaveAt);
+
   insertValue(Result, TypeSlot, FunctionValues);
 }
 
@@ -936,9 +936,9 @@
 /// CurrentFunction's symbol table. For Module level symbol tables, the
 /// CurrentFunction argument must be zero.
 void BytecodeReader::ParseValueSymbolTable(Function *CurrentFunction,
-                                           SymbolTable *ST) {
+                                           ValueSymbolTable *VST) {
                                       
-  if (Handler) Handler->handleSymbolTableBegin(CurrentFunction,ST);
+  if (Handler) Handler->handleValueSymbolTableBegin(CurrentFunction,VST);
 
   // Allow efficient basic block lookup by number.
   std::vector<BasicBlock*> BBMap;
@@ -963,13 +963,15 @@
       } else {
         V = getValue(Typ, slot, false); // Find mapping...
       }
+      if (Handler) Handler->handleSymbolTableValue(Typ, slot, Name);
       if (V == 0)
-        error("Failed value look-up for name '" + Name + "'");
+        error("Failed value look-up for name '" + Name + "', type #" + 
+              utostr(Typ) + " slot #" + utostr(slot));
       V->setName(Name);
     }
   }
   checkPastBlockEnd("Symbol Table");
-  if (Handler) Handler->handleSymbolTableEnd();
+  if (Handler) Handler->handleValueSymbolTableEnd();
 }
 
 // Parse a single type. The typeid is read in first. If its a primitive type