Remove some code that moved to the generic asm printer a long time ago.
authorNate Begeman <natebegeman@mac.com>
Tue, 12 Jul 2005 18:34:15 +0000 (18:34 +0000)
committerNate Begeman <natebegeman@mac.com>
Tue, 12 Jul 2005 18:34:15 +0000 (18:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22407 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCAsmPrinter.cpp

index d9a818b6bd02fd927d2f7793545a27c050bd5db0..a468c5eb75b26821a20e00b9e41433037939012b 100644 (file)
@@ -225,90 +225,6 @@ static void SwitchSection(std::ostream &OS, std::string &CurSection,
   }
 }
 
-/// isStringCompatible - Can we treat the specified array as a string?
-/// Only if it is an array of ubytes or non-negative sbytes.
-///
-static bool isStringCompatible(const ConstantArray *CVA) {
-  const Type *ETy = cast<ArrayType>(CVA->getType())->getElementType();
-  if (ETy == Type::UByteTy) return true;
-  if (ETy != Type::SByteTy) return false;
-
-  for (unsigned i = 0; i < CVA->getNumOperands(); ++i)
-    if (cast<ConstantSInt>(CVA->getOperand(i))->getValue() < 0)
-      return false;
-
-  return true;
-}
-
-/// toOctal - Convert the low order bits of X into an octal digit.
-///
-static inline char toOctal(int X) {
-  return (X&7)+'0';
-}
-
-// Possible states while outputting ASCII strings
-namespace {
-  enum StringSection {
-    None,
-    Alpha,
-    Numeric
-  };
-}
-
-/// SwitchStringSection - manage the changes required to output bytes as
-/// characters in a string vs. numeric decimal values
-///
-static inline void SwitchStringSection(std::ostream &O, StringSection NewSect,
-                                       StringSection &Current) {
-  if (Current == None) {
-    if (NewSect == Alpha)
-      O << "\t.byte \"";
-    else if (NewSect == Numeric)
-      O << "\t.byte ";
-  } else if (Current == Alpha) {
-    if (NewSect == None)
-      O << "\"";
-    else if (NewSect == Numeric)
-      O << "\"\n"
-        << "\t.byte ";
-  } else if (Current == Numeric) {
-    if (NewSect == Alpha)
-      O << '\n'
-        << "\t.byte \"";
-    else if (NewSect == Numeric)
-      O << ", ";
-  }
-
-  Current = NewSect;
-}
-
-/// getAsCString - Return the specified array as a C compatible
-/// string, only if the predicate isStringCompatible is true.
-///
-static void printAsCString(std::ostream &O, const ConstantArray *CVA) {
-  assert(isStringCompatible(CVA) && "Array is not string compatible!");
-
-  if (CVA->getNumOperands() == 0)
-    return;
-
-  StringSection Current = None;
-  for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i) {
-    unsigned char C = cast<ConstantInt>(CVA->getOperand(i))->getRawValue();
-    if (C == '"') {
-      SwitchStringSection(O, Alpha, Current);
-      O << "\"\"";
-    } else if (isprint(C)) {
-      SwitchStringSection(O, Alpha, Current);
-      O << C;
-    } else {
-      SwitchStringSection(O, Numeric, Current);
-      O << utostr((unsigned)C);
-    }
-  }
-  SwitchStringSection(O, None, Current);
-  O << '\n';
-}
-
 /// createDarwinAsmPrinterPass - Returns a pass that prints the PPC assembly
 /// code for a MachineFunction to the given output stream, in a format that the
 /// Darwin assembler can deal with.