[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Mon Jan 24 05:44:38 PST 2005
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.191 -> 1.192
---
Log message:
Create a null function pointer only when we really need to.
---
Diffs of the changes: (+4 -3)
Compiler.cpp | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.191 llvm-java/lib/Compiler/Compiler.cpp:1.192
--- llvm-java/lib/Compiler/Compiler.cpp:1.191 Mon Jan 24 07:42:01 2005
+++ llvm-java/lib/Compiler/Compiler.cpp Mon Jan 24 07:44:28 2005
@@ -815,9 +815,10 @@
const FunctionType* funcTy = cast<FunctionType>(
getType(method->getDescriptor(), ObjectBaseTy));
- llvm::Constant* vfun =
- llvm::Constant::getNullValue(PointerType::get(funcTy));
- if (!cf->isInterface() && !method->isAbstract()) {
+ llvm::Constant* vfun = NULL;
+ if (cf->isInterface() || method->isAbstract())
+ vfun = llvm::Constant::getNullValue(PointerType::get(funcTy));
+ else {
vfun = module_.getOrInsertFunction(funcName, funcTy);
scheduleFunction(cast<Function>(vfun));
}
More information about the llvm-commits
mailing list