fix strangeattr.c
authorMatthias Braun <matze@braunis.de>
Mon, 1 Feb 2010 20:45:23 +0000 (20:45 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 1 Feb 2010 20:45:23 +0000 (20:45 +0000)
[r27024]

ast2firm.c

index 0cb5a2c..bb44c6f 100644 (file)
@@ -889,18 +889,17 @@ static void handle_decl_modifiers(ir_entity *irentity, entity_t *entity)
 {
        assert(is_declaration(entity));
        decl_modifiers_t modifiers = entity->declaration.modifiers;
-       if (modifiers & DM_PURE) {
-               /* TRUE if the declaration includes the GNU
-                  __attribute__((pure)) specifier. */
-               set_entity_additional_property(irentity, mtp_property_pure);
-       }
-       if (modifiers & DM_CONST) {
-               set_entity_additional_property(irentity, mtp_property_const);
-               have_const_functions = true;
+
+       if (is_method_entity(irentity)) {
+               if (modifiers & DM_PURE) {
+                       set_entity_additional_property(irentity, mtp_property_pure);
+               }
+               if (modifiers & DM_CONST) {
+                       set_entity_additional_property(irentity, mtp_property_const);
+                       have_const_functions = true;
+               }
        }
        if (modifiers & DM_USED) {
-               /* TRUE if the declaration includes the GNU
-                  __attribute__((used)) specifier. */
                set_entity_stickyness(irentity, stickyness_sticky);
        }
 }