entity = new_d_entity(global_type, id, ir_type_method, dbgi);
set_entity_ld_ident(entity, create_ld_ident(entity, declaration));
+ if (declaration->modifiers & DM_USED) {
+ set_entity_stickyness(entity, stickyness_sticky);
+ }
+
/* static inline => local
* extern inline => local
* inline without definition => local
* Extended microsoft modifier.
*/
typedef enum {
- DM_DLLIMPORT = (1 << 0),
- DM_DLLEXPORT = (1 << 1),
- DM_THREAD = (1 << 2),
- DM_NAKED = (1 << 3),
- DM_MICROSOFT_INLINE = (1 << 4),
- DM_FORCEINLINE = (1 << 5),
- DM_SELECTANY = (1 << 6),
- DM_NOTHROW = (1 << 7),
- DM_NOVTABLE = (1 << 8),
- DM_NORETURN = (1 << 9),
- DM_NOINLINE = (1 << 10),
- DM_RESTRICT = (1 << 11),
- DM_NOALIAS = (1 << 12),
- DM_PACKED = (1 << 13),
- DM_TRANSPARENT_UNION = (1 << 14),
- DM_PURE = (1 << 15),
- DM_CONSTRUCTOR = (1 << 16),
- DM_DESTRUCTOR = (1 << 17)
+ DM_DLLIMPORT = 1 << 0,
+ DM_DLLEXPORT = 1 << 1,
+ DM_THREAD = 1 << 2,
+ DM_NAKED = 1 << 3,
+ DM_MICROSOFT_INLINE = 1 << 4,
+ DM_FORCEINLINE = 1 << 5,
+ DM_SELECTANY = 1 << 6,
+ DM_NOTHROW = 1 << 7,
+ DM_NOVTABLE = 1 << 8,
+ DM_NORETURN = 1 << 9,
+ DM_NOINLINE = 1 << 10,
+ DM_RESTRICT = 1 << 11,
+ DM_NOALIAS = 1 << 12,
+ DM_PACKED = 1 << 13,
+ DM_TRANSPARENT_UNION = 1 << 14,
+ DM_PURE = 1 << 15,
+ DM_CONSTRUCTOR = 1 << 16,
+ DM_DESTRUCTOR = 1 << 17,
+ DM_USED = 1 << 18
} decl_modifier_t;
typedef unsigned decl_modifiers_t;
case GNU_AK_NOCOMMON:
case GNU_AK_SHARED:
case GNU_AK_NOTSHARED:
- case GNU_AK_USED:
case GNU_AK_UNUSED:
case GNU_AK_NO_INSTRUMENT_FUNCTION:
case GNU_AK_WARN_UNUSED_RESULT:
check_no_argument(attribute, name);
break;
+ case GNU_AK_USED:
+ modifiers |= DM_USED;
+ check_no_argument(attribute, name);
+ break;
+
case GNU_AK_PURE:
check_no_argument(attribute, name);
modifiers |= DM_PURE;