diff options
| author | Nick Hildenbrandt <hldnbrnd@uiuc.edu> | 2002-10-02 18:32:35 +0000 |
|---|---|---|
| committer | Nick Hildenbrandt <hldnbrnd@uiuc.edu> | 2002-10-02 18:32:35 +0000 |
| commit | e07698b492c00e1c3ed72b738df096c5a0bf74d2 (patch) | |
| tree | 60b98ab11adeca7e891c875814c0d1005afba360 /llvm/lib/CWriter/Writer.cpp | |
| parent | e0ba1f25b6d0c96a7a826ff72623227367939695 (diff) | |
| download | bcm5719-llvm-e07698b492c00e1c3ed72b738df096c5a0bf74d2.tar.gz bcm5719-llvm-e07698b492c00e1c3ed72b738df096c5a0bf74d2.zip | |
Cleaned up my last check-in.
llvm-svn: 4014
Diffstat (limited to 'llvm/lib/CWriter/Writer.cpp')
| -rw-r--r-- | llvm/lib/CWriter/Writer.cpp | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index 4278f82fff9..96bf16275bb 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -1018,73 +1018,13 @@ void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I, } } - - - - -/* -void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I, - User::op_iterator E) { - bool HasImplicitAddress = false; - // If accessing a global value with no indexing, avoid *(&GV) syndrome - if (GlobalValue *V = dyn_cast<GlobalValue>(Ptr)) { - HasImplicitAddress = true; - } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(Ptr)) { - HasImplicitAddress = true; - Ptr = CPR->getValue(); // Get to the global... - } - - if (I == E) { - if (!HasImplicitAddress) - Out << "*"; // Implicit zero first argument: '*x' is equivalent to 'x[0]' - - writeOperandInternal(Ptr); - return; - } - - const Constant *CI = dyn_cast<Constant>(I->get()); - if (HasImplicitAddress && (!CI || !CI->isNullValue())) - Out << "(&"; - - writeOperandInternal(Ptr); - - if (HasImplicitAddress && (!CI || !CI->isNullValue())) { - Out << ")"; - HasImplicitAddress = false; // HIA is only true if we haven't addressed yet - } - - assert(!HasImplicitAddress || (CI && CI->isNullValue()) && - "Can only have implicit address with direct accessing"); - - if (HasImplicitAddress) { - ++I; - } else if (CI && CI->isNullValue() && I+1 != E) { - // Print out the -> operator if possible... - if ((*(I+1))->getType() == Type::UByteTy) { - Out << (HasImplicitAddress ? "." : "->"); - Out << "field" << cast<ConstantUInt>(*(I+1))->getValue(); - I += 2; - } - } - - for (; I != E; ++I) - if ((*I)->getType() == Type::LongTy) { - Out << "["; - writeOperand(*I); - Out << "]"; - } else { - Out << ".field" << cast<ConstantUInt>(*I)->getValue(); - } -} -*/ - void CWriter::visitLoadInst(LoadInst &I) { //Out << "*"; writeOperand(I.getOperand(0)); } void CWriter::visitStoreInst(StoreInst &I) { - //Out << "*"; + Out << "*"; writeOperand(I.getPointerOperand()); Out << " = "; writeOperand(I.getOperand(0)); |

