mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Minor changes to make the diff be nothing against the X86 version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15841 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -106,21 +106,6 @@ FunctionPass *llvm::createPPCAsmPrinter(std::ostream &o,TargetMachine &tm) {
|
|||||||
// Include the auto-generated portion of the assembly writer
|
// Include the auto-generated portion of the assembly writer
|
||||||
#include "PowerPCGenAsmWriter.inc"
|
#include "PowerPCGenAsmWriter.inc"
|
||||||
|
|
||||||
/// 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.
|
/// toOctal - Convert the low order bits of X into an octal digit.
|
||||||
///
|
///
|
||||||
static inline char toOctal(int X) {
|
static inline char toOctal(int X) {
|
||||||
@ -128,13 +113,13 @@ static inline char toOctal(int X) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// getAsCString - Return the specified array as a C compatible
|
/// getAsCString - Return the specified array as a C compatible
|
||||||
/// string, only if the predicate isStringCompatible is true.
|
/// string, only if the predicate isString is true.
|
||||||
///
|
///
|
||||||
static void printAsCString(std::ostream &O, const ConstantArray *CVA) {
|
static void printAsCString(std::ostream &O, const ConstantArray *CVA) {
|
||||||
assert(isStringCompatible(CVA) && "Array is not string compatible!");
|
assert(CVA->isString() && "Array is not string compatible!");
|
||||||
|
|
||||||
O << "\"";
|
O << "\"";
|
||||||
for (unsigned i = 0; i < CVA->getNumOperands(); ++i) {
|
for (unsigned i = 0; i != CVA->getNumOperands(); ++i) {
|
||||||
unsigned char C = cast<ConstantInt>(CVA->getOperand(i))->getRawValue();
|
unsigned char C = cast<ConstantInt>(CVA->getOperand(i))->getRawValue();
|
||||||
|
|
||||||
if (C == '"') {
|
if (C == '"') {
|
||||||
@ -144,7 +129,7 @@ static void printAsCString(std::ostream &O, const ConstantArray *CVA) {
|
|||||||
} else if (isprint(C)) {
|
} else if (isprint(C)) {
|
||||||
O << C;
|
O << C;
|
||||||
} else {
|
} else {
|
||||||
switch (C) {
|
switch(C) {
|
||||||
case '\b': O << "\\b"; break;
|
case '\b': O << "\\b"; break;
|
||||||
case '\f': O << "\\f"; break;
|
case '\f': O << "\\f"; break;
|
||||||
case '\n': O << "\\n"; break;
|
case '\n': O << "\\n"; break;
|
||||||
|
@ -106,21 +106,6 @@ FunctionPass *llvm::createPPCAsmPrinter(std::ostream &o,TargetMachine &tm) {
|
|||||||
// Include the auto-generated portion of the assembly writer
|
// Include the auto-generated portion of the assembly writer
|
||||||
#include "PowerPCGenAsmWriter.inc"
|
#include "PowerPCGenAsmWriter.inc"
|
||||||
|
|
||||||
/// 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.
|
/// toOctal - Convert the low order bits of X into an octal digit.
|
||||||
///
|
///
|
||||||
static inline char toOctal(int X) {
|
static inline char toOctal(int X) {
|
||||||
@ -128,13 +113,13 @@ static inline char toOctal(int X) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// getAsCString - Return the specified array as a C compatible
|
/// getAsCString - Return the specified array as a C compatible
|
||||||
/// string, only if the predicate isStringCompatible is true.
|
/// string, only if the predicate isString is true.
|
||||||
///
|
///
|
||||||
static void printAsCString(std::ostream &O, const ConstantArray *CVA) {
|
static void printAsCString(std::ostream &O, const ConstantArray *CVA) {
|
||||||
assert(isStringCompatible(CVA) && "Array is not string compatible!");
|
assert(CVA->isString() && "Array is not string compatible!");
|
||||||
|
|
||||||
O << "\"";
|
O << "\"";
|
||||||
for (unsigned i = 0; i < CVA->getNumOperands(); ++i) {
|
for (unsigned i = 0; i != CVA->getNumOperands(); ++i) {
|
||||||
unsigned char C = cast<ConstantInt>(CVA->getOperand(i))->getRawValue();
|
unsigned char C = cast<ConstantInt>(CVA->getOperand(i))->getRawValue();
|
||||||
|
|
||||||
if (C == '"') {
|
if (C == '"') {
|
||||||
@ -144,7 +129,7 @@ static void printAsCString(std::ostream &O, const ConstantArray *CVA) {
|
|||||||
} else if (isprint(C)) {
|
} else if (isprint(C)) {
|
||||||
O << C;
|
O << C;
|
||||||
} else {
|
} else {
|
||||||
switch (C) {
|
switch(C) {
|
||||||
case '\b': O << "\\b"; break;
|
case '\b': O << "\\b"; break;
|
||||||
case '\f': O << "\\f"; break;
|
case '\f': O << "\\f"; break;
|
||||||
case '\n': O << "\\n"; break;
|
case '\n': O << "\\n"; break;
|
||||||
|
Reference in New Issue
Block a user