[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Chris Lattner
lattner at cs.uiuc.edu
Fri May 6 12:58:53 PDT 2005
Changes in directory llvm/lib/AsmParser:
llvmAsmParser.y updated: 1.221 -> 1.222
---
Log message:
use splice instead of remove/insert for a minor speedup
---
Diffs of the changes: (+6 -4)
llvmAsmParser.y | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.221 llvm/lib/AsmParser/llvmAsmParser.y:1.222
--- llvm/lib/AsmParser/llvmAsmParser.y:1.221 Fri May 6 14:49:51 2005
+++ llvm/lib/AsmParser/llvmAsmParser.y Fri May 6 14:58:35 2005
@@ -1703,8 +1703,9 @@
// 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 @@
// 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...
More information about the llvm-commits
mailing list