summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.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
commit8ea967d0502a685a489bc34787044da8d91ac152 (patch)
tree9dec688eeaf183b976af02027e281452ad6937b3 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent841d7a24346b658231f7619c0799cc9666985b74 (diff)
downloadbcm5719-llvm-8ea967d0502a685a489bc34787044da8d91ac152.tar.gz
bcm5719-llvm-8ea967d0502a685a489bc34787044da8d91ac152.zip
with recent changes, ConstantArray is never a "string". Remove the associated
methods and constant fold the clients to false. llvm-svn: 149362
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index d58f7cf73df..50c990a6702 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -845,32 +845,6 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
} else {
assert (0 && "Unknown FP type!");
}
- } else if (isa<ConstantArray>(C) && cast<ConstantArray>(C)->isString()) {
- const ConstantArray *CA = cast<ConstantArray>(C);
- // Emit constant strings specially.
- unsigned NumOps = CA->getNumOperands();
- // If this is a null-terminated string, use the denser CSTRING encoding.
- if (CA->getOperand(NumOps-1)->isNullValue()) {
- Code = bitc::CST_CODE_CSTRING;
- --NumOps; // Don't encode the null, which isn't allowed by char6.
- } else {
- Code = bitc::CST_CODE_STRING;
- AbbrevToUse = String8Abbrev;
- }
- bool isCStr7 = Code == bitc::CST_CODE_CSTRING;
- bool isCStrChar6 = Code == bitc::CST_CODE_CSTRING;
- for (unsigned i = 0; i != NumOps; ++i) {
- unsigned char V = cast<ConstantInt>(CA->getOperand(i))->getZExtValue();
- Record.push_back(V);
- isCStr7 &= (V & 128) == 0;
- if (isCStrChar6)
- isCStrChar6 = BitCodeAbbrevOp::isChar6(V);
- }
-
- if (isCStrChar6)
- AbbrevToUse = CString6Abbrev;
- else if (isCStr7)
- AbbrevToUse = CString7Abbrev;
} else if (isa<ConstantDataSequential>(C) &&
cast<ConstantDataSequential>(C)->isString()) {
const ConstantDataSequential *Str = cast<ConstantDataSequential>(C);
OpenPOWER on IntegriCloud