From 53c4c062c176b98c5ad4b14151dbbb45c648517a Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Tue, 9 Dec 2014 18:57:34 +0000 Subject: [PATCH] Reorder the code to avoid inserting at the beginning of a vector. As per dblaikie suggestion, thanks\! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223808 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/Local.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 5decfe50626..13838ba80b6 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -1120,12 +1120,12 @@ bool llvm::replaceDbgDeclareForAlloca(AllocaInst *AI, Value *NewAllocaAddress, // will take a value storing address of the memory for variable, not // alloca itself. SmallVector NewDIExpr; + NewDIExpr.push_back(dwarf::DW_OP_deref); if (DIExpr) { for (unsigned i = 0, n = DIExpr.getNumElements(); i < n; ++i) { NewDIExpr.push_back(DIExpr.getElement(i)); } } - NewDIExpr.insert(NewDIExpr.begin(), dwarf::DW_OP_deref); // Insert llvm.dbg.declare in the same basic block as the original alloca, // and remove old llvm.dbg.declare. -- 2.40.0