Kaydet (Commit) 393068be authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Some cosmetics.

Change-Id: I4825d94c58d8cfb245f110b7f46397c2724436a3
üst aa99ae09
......@@ -74,6 +74,9 @@ struct FormulaGroupContext : boost::noncopyable
void ensureStrArray( ColArray& rColArray, size_t nArrayLen );
void ensureNumArray( ColArray& rColArray, size_t nArrayLen );
FormulaGroupContext();
~FormulaGroupContext();
};
/**
......
......@@ -3372,24 +3372,23 @@ DynamicKernel* DynamicKernel::create(ScDocument& /* rDoc */,
sal_uInt8 nParamCount = pCur->GetParamCount();
for (sal_uInt8 i = 0; i < nParamCount; i++)
{
FormulaToken* m_TempFormula = aTokenList.back();
FormulaToken* pTempFormula = aTokenList.back();
aTokenList.pop_back();
if(m_TempFormula->GetOpCode()!=ocPush)
if (pTempFormula->GetOpCode() != ocPush)
{
if (aHashMap.find(m_TempFormula)==aHashMap.end())
if (aHashMap.find(pTempFormula)==aHashMap.end())
return NULL;
pCurNode->Children.push_back(aHashMap[m_TempFormula]);
pCurNode->Children.push_back(aHashMap[pTempFormula]);
}
else
{
FormulaTreeNodeRef m_ChildTreeNode =
FormulaTreeNodeRef pChildTreeNode =
FormulaTreeNodeRef(
new FormulaTreeNode(m_TempFormula));
pCurNode->Children.push_back(m_ChildTreeNode);
new FormulaTreeNode(pTempFormula));
pCurNode->Children.push_back(pChildTreeNode);
}
}
std::reverse(pCurNode->Children.begin(),
pCurNode->Children.end());
std::reverse(pCurNode->Children.begin(), pCurNode->Children.end());
aHashMap[pCur] = pCurNode;
}
aTokenList.push_back(pCur);
......@@ -3404,11 +3403,13 @@ DynamicKernel* DynamicKernel::create(ScDocument& /* rDoc */,
return NULL;
// OpenCL source code generation and kernel compilation
try {
try
{
pDynamicKernel->CodeGen();
pDynamicKernel->CreateKernel();
}
catch (const UnhandledToken &ut) {
catch (const UnhandledToken &ut)
{
std::cerr << "\nDynamic formual compiler: unhandled token: ";
std::cerr << ut.mMessage << " at ";
std::cerr << ut.mFile << ":" << ut.mLineNumber << "\n";
......@@ -3419,7 +3420,8 @@ DynamicKernel* DynamicKernel::create(ScDocument& /* rDoc */,
return NULL;
#endif
}
catch (...) {
catch (...)
{
std::cerr << "Dynamic formula compiler: unhandled compiler error\n";
return NULL;
}
......
......@@ -129,6 +129,14 @@ void FormulaGroupContext::ensureNumArray( ColArray& rColArray, size_t nArrayLen
rColArray.mpNumArray = &maNumArrays.back();
}
FormulaGroupContext::FormulaGroupContext()
{
}
FormulaGroupContext::~FormulaGroupContext()
{
}
namespace {
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment