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

Alkis Evlogimenos alkis at cs.uiuc.edu
Thu May 20 17:22:03 PDT 2004


Changes in directory llvm-java/lib/ClassFile:

ClassFile.cpp updated: 1.4 -> 1.5

---
Log message:

Remove implicit conversions for ConstantUtf8.
Add attribute strings for known attributes.


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

Index: llvm-java/lib/ClassFile/ClassFile.cpp
diff -u llvm-java/lib/ClassFile/ClassFile.cpp:1.4 llvm-java/lib/ClassFile/ClassFile.cpp:1.5
--- llvm-java/lib/ClassFile/ClassFile.cpp:1.4	Thu May 20 16:19:06 2004
+++ llvm-java/lib/ClassFile/ClassFile.cpp	Thu May 20 17:20:15 2004
@@ -439,6 +439,16 @@
 
 //===----------------------------------------------------------------------===//
 // Attribute implementation
+const std::string Attribute::CONSTANT_VALUE = "ConstantValue";
+const std::string Attribute::CODE = "Code";
+const std::string Attribute::EXCEPTIONS = "Exceptions";
+const std::string Attribute::INNER_CLASSES = "InnerClasses";
+const std::string Attribute::SYNTHETIC = "Synthetic";
+const std::string Attribute::SOURCE_FILE = "SourceFile";
+const std::string Attribute::LINE_NUMBER_TABLE = "LineNumberTable";
+const std::string Attribute::LOCAL_VARIABLE_TABLE = "LocalVariableTable";
+const std::string Attribute::DEPRECATED = "Deprecated";
+
 Attribute* Attribute::readAttribute(const ConstantPool& cp, std::istream& is)
 {
     ConstantUtf8* name = dynamic_cast<ConstantUtf8*>(cp[readU2(is)]);
@@ -446,9 +456,9 @@
         throw ClassFileSemanticError(
             "Representation of attribute name is not of type ConstantUtf8");
 
-    if (strcmp(*name, "ConstantValue") == 0)
+    if (CONSTANT_VALUE == name->str())
         return new AttributeConstantValue(name, cp, is);
-    else if (strcmp(*name, "Code") == 0)
+    else if (CODE == name->str())
         return new AttributeCode(name, cp, is);
     else {
         uint32_t length = readU4(is);





More information about the llvm-commits mailing list