Get rid of the Pass+Context magic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-07-22 00:24:57 +00:00
parent 7cf12c7efd
commit e922c02019
120 changed files with 835 additions and 786 deletions

View File

@@ -1238,7 +1238,7 @@ void CWriter::printConstant(Constant *CPV, bool Static) {
Out << '{';
if (AT->getNumElements()) {
Out << ' ';
Constant *CZ = Context->getNullValue(AT->getElementType());
Constant *CZ = CPV->getContext().getNullValue(AT->getElementType());
printConstant(CZ, Static);
for (unsigned i = 1, e = AT->getNumElements(); i != e; ++i) {
Out << ", ";
@@ -1263,7 +1263,7 @@ void CWriter::printConstant(Constant *CPV, bool Static) {
assert(isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV));
const VectorType *VT = cast<VectorType>(CPV->getType());
Out << "{ ";
Constant *CZ = Context->getNullValue(VT->getElementType());
Constant *CZ = CPV->getContext().getNullValue(VT->getElementType());
printConstant(CZ, Static);
for (unsigned i = 1, e = VT->getNumElements(); i != e; ++i) {
Out << ", ";
@@ -1285,10 +1285,12 @@ void CWriter::printConstant(Constant *CPV, bool Static) {
Out << '{';
if (ST->getNumElements()) {
Out << ' ';
printConstant(Context->getNullValue(ST->getElementType(0)), Static);
printConstant(
CPV->getContext().getNullValue(ST->getElementType(0)), Static);
for (unsigned i = 1, e = ST->getNumElements(); i != e; ++i) {
Out << ", ";
printConstant(Context->getNullValue(ST->getElementType(i)), Static);
printConstant(
CPV->getContext().getNullValue(ST->getElementType(i)), Static);
}
}
Out << " }";
@@ -3498,7 +3500,7 @@ void CWriter::visitStoreInst(StoreInst &I) {
if (!ITy->isPowerOf2ByteWidth())
// We have a bit width that doesn't match an even power-of-2 byte
// size. Consequently we must & the value with the type's bit mask
BitMask = Context->getConstantInt(ITy, ITy->getBitMask());
BitMask = I.getContext().getConstantInt(ITy, ITy->getBitMask());
if (BitMask)
Out << "((";
writeOperand(Operand);