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 | f924a4c21fd34386015ca42628d3648b908102d0 (patch) | |
tree | f961ac39792e1ccbd8ae2cd7e4faa61692f78bc7 /lib/AsmParser | |
parent | 1f64025d8807ca14bebac6b2e577b5e26b74a279 (diff) | |
download | external_llvm-f924a4c21fd34386015ca42628d3648b908102d0.zip external_llvm-f924a4c21fd34386015ca42628d3648b908102d0.tar.gz external_llvm-f924a4c21fd34386015ca42628d3648b908102d0.tar.bz2 |
use splice instead of remove/insert for a minor speedup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index d99680f..34e0f70 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/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... |