aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolutionExpressions.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-06-14 22:47:23 +0000
committerDan Gohman <gohman@apple.com>2009-06-14 22:47:23 +0000
commita82752c9eb5fbdd1b7276fde7349ac9453eb5a75 (patch)
tree44b74fb6e291342880ff262c551f3f014257e2fe /include/llvm/Analysis/ScalarEvolutionExpressions.h
parentea73f3c2e14d84bb4cb07bd6a1a3d7915f3aff83 (diff)
downloadexternal_llvm-a82752c9eb5fbdd1b7276fde7349ac9453eb5a75.zip
external_llvm-a82752c9eb5fbdd1b7276fde7349ac9453eb5a75.tar.gz
external_llvm-a82752c9eb5fbdd1b7276fde7349ac9453eb5a75.tar.bz2
Convert several parts of the ScalarEvolution framework to use
SmallVector instead of std::vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpressions.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpressions.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpressions.h b/include/llvm/Analysis/ScalarEvolutionExpressions.h
index 1978055..ced220a 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpressions.h
@@ -199,10 +199,10 @@ namespace llvm {
///
class SCEVNAryExpr : public SCEV {
protected:
- std::vector<SCEVHandle> Operands;
+ SmallVector<SCEVHandle, 8> Operands;
- SCEVNAryExpr(enum SCEVTypes T, const std::vector<SCEVHandle> &ops)
- : SCEV(T), Operands(ops) {}
+ SCEVNAryExpr(enum SCEVTypes T, const SmallVectorImpl<SCEVHandle> &ops)
+ : SCEV(T), Operands(ops.begin(), ops.end()) {}
virtual ~SCEVNAryExpr() {}
public:
@@ -212,8 +212,8 @@ namespace llvm {
return Operands[i];
}
- const std::vector<SCEVHandle> &getOperands() const { return Operands; }
- typedef std::vector<SCEVHandle>::const_iterator op_iterator;
+ const SmallVectorImpl<SCEVHandle> &getOperands() const { return Operands; }
+ typedef SmallVectorImpl<SCEVHandle>::const_iterator op_iterator;
op_iterator op_begin() const { return Operands.begin(); }
op_iterator op_end() const { return Operands.end(); }
@@ -259,7 +259,7 @@ namespace llvm {
///
class SCEVCommutativeExpr : public SCEVNAryExpr {
protected:
- SCEVCommutativeExpr(enum SCEVTypes T, const std::vector<SCEVHandle> &ops)
+ SCEVCommutativeExpr(enum SCEVTypes T, const SmallVectorImpl<SCEVHandle> &ops)
: SCEVNAryExpr(T, ops) {}
~SCEVCommutativeExpr();
@@ -289,7 +289,7 @@ namespace llvm {
class SCEVAddExpr : public SCEVCommutativeExpr {
friend class ScalarEvolution;
- explicit SCEVAddExpr(const std::vector<SCEVHandle> &ops)
+ explicit SCEVAddExpr(const SmallVectorImpl<SCEVHandle> &ops)
: SCEVCommutativeExpr(scAddExpr, ops) {
}
@@ -309,7 +309,7 @@ namespace llvm {
class SCEVMulExpr : public SCEVCommutativeExpr {
friend class ScalarEvolution;
- explicit SCEVMulExpr(const std::vector<SCEVHandle> &ops)
+ explicit SCEVMulExpr(const SmallVectorImpl<SCEVHandle> &ops)
: SCEVCommutativeExpr(scMulExpr, ops) {
}
@@ -387,7 +387,7 @@ namespace llvm {
const Loop *L;
- SCEVAddRecExpr(const std::vector<SCEVHandle> &ops, const Loop *l)
+ SCEVAddRecExpr(const SmallVectorImpl<SCEVHandle> &ops, const Loop *l)
: SCEVNAryExpr(scAddRecExpr, ops), L(l) {
for (size_t i = 0, e = Operands.size(); i != e; ++i)
assert(Operands[i]->isLoopInvariant(l) &&
@@ -404,7 +404,7 @@ namespace llvm {
/// of degree N, it returns a chrec of degree N-1.
SCEVHandle getStepRecurrence(ScalarEvolution &SE) const {
if (isAffine()) return getOperand(1);
- return SE.getAddRecExpr(std::vector<SCEVHandle>(op_begin()+1,op_end()),
+ return SE.getAddRecExpr(SmallVector<SCEVHandle, 3>(op_begin()+1,op_end()),
getLoop());
}
@@ -463,7 +463,7 @@ namespace llvm {
class SCEVSMaxExpr : public SCEVCommutativeExpr {
friend class ScalarEvolution;
- explicit SCEVSMaxExpr(const std::vector<SCEVHandle> &ops)
+ explicit SCEVSMaxExpr(const SmallVectorImpl<SCEVHandle> &ops)
: SCEVCommutativeExpr(scSMaxExpr, ops) {
}
@@ -484,7 +484,7 @@ namespace llvm {
class SCEVUMaxExpr : public SCEVCommutativeExpr {
friend class ScalarEvolution;
- explicit SCEVUMaxExpr(const std::vector<SCEVHandle> &ops)
+ explicit SCEVUMaxExpr(const SmallVectorImpl<SCEVHandle> &ops)
: SCEVCommutativeExpr(scUMaxExpr, ops) {
}