summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/LowerSetJmp.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2007-08-01 03:43:44 +0000
committerDavid Greene <greened@obbligato.org>2007-08-01 03:43:44 +0000
commit52eec548206d0b135b55ba52dd0e82e978f15ae5 (patch)
tree1c9794c86069c19f235104ec8c2a6f91405552d2 /lib/Transforms/IPO/LowerSetJmp.cpp
parent7fc77611eff7c47e8c37fad58af637138e2a9d7a (diff)
downloadllvm-52eec548206d0b135b55ba52dd0e82e978f15ae5.tar.gz
llvm-52eec548206d0b135b55ba52dd0e82e978f15ae5.tar.bz2
llvm-52eec548206d0b135b55ba52dd0e82e978f15ae5.tar.xz
New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector. Updates to all clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/LowerSetJmp.cpp')
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp
index 0243980129..2fa6a10ced 100644
--- a/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/lib/Transforms/IPO/LowerSetJmp.cpp
@@ -49,6 +49,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/VectorExtras.h"
+#include "llvm/ADT/SmallVector.h"
using namespace llvm;
STATISTIC(LongJmpsTransformed, "Number of longjmps transformed");
@@ -263,7 +264,10 @@ void LowerSetJmp::TransformLongJmpCall(CallInst* Inst)
// Inst's uses and doesn't get a name.
CastInst* CI =
new BitCastInst(Inst->getOperand(1), SBPTy, "LJBuf", Inst);
- new CallInst(ThrowLongJmp, CI, Inst->getOperand(2), "", Inst);
+ SmallVector<Value *, 2> Args;
+ Args.push_back(CI);
+ Args.push_back(Inst->getOperand(2));
+ new CallInst(ThrowLongJmp, Args.begin(), Args.end(), "", Inst);
SwitchValuePair& SVP = SwitchValMap[Inst->getParent()->getParent()];
@@ -381,7 +385,7 @@ void LowerSetJmp::TransformSetJmpCall(CallInst* Inst)
make_vector<Value*>(GetSetJmpMap(Func), BufPtr,
ConstantInt::get(Type::Int32Ty,
SetJmpIDMap[Func]++), 0);
- new CallInst(AddSJToMap, &Args[0], Args.size(), "", Inst);
+ new CallInst(AddSJToMap, Args.begin(), Args.end(), "", Inst);
// We are guaranteed that there are no values live across basic blocks
// (because we are "not in SSA form" yet), but there can still be values live