[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Chris Lattner
sabre at nondot.org
Tue Jan 30 20:44:02 PST 2007
Changes in directory llvm/lib/AsmParser:
llvmAsmParser.y updated: 1.315 -> 1.316
---
Log message:
eliminate a temporary vector
---
Diffs of the changes: (+3 -2)
llvmAsmParser.y | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.315 llvm/lib/AsmParser/llvmAsmParser.y:1.316
--- llvm/lib/AsmParser/llvmAsmParser.y:1.315 Tue Jan 30 14:08:37 2007
+++ llvm/lib/AsmParser/llvmAsmParser.y Tue Jan 30 22:43:46 2007
@@ -20,6 +20,7 @@
#include "llvm/SymbolTable.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Streams.h"
@@ -1733,7 +1734,7 @@
if (!IdxTy)
GEN_ERROR("Index list invalid for constant getelementptr!");
- std::vector<Constant*> IdxVec;
+ SmallVector<Constant*, 8> IdxVec;
for (unsigned i = 0, e = $4->size(); i != e; ++i)
if (Constant *C = dyn_cast<Constant>((*$4)[i]))
IdxVec.push_back(C);
@@ -1742,7 +1743,7 @@
delete $4;
- $$ = ConstantExpr::getGetElementPtr($3, IdxVec);
+ $$ = ConstantExpr::getGetElementPtr($3, &IdxVec[0], IdxVec.size());
CHECK_FOR_ERROR
}
| SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' {
More information about the llvm-commits
mailing list