Browse Source

Improve allocas order and namings

cl-refactor
Paweł Bylica 10 years ago
parent
commit
019aa6dd63
  1. 10
      evmjit/libevmjit/Ext.cpp

10
evmjit/libevmjit/Ext.cpp

@ -60,14 +60,16 @@ llvm::Function* createFunc(EnvFunc _id, llvm::Module* _module)
llvm::Value* Ext::getArgAlloca()
{
auto& a = m_argAllocas[m_argCounter++];
auto& a = m_argAllocas[m_argCounter];
if (!a)
{
// FIXME: Improve order and names
InsertPointGuard g{getBuilder()};
getBuilder().SetInsertPoint(getMainFunction()->front().getFirstNonPHI());
a = getBuilder().CreateAlloca(Type::Word, nullptr, "arg");
auto allocaIt = getMainFunction()->front().begin();
std::advance(allocaIt, m_argCounter); // Skip already created allocas
getBuilder().SetInsertPoint(allocaIt);
a = getBuilder().CreateAlloca(Type::Word, nullptr, {"a.", std::to_string(m_argCounter)});
}
++m_argCounter;
return a;
}

Loading…
Cancel
Save