[llvm-commits] CVS: llvm-java/lib/Compiler/VMClass.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Mon Mar 28 16:47:21 PST 2005



Changes in directory llvm-java/lib/Compiler:

VMClass.cpp updated: 1.18 -> 1.19
---
Log message:

Move implemented interface computation to happen for all classes.


---
Diffs of the changes:  (+16 -16)

 VMClass.cpp |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)


Index: llvm-java/lib/Compiler/VMClass.cpp
diff -u llvm-java/lib/Compiler/VMClass.cpp:1.18 llvm-java/lib/Compiler/VMClass.cpp:1.19
--- llvm-java/lib/Compiler/VMClass.cpp:1.18	Mon Mar 28 18:41:22 2005
+++ llvm-java/lib/Compiler/VMClass.cpp	Mon Mar 28 18:47:10 2005
@@ -120,21 +120,6 @@
       for (unsigned i = 0, e = superClass->getNumInterfaces(); i != e; ++i)
         interfaces_.push_back(superClass->getInterface(i));
 
-      // For each of the interfaces we implement, load it and add that
-      // interface and all the interfaces it inherits from.
-      for (unsigned i = 0, e = classFile_->getNumInterfaces(); i != e; ++i) {
-        const VMClass* interface =
-          getClassForClass(classFile_->getInterfaceIndex(i));
-        interfaces_.push_back(interface);
-        for (unsigned j = 0, f = interface->getNumInterfaces(); j != f; ++j)
-          interfaces_.push_back(interface->getInterface(j));
-      }
-
-      // Sort the interfaces array and remove duplicates.
-      std::sort(interfaces_.begin(), interfaces_.end());
-      interfaces_.erase(std::unique(interfaces_.begin(), interfaces_.end()),
-                        interfaces_.end());
-
       // We first add the struct of the super class.
       addField("super", superClass->getLayoutType());
 
@@ -156,7 +141,22 @@
       }
     }
 
-    // Then we add the rest of the fields.
+    // For each of the interfaces we implement, load it and add that
+    // interface and all the interfaces it inherits from.
+    for (unsigned i = 0, e = classFile_->getNumInterfaces(); i != e; ++i) {
+      const VMClass* interface =
+        getClassForClass(classFile_->getInterfaceIndex(i));
+      interfaces_.push_back(interface);
+      for (unsigned j = 0, f = interface->getNumInterfaces(); j != f; ++j)
+        interfaces_.push_back(interface->getInterface(j));
+    }
+
+    // Sort the interfaces array and remove duplicates.
+    std::sort(interfaces_.begin(), interfaces_.end());
+    interfaces_.erase(std::unique(interfaces_.begin(), interfaces_.end()),
+                      interfaces_.end());
+
+    // Now add the rest of the fields.
     const Fields& fields = classFile_->getFields();
     for (unsigned i = 0, e = fields.size(); i != e; ++i) {
       Field* field = fields[i];






More information about the llvm-commits mailing list