aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-07-12 18:34:15 +0000
committerNate Begeman <natebegeman@mac.com>2005-07-12 18:34:15 +0000
commit63b3f9acae5ccfc7f806c461a2e9509318eac5b8 (patch)
treef41b7cf96b69ad7187c3bd0614e8efa4b3c871c2
parentfce2ddcefd297630e8983a4e8971451d07c9a888 (diff)
Remove some code that moved to the generic asm printer a long time ago.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22407 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PPCAsmPrinter.cpp84
1 files changed, 0 insertions, 84 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index d9a818b6bd..a468c5eb75 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -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.