Eliminated the need for resolve, declare, const-init and define lists to drive code generation.

This commit is contained in:
Tomas Lindquist Olsen
2009-03-27 21:50:32 +01:00
parent daef67acc3
commit ec986231e5
14 changed files with 198 additions and 402 deletions

10
ir/ir.h
View File

@@ -3,10 +3,13 @@
#ifndef LDC_IR_IR_H
#define LDC_IR_IR_H
#include <deque>
#include "ir/irforw.h"
#include "root.h"
struct IRState;
struct IrFunction;
struct IrBase : Object
{
@@ -15,13 +18,18 @@ struct IrBase : Object
struct Ir
{
Ir() : irs(NULL) {}
Ir();
void setState(IRState* p) { irs = p; }
IRState* getState() { return irs; }
void addFunctionBody(IrFunction* f);
void emitFunctionBodies();
private:
IRState* irs;
std::deque<IrFunction*> functionbodies;
};
#endif

View File

@@ -49,7 +49,7 @@ IRLandingPadInfo::IRLandingPadInfo(Catch* catchstmt, llvm::BasicBlock* end)
assert(catchstmt->type);
catchType = catchstmt->type->toBasetype()->isClassHandle();
assert(catchType);
DtoForceDeclareDsymbol(catchType);
catchType->codegen(Type::sir);
}
IRLandingPadInfo::IRLandingPadInfo(Statement* finallystmt)