From 54799c2a516520c3f669c46439f8f6b250ac0274 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Sun, 14 Nov 2004 03:22:05 +0000 Subject: [PATCH] Support UndefValue emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17721 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/SparcAsmPrinter.cpp | 6 +++++- lib/Target/SparcV8/SparcV8AsmPrinter.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp index 56ec97a0882..36137b1a1c1 100644 --- a/lib/Target/Sparc/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/SparcAsmPrinter.cpp @@ -131,7 +131,7 @@ static void printAsCString(std::ostream &O, const ConstantArray *CVA) { // Print out the specified constant, without a storage class. Only the // constants valid in constant expressions can occur here. void V8Printer::emitConstantValueOnly(const Constant *CV) { - if (CV->isNullValue()) + if (CV->isNullValue() || isa (CV)) O << "0"; else if (const ConstantBool *CB = dyn_cast(CV)) { assert(CB == ConstantBool::True); @@ -266,6 +266,10 @@ void V8Printer::emitGlobalConstant(const Constant *CV) { return; } } + } else if (isa (CV)) { + unsigned size = TD.getTypeSize (CV->getType ()); + O << "\t.skip\t " << size << "\n"; + return; } const Type *type = CV->getType(); diff --git a/lib/Target/SparcV8/SparcV8AsmPrinter.cpp b/lib/Target/SparcV8/SparcV8AsmPrinter.cpp index 56ec97a0882..36137b1a1c1 100644 --- a/lib/Target/SparcV8/SparcV8AsmPrinter.cpp +++ b/lib/Target/SparcV8/SparcV8AsmPrinter.cpp @@ -131,7 +131,7 @@ static void printAsCString(std::ostream &O, const ConstantArray *CVA) { // Print out the specified constant, without a storage class. Only the // constants valid in constant expressions can occur here. void V8Printer::emitConstantValueOnly(const Constant *CV) { - if (CV->isNullValue()) + if (CV->isNullValue() || isa (CV)) O << "0"; else if (const ConstantBool *CB = dyn_cast(CV)) { assert(CB == ConstantBool::True); @@ -266,6 +266,10 @@ void V8Printer::emitGlobalConstant(const Constant *CV) { return; } } + } else if (isa (CV)) { + unsigned size = TD.getTypeSize (CV->getType ()); + O << "\t.skip\t " << size << "\n"; + return; } const Type *type = CV->getType();