diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-13 21:27:19 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-13 21:27:19 +0000 |
commit | 8d9397a582f963064c5a044543887336898e8ef8 (patch) | |
tree | 2b9e595e121059ef1a578089d6451f3b3b72589d /lib/VMCore | |
parent | 714dd9b716dfb8625bd7f2ecb18c6c9660374b9e (diff) | |
download | external_llvm-8d9397a582f963064c5a044543887336898e8ef8.zip external_llvm-8d9397a582f963064c5a044543887336898e8ef8.tar.gz external_llvm-8d9397a582f963064c5a044543887336898e8ef8.tar.bz2 |
As Chris pointed out, this doesn't actually need an LLVMContext to operate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Constants.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index a1b4c93..184ae9d 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -1416,19 +1416,19 @@ bool ConstantArray::isString() const { /// isCString - This method returns true if the array is a string (see /// isString) and it ends in a null byte \\0 and does not contains any other /// null bytes except its terminator. -bool ConstantArray::isCString(LLVMContext &Context) const { +bool ConstantArray::isCString() const { // Check the element type for i8... if (getType()->getElementType() != Type::Int8Ty) return false; - Constant *Zero = Context.getNullValue(getOperand(0)->getType()); + // Last element must be a null. - if (getOperand(getNumOperands()-1) != Zero) + if (!getOperand(getNumOperands()-1)->isNullValue()) return false; // Other elements must be non-null integers. for (unsigned i = 0, e = getNumOperands()-1; i != e; ++i) { if (!isa<ConstantInt>(getOperand(i))) return false; - if (getOperand(i) == Zero) + if (getOperand(i)->isNullValue()) return false; } return true; |