Let a target specify whether it wants an assembly printer to be the MC version
[oota-llvm.git] / utils / TableGen / X86DisassemblerTables.cpp
index 83284a77ba2739864c0b6313d22fcfcbba633783..2176224523a38cd0ac72d2e55fc8cc9b90b37b1a 100644 (file)
@@ -21,8 +21,6 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Format.h"
 
-#include <string>
-
 using namespace llvm;
 using namespace X86Disassembler;
   
@@ -107,6 +105,8 @@ static inline const char* stringForContext(InstructionContext insnContext) {
   INSTRUCTION_CONTEXTS
 #undef ENUM_ENTRY
   }
+
+  return 0;
 }
 
 /// stringForOperandType - Like stringForContext, but for OperandTypes.
@@ -161,7 +161,7 @@ void DisassemblerTables::emitOneID(raw_ostream &o,
 /// @param i        - The indentation level for that output stream.
 static void emitEmptyTable(raw_ostream &o, uint32_t &i)
 {
-  o.indent(i * 2) << "InstrUID modRMEmptyTable[1] = { 0 };" << "\n";
+  o.indent(i * 2) << "static InstrUID modRMEmptyTable[1] = { 0 };" << "\n";
   o << "\n";
 }
 
@@ -238,7 +238,7 @@ DisassemblerTables::DisassemblerTables() {
   
   for (i = 0; i < 4; i++) {
     Tables[i] = new ContextDecision;
-    bzero(Tables[i], sizeof(ContextDecision));
+    memset(Tables[i], 0, sizeof(ContextDecision));
   }
   
   HasConflicts = false;
@@ -275,7 +275,7 @@ void DisassemblerTables::emitModRMDecision(raw_ostream &o1,
     return;
   }
     
-  o1.indent(i1) << "InstrUID modRMTable" << thisTableNumber;
+  o1.indent(i1) << "static InstrUID modRMTable" << thisTableNumber;
     
   switch (dt) {
     default: