[llvm-commits] CVS: llvm-java/include/llvm/Java/ClassFile.h

Alkis Evlogimenos alkis at cs.uiuc.edu
Sun Aug 22 16:06:29 PDT 2004



Changes in directory llvm-java/include/llvm/Java:

ClassFile.h updated: 1.21 -> 1.22
---
Log message:

Add parent ConstantClass objects to Fields and Methods, referring to
the owning class of the corresponding field or method.


---
Diffs of the changes:  (+14 -6)

Index: llvm-java/include/llvm/Java/ClassFile.h
diff -u llvm-java/include/llvm/Java/ClassFile.h:1.21 llvm-java/include/llvm/Java/ClassFile.h:1.22
--- llvm-java/include/llvm/Java/ClassFile.h:1.21	Fri Aug  6 06:24:52 2004
+++ llvm-java/include/llvm/Java/ClassFile.h	Sun Aug 22 18:06:18 2004
@@ -271,16 +271,19 @@
 
   class Field {
   private:
+    ConstantClass* parent_;
     uint16_t accessFlags_;
     ConstantUtf8* name_;
     ConstantUtf8* descriptor_;
     Attributes attributes_;
 
-    Field(const ConstantPool& cp, std::istream& is);
+    Field(ConstantClass* parent, const ConstantPool& cp, std::istream& is);
 
   public:
-    static Field* readField(const ConstantPool& cp, std::istream& is) {
-      return new Field(cp, is);
+    static Field* readField(ConstantClass* parent,
+                            const ConstantPool& cp,
+                            std::istream& is) {
+      return new Field(parent, cp, is);
     }
 
     ~Field();
@@ -293,6 +296,7 @@
     bool isVolatile() const { return accessFlags_ & ACC_VOLATILE; }
     bool isTransient() const { return accessFlags_ & ACC_TRANSIENT; }
 
+    ConstantClass* getParent() const { return parent_; }
     ConstantUtf8* getName() const { return name_; }
     ConstantUtf8* getDescriptor() const { return descriptor_; }
     const Attributes& getAttributes() const { return attributes_; }
@@ -306,16 +310,19 @@
   }
 
   class Method {
+    ConstantClass* parent_;
     uint16_t accessFlags_;
     ConstantUtf8* name_;
     ConstantUtf8* descriptor_;
     Attributes attributes_;
 
-    Method(const ConstantPool& cp, std::istream& is);
+    Method(ConstantClass* parent, const ConstantPool& cp, std::istream& is);
 
   public:
-    static Method* readMethod(const ConstantPool& cp, std::istream& is) {
-      return new Method(cp, is);
+    static Method* readMethod(ConstantClass* parent,
+                              const ConstantPool& cp,
+                              std::istream& is) {
+      return new Method(parent, cp, is);
     }
 
     ~Method();
@@ -330,6 +337,7 @@
     bool isAbstract() const { return accessFlags_ & ACC_ABSTRACT; }
     bool isStrict() const { return accessFlags_ & ACC_STRICT; }
 
+    ConstantClass* getParent() const { return parent_; }
     ConstantUtf8* getName() const { return name_; }
     ConstantUtf8* getDescriptor() const { return descriptor_; }
     const Attributes& getAttributes() const { return attributes_; }






More information about the llvm-commits mailing list