summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-06 19:58:35 +0000
committerChris Lattner <sabre@nondot.org>2005-05-06 19:58:35 +0000
commit6d817c5486c4c686a6d2ca4c0f079bd02d2b1270 (patch)
tree4de267995c127dd434bd2960cc65957fbc601c33 /llvm/lib
parent6409f3490a0e99f1c886de4d8bfe77f4c0b1069d (diff)
downloadbcm5719-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.y10
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...
OpenPOWER on IntegriCloud