[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Sun Dec 5 01:12:16 PST 2004
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.162 -> 1.163
---
Log message:
Intercept java/lang/System/loadLibrary calls and define this function
to do nothing.
---
Diffs of the changes: (+13 -1)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.162 llvm-java/lib/Compiler/Compiler.cpp:1.163
--- llvm-java/lib/Compiler/Compiler.cpp:1.162 Sun Dec 5 03:10:02 2004
+++ llvm-java/lib/Compiler/Compiler.cpp Sun Dec 5 03:12:05 2004
@@ -2129,7 +2129,19 @@
void do_invokestatic(unsigned index) {
Method* method = getMethod(cf_->getConstantMethodRef(index));
Function* function = getFunction(method);
- scheduleFunction(function);
+ // Intercept java/lang/System/loadLibrary() calls and add
+ // library deps to the module
+ if (function->getName().find(
+ "java/lang/System/loadLibrary(Ljava/lang/String;)V") == 0) {
+ // FIXME: we should get the string and add this library to the
+ // module.
+
+ // If this function is not defined, define it now.
+ if (function->empty())
+ new ReturnInst(NULL, new BasicBlock("entry", function));
+ }
+ else
+ scheduleFunction(function);
makeCall(function, getParams(function->getFunctionType()));
}
More information about the llvm-commits
mailing list