diff options
author | Chris Lattner <sabre@nondot.org> | 2012-02-06 21:56:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-02-06 21:56:39 +0000 |
commit | 8213c8af290f42bcdac070f0131d2fdabe76c93f (patch) | |
tree | 8a1b8f513d5ddf66f08efbc5c1c8bc33f87e4d1a /llvm/lib/Target/TargetLoweringObjectFile.cpp | |
parent | b03c224e103b2986004d10cc76eaaae35eb702de (diff) | |
download | llvm-8213c8af290f42bcdac070f0131d2fdabe76c93f.zip llvm-8213c8af290f42bcdac070f0131d2fdabe76c93f.tar.gz llvm-8213c8af290f42bcdac070f0131d2fdabe76c93f.tar.bz2 |
Remove some dead code and tidy things up now that vectors use ConstantDataVector
instead of always using ConstantVector.
llvm-svn: 149912
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index ec3b194..1589604 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -77,23 +77,6 @@ static bool isSuitableForBSS(const GlobalVariable *GV, bool NoZerosInBSS) { /// than ConstantDataSequential::isString because we allow 2 & 4 byte strings. static bool IsNullTerminatedString(const Constant *C) { // First check: is we have constant array terminated with zero - if (const ConstantArray *CVA = dyn_cast<ConstantArray>(C)) { - ArrayType *ATy = cast<ArrayType>(C->getType()); - if (ATy->getNumElements() == 0) return false; - - ConstantInt *Null = - dyn_cast<ConstantInt>(CVA->getOperand(ATy->getNumElements()-1)); - if (Null == 0 || !Null->isZero()) - return false; // Not null terminated. - - // Verify that the null doesn't occur anywhere else in the string. - for (unsigned i = 0, e = ATy->getNumElements()-1; i != e; ++i) - // Reject constantexpr elements etc. - if (!isa<ConstantInt>(CVA->getOperand(i)) || - CVA->getOperand(i) == Null) - return false; - return true; - } if (const ConstantDataSequential *CDS = dyn_cast<ConstantDataSequential>(C)) { unsigned NumElts = CDS->getNumElements(); assert(NumElts != 0 && "Can't have an empty CDS"); |