http://d.puremagic.com/issues/show_bug.cgi?id=5748

           Summary: @naked annotation
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-03-17 10:02:29 PDT ---
I think that the "naked" that currently is usable inside asm blocks is a
property of the whole function that contains the asm block and not just of the
asm block, so I suggest to deprecate (and later remove) the "naked" and to add
a @naked function annotation.

An example, from (from dmd\src\druntime\src\core\thread.d):


version( D_InlineAsm_X86 ) {
    static void* getBasePtr() {
        asm {
            naked;
            mov EAX, EBP;
            ret;
        }
    }

    obj.m_main.bstack = getBasePtr();
} else version( D_InlineAsm_X86_64 ) {
    static void* getBasePtr() {
        asm {
            naked;
            mov RAX, RBP;
            ret;
        }
    }

    obj.m_main.bstack = getBasePtr();
}


To:

version( D_InlineAsm_X86 ) {
    @naked static void* getBasePtr() {
        asm {
            mov EAX, EBP;
            ret;
        }
    }

    obj.m_main.bstack = getBasePtr();
} else version( D_InlineAsm_X86_64 ) {
    @naked static void* getBasePtr() {
        asm {
            mov RAX, RBP;
            ret;
        }
    }

    obj.m_main.bstack = getBasePtr();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to