Changeset 806:96b404ba7eb0
- Timestamp:
- 11/30/08 05:25:40
(1 month ago)
- Author:
- Christian Kamm <kamm incasoftware de>
- branch:
- default
- Message:
Move storage of final vtbl from BaseClass? to IrInterface?: BaseClass? instances are shared!
Always use the target's irstruct interfaceMap when building the const initializer.
Tango helloworld works again.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r797 |
r806 |
|
| 155 | 155 | }; |
|---|
| 156 | 156 | |
|---|
| | 157 | // warning: two classes with the same base class share the same |
|---|
| | 158 | // BaseClass instance. |
|---|
| 157 | 159 | struct BaseClass |
|---|
| 158 | 160 | { |
|---|
| r805 |
r806 |
|
| 67 | 67 | |
|---|
| 68 | 68 | // build the interface vtable |
|---|
| 69 | | b->fillVtbl(target, &b->vtbl, newinstance); |
|---|
| | 69 | b->fillVtbl(target, &iri->vtblDecls, newinstance); |
|---|
| 70 | 70 | |
|---|
| 71 | 71 | // add the vtable type |
|---|
| … | … | |
| 494 | 494 | } |
|---|
| 495 | 495 | |
|---|
| 496 | | // if it's a class, and it implements interfaces, add the vtables |
|---|
| 497 | | IrStruct* irstruct = cd->ir.irStruct; |
|---|
| | 496 | // if it's a class, and it implements interfaces, add the vtables - as found in the target class! |
|---|
| | 497 | IrStruct* irstruct = target->ir.irStruct; |
|---|
| 498 | 498 | |
|---|
| 499 | 499 | size_t nvtbls = cd->vtblInterfaces->dim; |
|---|
| … | … | |
| 593 | 593 | |
|---|
| 594 | 594 | // build vtable intializer for this interface implementation |
|---|
| 595 | | Array& arr = iri->base->vtbl; |
|---|
| | 595 | Array& arr = iri->vtblDecls; |
|---|
| 596 | 596 | size_t narr = arr.dim; |
|---|
| 597 | 597 | |
|---|
| r802 |
r806 |
|
| 165 | 165 | LLConstant* vtblInit; |
|---|
| 166 | 166 | LLGlobalVariable* vtbl; |
|---|
| | 167 | Array vtblDecls; // array of FuncDecls that make up the vtbl |
|---|
| 167 | 168 | |
|---|
| 168 | 169 | const LLStructType* infoTy; |
|---|