コード例 #1
0
ファイル: Architecture.cpp プロジェクト: d4nnyk/snowman
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));
}
コード例 #2
0
ファイル: patchpoints.cpp プロジェクト: errord/pyston
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;
}
コード例 #3
0
ファイル: X86MasterAnalyzer.cpp プロジェクト: jiaoyk/snowman
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;
    }
}
コード例 #4
0
ファイル: X86MasterAnalyzer.cpp プロジェクト: 8l/snowman
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;
    }
}