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

Alkis Evlogimenos alkis at cs.uiuc.edu
Sat Mar 26 11:14:14 PST 2005



Changes in directory llvm-java/lib/Compiler:

Compiler.cpp updated: 1.253 -> 1.254
---
Log message:

Expose ConstantClass indices.


---
Diffs of the changes:  (+10 -12)

 Compiler.cpp |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)


Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.253 llvm-java/lib/Compiler/Compiler.cpp:1.254
--- llvm-java/lib/Compiler/Compiler.cpp:1.253	Sat Mar 26 11:15:47 2005
+++ llvm-java/lib/Compiler/Compiler.cpp	Sat Mar 26 13:14:02 2005
@@ -456,10 +456,10 @@
       // Add this interface's vtable if it was not added before.
       if (vtables[index] == nullVTable) {
         vtables[index] = buildInterfaceVTable(cf, interfaceCf);
-        const Classes& interfaces = interfaceCf->getInterfaces();
-        for (unsigned i = 0, e = interfaces.size(); i != e; ++i) {
+        unsigned numInterface = interfaceCf->getNumInterfaces();
+        for (unsigned i = 0, e = interfaceCf->getNumInterfaces(); i != e; ++i) {
           const ClassFile* superInterface =
-            ClassFile::get(interfaces[i]->getName()->str());
+            ClassFile::get(interfaceCf->getInterface(i)->getName()->str());
           insertVtablesForInterface(vtables, cf, superInterface);
         }
       }
@@ -492,10 +492,9 @@
 
       const ClassFile* curCf = cf;
       while (true) {
-        const Classes& interfaces = curCf->getInterfaces();
-        for (unsigned i = 0, e = interfaces.size(); i != e; ++i) {
+        for (unsigned i = 0, e = curCf->getNumInterfaces(); i != e; ++i) {
           const ClassFile* ifaceCf =
-            ClassFile::get(interfaces[i]->getName()->str());
+            ClassFile::get(curCf->getInterface(i)->getName()->str());
           insertVtablesForInterface(vtables, cf, ifaceCf);
         }
         if (!curCf->getSuperClass())
@@ -587,10 +586,9 @@
       // If this is an interface, add all methods from each interface
       // this inherits from.
       if (cf->isInterface()) {
-        const Classes& ifaces = cf->getInterfaces();
-        for (unsigned i = 0, e = ifaces.size(); i != e; ++i) {
+        for (unsigned i = 0, e = cf->getNumInterfaces(); i != e; ++i) {
           const ClassFile* ifaceCF =
-            ClassFile::get(ifaces[i]->getName()->str());
+            ClassFile::get(cf->getInterface(i)->getName()->str());
           const VTableInfo& ifaceVI = getVTableInfo(ifaceCF);
           ConstantStruct* ifaceInit =
             cast<ConstantStruct>(ifaceVI.vtable->getInitializer());
@@ -1016,9 +1014,9 @@
       if (global)
         return global;
 
-      const Classes& ifaces = cf->getInterfaces();
-      for (unsigned i = 0, e = ifaces.size(); i != e; ++i) {
-        const ClassFile* ifaceCF = ClassFile::get(ifaces[i]->getName()->str());
+      for (unsigned i = 0, e = cf->getNumInterfaces(); i != e; ++i) {
+        const ClassFile* ifaceCF =
+          ClassFile::get(cf->getInterface(i)->getName()->str());
         if (global = getStaticField(ifaceCF, name, type))
           return global;
       }






More information about the llvm-commits mailing list