[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Sun Aug 15 03:12:17 PDT 2004
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.86 -> 1.87
---
Log message:
Make sure globals (static fields) are initialized before we use them.
---
Diffs of the changes: (+4 -0)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.86 llvm-java/lib/Compiler/Compiler.cpp:1.87
--- llvm-java/lib/Compiler/Compiler.cpp:1.86 Sun Aug 15 04:52:11 2004
+++ llvm-java/lib/Compiler/Compiler.cpp Sun Aug 15 05:12:05 2004
@@ -372,6 +372,10 @@
ConstantFieldRef* fieldRef = cf_->getConstantFieldRef(index);
ConstantNameAndType* nameAndType = fieldRef->getNameAndType();
+ // get ClassInfo for class owning the field - this will force
+ // the globals to be initialized
+ getClassInfo(fieldRef->getClass()->getName()->str());
+
std::string globalName =
fieldRef->getClass()->getName()->str() + '/' +
nameAndType->getName()->str();
More information about the llvm-commits
mailing list