[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Thu Jan 27 12:04:52 PST 2005
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.203 -> 1.204
---
Log message:
Make field access a bit more readable.
---
Diffs of the changes: (+4 -2)
Compiler.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.203 llvm-java/lib/Compiler/Compiler.cpp:1.204
--- llvm-java/lib/Compiler/Compiler.cpp:1.203 Thu Jan 27 14:03:41 2005
+++ llvm-java/lib/Compiler/Compiler.cpp Thu Jan 27 14:04:42 2005
@@ -1231,7 +1231,7 @@
}
}
- return new GetElementPtrInst(ptr, indices, fieldName, currentBB_);
+ return new GetElementPtrInst(ptr, indices, fieldName + '*', currentBB_);
}
std::string getMangledString(const std::string& str) {
@@ -1938,8 +1938,10 @@
}
void do_getfield(unsigned index) {
+ ConstantFieldRef* fieldRef = cf_->getConstantFieldRef(index);
+ const std::string& name = fieldRef->getNameAndType()->getName()->str();
Value* p = pop(ObjectBaseRefTy);
- Value* v = new LoadInst(getField(index, p), TMP, currentBB_);
+ Value* v = new LoadInst(getField(index, p), name, currentBB_);
push(v);
}
More information about the llvm-commits
mailing list