diff options
author | Chris Lattner <sabre@nondot.org> | 2005-05-06 19:58:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-05-06 19:58:35 +0000 |
commit | 6d817c5486c4c686a6d2ca4c0f079bd02d2b1270 (patch) | |
tree | 4de267995c127dd434bd2960cc65957fbc601c33 /llvm/lib | |
parent | 6409f3490a0e99f1c886de4d8bfe77f4c0b1069d (diff) | |
download | bcm5719-llvm-6d817c5486c4c686a6d2ca4c0f079bd02d2b1270.tar.gz bcm5719-llvm-6d817c5486c4c686a6d2ca4c0f079bd02d2b1270.zip |
use splice instead of remove/insert for a minor speedup
llvm-svn: 21743
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/AsmParser/llvmAsmParser.y | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y index d99680fdb8c..34e0f70b3c1 100644 --- a/llvm/lib/AsmParser/llvmAsmParser.y +++ b/llvm/lib/AsmParser/llvmAsmParser.y @@ -1703,8 +1703,9 @@ InstructionList : InstructionList Inst { // 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($$); - CurFun.CurrentFunction->getBasicBlockList().push_back($$); + Function::BasicBlockListType &BBL = + CurFun.CurrentFunction->getBasicBlockList(); + BBL.splice(BBL.end(), BBL, $$); } | LABELSTR { $$ = getBBVal(ValID::create($1), true); @@ -1712,8 +1713,9 @@ InstructionList : InstructionList Inst { // 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($$); - CurFun.CurrentFunction->getBasicBlockList().push_back($$); + Function::BasicBlockListType &BBL = + CurFun.CurrentFunction->getBasicBlockList(); + BBL.splice(BBL.end(), BBL, $$); }; BBTerminatorInst : RET ResolvedVal { // Return with a result... |