aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-01-31 06:05:00 +0000
committerChris Lattner <sabre@nondot.org>2012-01-31 06:05:00 +0000
commit1b2f643753a2974540934ac0f1e3ffd182b0571c (patch)
treec7f571a94ad375ba815a3ee6291123e9f3c00c59 /lib/VMCore/AsmWriter.cpp
parentca012b8b2341a987f0022adc42424ac8ed26752a (diff)
with recent changes, ConstantArray is never a "string". Remove the associated
methods and constant fold the clients to false. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r--lib/VMCore/AsmWriter.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index eb0f66196d..1dd1254f65 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -827,30 +827,21 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
}
if (const ConstantArray *CA = dyn_cast<ConstantArray>(CV)) {
- // As a special case, print the array as a string if it is an array of
- // i8 with ConstantInt values.
- //
Type *ETy = CA->getType()->getElementType();
- if (CA->isString()) {
- Out << "c\"";
- PrintEscapedString(CA->getAsString(), Out);
- Out << '"';
- } else { // Cannot output in string format...
- Out << '[';
+ Out << '[';
+ TypePrinter.print(ETy, Out);
+ Out << ' ';
+ WriteAsOperandInternal(Out, CA->getOperand(0),
+ &TypePrinter, Machine,
+ Context);
+ for (unsigned i = 1, e = CA->getNumOperands(); i != e; ++i) {
+ Out << ", ";
TypePrinter.print(ETy, Out);
Out << ' ';
- WriteAsOperandInternal(Out, CA->getOperand(0),
- &TypePrinter, Machine,
+ WriteAsOperandInternal(Out, CA->getOperand(i), &TypePrinter, Machine,
Context);
- for (unsigned i = 1, e = CA->getNumOperands(); i != e; ++i) {
- Out << ", ";
- TypePrinter.print(ETy, Out);
- Out << ' ';
- WriteAsOperandInternal(Out, CA->getOperand(i), &TypePrinter, Machine,
- Context);
- }
- Out << ']';
}
+ Out << ']';
return;
}