void Architecture::addCallingConvention(std::unique_ptr<ir::calling::Convention> convention) { assert(convention != NULL); assert(getCallingConvention(convention->name()) == NULL && "No two calling conventions with the same name allowed."); conventions_.push_back(std::move(convention)); }
int PatchpointSetupInfo::totalSize() const { int call_size = 13; if (getCallingConvention() != llvm::CallingConv::C) { // have no idea what the precise number is: call_size = 128; } return num_slots * slot_size + call_size; }
void X86MasterAnalyzer::detectCallingConvention(core::Context &context, const core::ir::calling::CalleeId &calleeId) const { auto architecture = context.image()->architecture(); auto setConvention = [&](const char *name) { context.conventions()->setConvention(calleeId, architecture->getCallingConvention(QLatin1String(name))); }; switch (architecture->bitness()) { case 16: setConvention("cdecl16"); break; case 32: setConvention("cdecl32"); break; case 64: setConvention("amd64"); break; } }
void X86MasterAnalyzer::detectCallingConvention(core::Context &context, const core::ir::calling::CalleeId &calleeId) const { const auto &platform = context.image()->platform(); auto architecture = platform.architecture(); auto setConvention = [&](const char *name) { context.conventions()->setConvention(calleeId, architecture->getCallingConvention(QLatin1String(name))); }; switch (architecture->bitness()) { case 16: setConvention("cdecl16"); break; case 32: setConvention("cdecl32"); break; case 64: if (platform.operatingSystem() == core::image::Platform::Windows) { setConvention("microsoft64"); } else { setConvention("amd64"); } break; } }