diff options
author | Chris Lattner <sabre@nondot.org> | 2004-07-26 01:40:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-07-26 01:40:20 +0000 |
commit | 8d65a06a3ec0d091c1c2d63c9e934f717b39c0c2 (patch) | |
tree | 4ecc6a73ea6935094acc7db61d2e679e317afcd3 | |
parent | badf091b47ee6c7db7cb549381f693a7850c1595 (diff) |
Fix bug in previous patch :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15226 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 440056de2d..8387fea6e5 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -383,12 +383,6 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) { ThrowException("Redefinition of label " + ID.getName()); ID.destroy(); // Free strdup'd memory. - - // Make sure to move the basic block to the correct location in the - // function, instead of leaving it inserted wherever it was first - // referenced. - CurFun.CurrentFunction->getBasicBlockList().remove(BB); - CurFun.CurrentFunction->getBasicBlockList().push_back(BB); return BB; } @@ -1685,9 +1679,21 @@ InstructionList : InstructionList Inst { } | /* empty */ { $$ = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); + + // Make sure to move the basic block to the correct location in the + // function, instead of leaving it inserted wherever it was first + // referenced. + CurFun.CurrentFunction->getBasicBlockList().remove(CurBB); + CurFun.CurrentFunction->getBasicBlockList().push_back(CurBB); } | LABELSTR { $$ = CurBB = getBBVal(ValID::create($1), true); + + // Make sure to move the basic block to the correct location in the + // function, instead of leaving it inserted wherever it was first + // referenced. + CurFun.CurrentFunction->getBasicBlockList().remove(CurBB); + CurFun.CurrentFunction->getBasicBlockList().push_back(CurBB); }; BBTerminatorInst : RET ResolvedVal { // Return with a result... |