diff options
author | Chris Lattner <sabre@nondot.org> | 2002-08-22 22:48:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-08-22 22:48:55 +0000 |
commit | 030effa42ca55f9bc37e542b8e06e8abf4ea730c (patch) | |
tree | 0ad6b7464b94d1b821b8efa36f912f7e1f5dfb02 /llvm | |
parent | 62b42ce7640353d4f1d71a656bfd92ad37da1e05 (diff) | |
download | bcm5719-llvm-030effa42ca55f9bc37e542b8e06e8abf4ea730c.tar.gz bcm5719-llvm-030effa42ca55f9bc37e542b8e06e8abf4ea730c.zip |
Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore
llvm-svn: 3484
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/AsmParser/llvmAsmParser.y | 4 | ||||
-rw-r--r-- | llvm/lib/CWriter/Writer.cpp | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y index 7edbfbcefaf..d40a8706d44 100644 --- a/llvm/lib/AsmParser/llvmAsmParser.y +++ b/llvm/lib/AsmParser/llvmAsmParser.y @@ -1638,7 +1638,7 @@ MemoryInst : MALLOC Types { if (!isa<PointerType>($2->get())) ThrowException("Can't load from nonpointer type: " + (*$2)->getDescription()); - if (LoadInst::getIndexedType(*$2, *$4) == 0) + if (GetElementPtrInst::getIndexedType(*$2, *$4) == 0) ThrowException("Invalid indices for load instruction!"); Value *Src = getVal(*$2, $3); @@ -1661,7 +1661,7 @@ MemoryInst : MALLOC Types { if (!isa<PointerType>($4->get())) ThrowException("Can't store to a nonpointer type: " + (*$4)->getDescription()); - const Type *ElTy = StoreInst::getIndexedType(*$4, *$6); + const Type *ElTy = GetElementPtrInst::getIndexedType(*$4, *$6); if (ElTy == 0) ThrowException("Can't store into that field list!"); if (ElTy != $2->getType()) diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index 910fde6a8bb..eece0c9cedc 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -847,10 +847,8 @@ void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I, } else { // Performing array indexing. Just skip the 0 ++I; } - } else if (HasImplicitAddress) { - } - + for (; I != E; ++I) if ((*I)->getType() == Type::UIntTy) { Out << "["; @@ -862,11 +860,13 @@ void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I, } void CWriter::visitLoadInst(LoadInst &I) { - printIndexingExpression(I.getPointerOperand(), I.idx_begin(), I.idx_end()); + Out << "*"; + writeOperand(I.getOperand(0)); } void CWriter::visitStoreInst(StoreInst &I) { - printIndexingExpression(I.getPointerOperand(), I.idx_begin(), I.idx_end()); + Out << "*"; + writeOperand(I.getPointerOperand()); Out << " = "; writeOperand(I.getOperand(0)); } |