parse gnu __leaf__ attribute
authorMatthias Braun <matthias.braun@kit.edu>
Thu, 3 May 2012 14:12:11 +0000 (16:12 +0200)
committerMatthias Braun <matthias.braun@kit.edu>
Thu, 3 May 2012 14:12:11 +0000 (16:12 +0200)
(no code generation yet)

attribute.c
attribute_t.h
entity_t.h

index cbade71..0882141 100644 (file)
@@ -51,6 +51,7 @@ static const char *const attribute_names[ATTRIBUTE_LAST+1] = {
        [ATTRIBUTE_GNU_GCC_STRUCT]             = "gcc_struct",
        [ATTRIBUTE_GNU_INTERRUPT_HANDLER]      = "interrupt_handler",
        [ATTRIBUTE_GNU_INTERRUPT]              = "interrupt",
+       [ATTRIBUTE_GNU_LEAF]                   = "leaf",
        [ATTRIBUTE_GNU_LONGCALL]               = "longcall",
        [ATTRIBUTE_GNU_LONG_CALL]              = "long_call",
        [ATTRIBUTE_GNU_MALLOC]                 = "malloc",
@@ -359,6 +360,7 @@ void handle_entity_attributes(const attribute_t *attributes, entity_t *entity)
                case ATTRIBUTE_GNU_DLLIMPORT:     modifiers |= DM_DLLIMPORT; break;
                case ATTRIBUTE_GNU_DLLEXPORT:     modifiers |= DM_DLLEXPORT; break;
                case ATTRIBUTE_GNU_WEAK:          modifiers |= DM_WEAK; break;
+               case ATTRIBUTE_GNU_LEAF:          modifiers |= DM_LEAF; break;
 
                case ATTRIBUTE_MS_DLLIMPORT:     modifiers |= DM_DLLIMPORT; break;
                case ATTRIBUTE_MS_DLLEXPORT:     modifiers |= DM_DLLEXPORT; break;
index bb1076e..75efc72 100644 (file)
@@ -36,6 +36,7 @@ typedef enum attribute_kind_t {
        ATTRIBUTE_GNU_GCC_STRUCT,
        ATTRIBUTE_GNU_INTERRUPT,
        ATTRIBUTE_GNU_INTERRUPT_HANDLER,
+       ATTRIBUTE_GNU_LEAF,
        ATTRIBUTE_GNU_LONGCALL,
        ATTRIBUTE_GNU_LONG_CALL,
        ATTRIBUTE_GNU_MALLOC,
index 69257c6..0e5c0d2 100644 (file)
@@ -91,6 +91,7 @@ typedef enum decl_modifier_t {
        DM_RETURNS_TWICE     = 1 << 25,
        DM_MALLOC            = 1 << 26,
        DM_WEAK              = 1 << 27,
+       DM_LEAF              = 1 << 28,
 } decl_modifier_t;
 
 typedef enum elf_visibility_tag_t {