Don't initialize CV in terms of itself! Spotted by GCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149833 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2012-02-05 14:16:09 +00:00
parent 408a25c583
commit 853066a32a

View File

@ -721,14 +721,14 @@ void CppWriter::printConstant(const Constant *CV) {
}
Out << "Constant* " << constName << " = ConstantStruct::get("
<< typeName << ", " << constName << "_fields);";
} else if (const ConstantVector *CV = dyn_cast<ConstantVector>(CV)) {
} else if (const ConstantVector *CVec = dyn_cast<ConstantVector>(CV)) {
Out << "std::vector<Constant*> " << constName << "_elems;";
nl(Out);
unsigned N = CV->getNumOperands();
unsigned N = CVec->getNumOperands();
for (unsigned i = 0; i < N; ++i) {
printConstant(CV->getOperand(i));
printConstant(CVec->getOperand(i));
Out << constName << "_elems.push_back("
<< getCppName(CV->getOperand(i)) << ");";
<< getCppName(CVec->getOperand(i)) << ");";
nl(Out);
}
Out << "Constant* " << constName << " = ConstantVector::get("