Call desctructors on temporary variables

This commit is contained in:
Alexey Prokhin
2011-07-19 19:20:42 +04:00
parent 3c7490e446
commit 2cc34c4005
5 changed files with 64 additions and 22 deletions

View File

@@ -52,6 +52,11 @@ struct IRScope
IRScope(llvm::BasicBlock* b, llvm::BasicBlock* e);
const IRScope& operator=(const IRScope& rhs);
#if DMDV2
// list of variables needing destruction
std::vector<VarDeclaration*> varsInScope;
#endif
};
struct IRBuilderHelper
@@ -134,6 +139,7 @@ struct IRState
// basic block scopes
std::vector<IRScope> scopes;
IRScope& scope();
std::vector<VarDeclaration*> &varsInScope() { return scope().varsInScope; }
llvm::BasicBlock* scopebb();
llvm::BasicBlock* scopeend();
bool scopereturned();