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

Alkis Evlogimenos alkis at cs.uiuc.edu
Wed Jul 14 02:22:03 PDT 2004



Changes in directory llvm-java/lib/ClassFile:

ClassFile.cpp updated: 1.16 -> 1.17

---
Log message:

Remove duplicate functionality.


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

Index: llvm-java/lib/ClassFile/ClassFile.cpp
diff -u llvm-java/lib/ClassFile/ClassFile.cpp:1.16 llvm-java/lib/ClassFile/ClassFile.cpp:1.17
--- llvm-java/lib/ClassFile/ClassFile.cpp:1.16	Wed Jul 14 04:15:01 2004
+++ llvm-java/lib/ClassFile/ClassFile.cpp	Wed Jul 14 04:21:53 2004
@@ -137,14 +137,6 @@
         return os;
     }
 
-    const Attribute* getAttribute(const Attributes& attributes,
-                                  const std::string& name) {
-        for (unsigned i = 0, e = attributes.size(); i != e; ++i)
-            if (attributes[i]->getName()->str() == name)
-                return attributes[i];
-
-        return NULL;
-    }
 }
 
 //===----------------------------------------------------------------------===//
@@ -278,22 +270,13 @@
 const Attribute* llvm::Java::getAttribute(const Attributes& attrs,
                                           const std::string& name)
 {
-    for (Attributes::const_iterator
-             i = attrs.begin(), e = attrs.end(); i != e; ++i) {
-        const Attribute* attr = *i;
-        if (attr->getName()->str() == name)
-            return attr;
-    }
+    for (unsigned i = 0, e = attrs.size(); i != e; ++i)
+        if (attrs[i]->getName()->str() == name)
+            return attrs[i];
 
     return NULL;
 }
 
-const CodeAttribute* llvm::Java::getCodeAttribute(const Attributes& attrs)
-{
-    return static_cast<const CodeAttribute*>(
-        getAttribute(attrs, Attribute::CODE));
-}
-
 //===----------------------------------------------------------------------===//
 // ClassFileParseError implementation
 ClassFileParseError::~ClassFileParseError() throw()





More information about the llvm-commits mailing list