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

Alkis Evlogimenos alkis at cs.uiuc.edu
Tue Apr 19 00:11:18 PDT 2005



Changes in directory llvm-java/lib/Compiler:

VMClass.h updated: 1.33 -> 1.34
VMClass.cpp updated: 1.43 -> 1.44
---
Log message:

Populate the staticMethods_ vector.


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

 VMClass.cpp |    9 ++++++---
 VMClass.h   |    6 ++++++
 2 files changed, 12 insertions(+), 3 deletions(-)


Index: llvm-java/lib/Compiler/VMClass.h
diff -u llvm-java/lib/Compiler/VMClass.h:1.33 llvm-java/lib/Compiler/VMClass.h:1.34
--- llvm-java/lib/Compiler/VMClass.h:1.33	Tue Apr 19 02:03:27 2005
+++ llvm-java/lib/Compiler/VMClass.h	Tue Apr 19 02:11:07 2005
@@ -116,6 +116,12 @@
     const VMMethod* getDynamicMethod(unsigned i) const {
       return dynamicMethods_[i];
     }
+    unsigned getNumStaticMethods() const {
+      return staticMethods_.size();
+    }
+    const VMMethod* getStaticMethod(unsigned i) const {
+      return staticMethods_[i];
+    }
     llvm::Constant* getClassRecord() const { return classRecord_; }
 
     llvm::Constant* getConstant(unsigned index) const;


Index: llvm-java/lib/Compiler/VMClass.cpp
diff -u llvm-java/lib/Compiler/VMClass.cpp:1.43 llvm-java/lib/Compiler/VMClass.cpp:1.44
--- llvm-java/lib/Compiler/VMClass.cpp:1.43	Tue Apr 19 02:03:27 2005
+++ llvm-java/lib/Compiler/VMClass.cpp	Tue Apr 19 02:11:07 2005
@@ -444,9 +444,12 @@
         const std::string& descriptor = method->getDescriptor()->str();
 
         // If method is statically bound just create it.
-        if (method->isPrivate() || method->isStatic() || name[0] == '<')
-          methodMap_.insert(
-            std::make_pair(name + descriptor, VMMethod(this, method)));
+        if (method->isPrivate() || method->isStatic() || name[0] == '<') {
+          MethodMap::iterator i =
+            methodMap_.insert(
+              std::make_pair(name + descriptor, VMMethod(this, method)));
+          staticMethods_.push_back(&i->second);
+        }
         // Otherwise we need to assign an index for it and update the
         // dynamicMethods_ vector.
         else {






More information about the llvm-commits mailing list