Mercurial > projects > ldc
comparison gen/statements.cpp @ 355:d8357f7004ca trunk
[svn r376] Fix bug with finally blocks and labels. The labels would get emitted multiple times and conflict.
It is now possible to add label scopes in IrFunction and all labels names will be prefixed accordingly.
Also disallow goto into finally blocks.
Fixes nocompile/finally_02 and others.
author | ChristianK |
---|---|
date | Mon, 14 Jul 2008 11:48:55 +0200 |
parents | a7a26f538d6e |
children | 44daf304421c |
comparison
equal
deleted
inserted
replaced
354:ac654d4cb935 | 355:d8357f7004ca |
---|---|
1031 p->asmBlock->s.push_back(a); | 1031 p->asmBlock->s.push_back(a); |
1032 p->asmBlock->internalLabels.push_back(ident); | 1032 p->asmBlock->internalLabels.push_back(ident); |
1033 } | 1033 } |
1034 else | 1034 else |
1035 { | 1035 { |
1036 std::string labelname = ident->toChars(); | 1036 std::string labelname = p->func()->getScopedLabelName(ident->toChars()); |
1037 llvm::BasicBlock*& labelBB = p->func()->labelToBB[labelname]; | 1037 llvm::BasicBlock*& labelBB = p->func()->labelToBB[labelname]; |
1038 | 1038 |
1039 llvm::BasicBlock* oldend = gIR->scopeend(); | 1039 llvm::BasicBlock* oldend = gIR->scopeend(); |
1040 if (labelBB != NULL) { | 1040 if (labelBB != NULL) { |
1041 labelBB->moveBefore(oldend); | 1041 labelBB->moveBefore(oldend); |