[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Sat Mar 26 19:26:19 PST 2005
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.255 -> 1.256
---
Log message:
Only add super class vtables to classes not interfaces.
---
Diffs of the changes: (+11 -11)
Compiler.cpp | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.255 llvm-java/lib/Compiler/Compiler.cpp:1.256
--- llvm-java/lib/Compiler/Compiler.cpp:1.255 Sat Mar 26 18:04:10 2005
+++ llvm-java/lib/Compiler/Compiler.cpp Sat Mar 26 21:26:08 2005
@@ -568,17 +568,6 @@
assert(!vi.vtable && vi.m2iMap.empty() &&
"got already initialized VTableInfo!");
- ConstantClass* super = cf->getSuperClass();
- assert(super && "Class does not have superclass!");
- const VTableInfo& superVI =
- getVTableInfo(ClassFile::get(super->getName()->str()));
-
- // Copy the super vtables array.
- vi.superVtables.reserve(superVI.superVtables.size() + 1);
- vi.superVtables.push_back(superVI.vtable);
- std::copy(superVI.superVtables.begin(), superVI.superVtables.end(),
- std::back_inserter(vi.superVtables));
-
std::vector<llvm::Constant*> init(1);
// Use a null typeinfo struct for now.
init[0] = llvm::Constant::getNullValue(VTableInfo::TypeInfoTy);
@@ -609,6 +598,17 @@
// Otherwise this is a class, so add all methods from its super
// class.
else {
+ ConstantClass* super = cf->getSuperClass();
+ assert(super && "Class does not have superclass!");
+ const VTableInfo& superVI =
+ getVTableInfo(ClassFile::get(super->getName()->str()));
+
+ // Copy the super vtables array.
+ vi.superVtables.reserve(superVI.superVtables.size() + 1);
+ vi.superVtables.push_back(superVI.vtable);
+ std::copy(superVI.superVtables.begin(), superVI.superVtables.end(),
+ std::back_inserter(vi.superVtables));
+
assert(superVI.vtable && "No vtable found for super class!");
ConstantStruct* superInit =
cast<ConstantStruct>(superVI.vtable->getInitializer());
More information about the llvm-commits
mailing list