Ejemplo n.º 1
0
 /// @brief Mark this alloca as temporary to avoid hoisting later on
 void Builder::SetTempAlloca(Value* inst)
 {
     AllocaInst* pAlloca = dyn_cast<AllocaInst>(inst);
     SWR_ASSERT(pAlloca, "Unexpected non-alloca instruction");
     MDNode* N = MDNode::get(JM()->mContext, MDString::get(JM()->mContext, "is_temp_alloca"));
     pAlloca->setMetadata("is_temp_alloca", N);
 }
Ejemplo n.º 2
0
void md::setRegisterStruct(AllocaInst& alloca, bool registerStruct)
{
	auto currentNode = alloca.getMetadata("fcd.registers");
	if (registerStruct)
	{
		if (currentNode == nullptr)
		{
			setFlag(alloca, "fcd.registers");
		}
	}
	else if (currentNode != nullptr)
	{
		alloca.setMetadata("fcd.registers", nullptr);
	}
}