Remove AST dependency on VMCore by switching ExtVectorElementExpr off Constant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51068 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 61c21b0..2ac30b4 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -1057,9 +1057,9 @@
}
/// getEncodedElementAccess - We encode the fields as a llvm ConstantArray.
-llvm::Constant *ExtVectorElementExpr::getEncodedElementAccess() const {
+void ExtVectorElementExpr::getEncodedElementAccess(
+ llvm::SmallVectorImpl<unsigned> &Elts) const {
const char *compStr = Accessor.getName();
- llvm::SmallVector<llvm::Constant *, 8> Indices;
bool isHi = !strcmp(compStr, "hi");
bool isLo = !strcmp(compStr, "lo");
@@ -1080,9 +1080,8 @@
else
Index = ExtVectorType::getAccessorIdx(compStr[i]);
- Indices.push_back(llvm::ConstantInt::get(llvm::Type::Int32Ty, Index));
+ Elts.push_back(Index);
}
- return llvm::ConstantVector::get(&Indices[0], Indices.size());
}
unsigned