[llvm-commits] CVS: llvm-java/lib/Compiler/VMClass.h VMClass.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Mon Mar 28 16:41:33 PST 2005
Changes in directory llvm-java/lib/Compiler:
VMClass.h updated: 1.15 -> 1.16
VMClass.cpp updated: 1.17 -> 1.18
---
Log message:
Rename member field and cleanup class a bit.
---
Diffs of the changes: (+13 -13)
VMClass.cpp | 18 +++++++++---------
VMClass.h | 8 ++++----
2 files changed, 13 insertions(+), 13 deletions(-)
Index: llvm-java/lib/Compiler/VMClass.h
diff -u llvm-java/lib/Compiler/VMClass.h:1.15 llvm-java/lib/Compiler/VMClass.h:1.16
--- llvm-java/lib/Compiler/VMClass.h:1.15 Mon Mar 28 17:39:50 2005
+++ llvm-java/lib/Compiler/VMClass.h Mon Mar 28 18:41:22 2005
@@ -34,7 +34,7 @@
Resolver* resolver_;
const ClassFile* classFile_;
const VMClass* componentClass_;
- Type* structType_;
+ Type* layoutType_;
const Type* type_;
unsigned interfaceIndex_;
typedef std::map<std::string, int> Field2IndexMap;
@@ -70,7 +70,7 @@
public:
const std::string& getName() const { return name_; }
- const Type* getLayoutType() const { return structType_; }
+ const Type* getLayoutType() const { return layoutType_; }
const Type* getType() const { return type_; }
const ClassFile* getClassFile() const { return classFile_; }
unsigned getNumSuperClasses() const { return superClasses_.size(); }
@@ -81,8 +81,8 @@
unsigned getNumInterfaces() const { return interfaces_.size(); }
const VMClass* getInterface(unsigned i) const { return interfaces_[i]; }
const VMClass* getComponentClass() const { return componentClass_; }
- bool isArray() const { return componentClass_; }
- bool isPrimitive() const { return !structType_; }
+ bool isArray() const { return getComponentClass(); }
+ bool isPrimitive() const { return getType() == getLayoutType(); }
bool isInterface() const { return classFile_ && !getSuperClass(); }
unsigned getInterfaceIndex() const { return interfaceIndex_; }
int getFieldIndex(const std::string& name) const;
Index: llvm-java/lib/Compiler/VMClass.cpp
diff -u llvm-java/lib/Compiler/VMClass.cpp:1.17 llvm-java/lib/Compiler/VMClass.cpp:1.18
--- llvm-java/lib/Compiler/VMClass.cpp:1.17 Mon Mar 28 17:56:46 2005
+++ llvm-java/lib/Compiler/VMClass.cpp Mon Mar 28 18:41:22 2005
@@ -31,8 +31,8 @@
resolver_(resolver),
classFile_(ClassFile::get(className)),
componentClass_(NULL),
- structType_(OpaqueType::get()),
- type_(PointerType::get(structType_)),
+ layoutType_(OpaqueType::get()),
+ type_(PointerType::get(layoutType_)),
interfaceIndex_(INVALID_INTERFACE_INDEX),
resolvedConstantPool_(classFile_->getNumConstants())
{
@@ -44,8 +44,8 @@
resolver_(resolver),
classFile_(NULL),
componentClass_(componentClass),
- structType_(OpaqueType::get()),
- type_(PointerType::get(structType_)),
+ layoutType_(OpaqueType::get()),
+ type_(PointerType::get(layoutType_)),
interfaceIndex_(INVALID_INTERFACE_INDEX)
{
@@ -63,7 +63,7 @@
resolver_(resolver),
classFile_(NULL),
componentClass_(NULL),
- structType_(NULL),
+ layoutType_(const_cast<Type*>(type)),
type_(type),
interfaceIndex_(INVALID_INTERFACE_INDEX)
{
@@ -82,11 +82,11 @@
}
void VMClass::resolveType() {
- PATypeHolder holder = structType_;
+ PATypeHolder holder = layoutType_;
Type* resolvedType = StructType::get(elementTypes_);
- cast<OpaqueType>(structType_)->refineAbstractTypeTo(resolvedType);
- structType_ = holder.get();
- type_ = PointerType::get(structType_);
+ cast<OpaqueType>(layoutType_)->refineAbstractTypeTo(resolvedType);
+ layoutType_ = holder.get();
+ type_ = PointerType::get(layoutType_);
}
void VMClass::link()
More information about the llvm-commits
mailing list