From 3f1b4ec3498585ee5eee48c1e031c8f073009ad7 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 27 Nov 2012 10:56:57 +0100 Subject: Handle constant arrays as well --- lib/Core/Executor.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/Core/Executor.cpp') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 184b0983..88ede5c8 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -929,8 +929,17 @@ ref Executor::evalConstant(const Constant *c) { } ref res = ConcatExpr::createN(kids.size(), kids.data()); return cast(res); + } else if (const ConstantArray *ca = dyn_cast(c)){ + llvm::SmallVector, 4> kids; + for (unsigned i = ca->getNumOperands(); i != 0; --i) { + unsigned op = i-1; + ref kid = evalConstant(ca->getOperand(op)); + kids.push_back(kid); + } + ref res = ConcatExpr::createN(kids.size(), kids.data()); + return cast(res); } else { - // Constant{Array,Vector} + // Constant{Vector} assert(0 && "invalid argument to evalConstant()"); } } -- cgit 1.4.1