Example #1
0
	Function *VirtualMachine::GetRuntimeFunction(const std::string &name, bool isStatic)
	{
		// Find the module member.
		Member *member = runtimeModule->GetMember(name);
		if(!member || !member->IsFunction() || member->IsStatic() != isStatic)
			throw VirtualMachineException("Using incompatible runtime, cannot find: " + name);
		
		// Cast and declare the function.
		Function *function = static_cast<Function*> (member);
		function->DeclarePass();
		return function;		
	}