From a41b822420f08188b7ec031d3a6a73c63ed8dd37 Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Tue, 26 Jul 2011 09:30:36 +0400 Subject: [PATCH] Fixed ldc1 compilation --- dmd/expression.h | 1 + dmd2/irstate.c | 4 ++++ dmd2/irstate.h | 2 ++ gen/irstate.h | 2 ++ gen/statements.cpp | 2 ++ 5 files changed, 11 insertions(+) diff --git a/dmd/expression.h b/dmd/expression.h index e6e39ae9..94f07f54 100644 --- a/dmd/expression.h +++ b/dmd/expression.h @@ -175,6 +175,7 @@ struct Expression : Object #if IN_LLVM virtual DValue* toElem(IRState* irs); + DValue *toElemDtor(IRState *irs); virtual llvm::Constant *toConstElem(IRState *irs); virtual void cacheLvalue(IRState* irs); diff --git a/dmd2/irstate.c b/dmd2/irstate.c index 42649bb0..4fc35ece 100644 --- a/dmd2/irstate.c +++ b/dmd2/irstate.c @@ -32,7 +32,9 @@ IRState::IRState(IRState *irs, Statement *s) sthis = irs->sthis; blx = irs->blx; deferToObj = irs->deferToObj; +#if DMDV2 varsInScope = irs->varsInScope; +#endif } else { @@ -42,7 +44,9 @@ IRState::IRState(IRState *irs, Statement *s) sthis = NULL; blx = NULL; deferToObj = NULL; +#if DMDV2 varsInScope = NULL; +#endif } } diff --git a/dmd2/irstate.h b/dmd2/irstate.h index fe0d0fca..1b318aa9 100644 --- a/dmd2/irstate.h +++ b/dmd2/irstate.h @@ -37,7 +37,9 @@ struct IRState Array *deferToObj; // array of Dsymbol's to run toObjFile(int multiobj) on later elem *ehidden; // transmit hidden pointer to CallExp::toElem() Symbol *startaddress; +#if DMDV2 Array *varsInScope; // variables that are in scope that will need destruction later +#endif block *breakBlock; block *contBlock; diff --git a/gen/irstate.h b/gen/irstate.h index 86954657..ca26c8b4 100644 --- a/gen/irstate.h +++ b/gen/irstate.h @@ -139,7 +139,9 @@ struct IRState // basic block scopes std::vector scopes; IRScope& scope(); +#if DMDV2 std::vector &varsInScope() { return scope().varsInScope; } +#endif llvm::BasicBlock* scopebb(); llvm::BasicBlock* scopeend(); bool scopereturned(); diff --git a/gen/statements.cpp b/gen/statements.cpp index d7af2ef2..73dea5ea 100644 --- a/gen/statements.cpp +++ b/gen/statements.cpp @@ -1644,9 +1644,11 @@ void SwitchErrorStatement::toIR(IRState* p) ////////////////////////////////////////////////////////////////////////////// +#if DMDV2 void ImportStatement::toIR(IRState *irs) { } +#endif //////////////////////////////////////////////////////////////////////////////