aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2008-05-02 15:42:33 -0400
committerJosh Triplett <josh@freedesktop.org>2008-06-27 11:05:35 -0700
commit230e6e21679296401c1e3c3090de456344f13063 (patch)
tree50e8704507ddf9b4b6729e21f4981c19a0d67130
parent6a0698873c43e41c78abf3231c6d5a7863bda897 (diff)
downloadsparse-230e6e21679296401c1e3c3090de456344f13063.tar.gz
sparse-230e6e21679296401c1e3c3090de456344f13063.tar.xz
sparse-230e6e21679296401c1e3c3090de456344f13063.zip
Ignore "cold" and "hot" attributes, which appeared in gcc 4.3
They describe how likely the function is to be executed, which can affect optimization. Also ignore the attributes with underscores. Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r--ident-list.h2
-rw-r--r--parse.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/ident-list.h b/ident-list.h
index 8fcd7de..6104826 100644
--- a/ident-list.h
+++ b/ident-list.h
@@ -74,6 +74,8 @@ IDENT(__malloc__);
IDENT(nonnull); IDENT(__nonnull); IDENT(__nonnull__);
IDENT(constructor); IDENT(__constructor__);
IDENT(destructor); IDENT(__destructor__);
+IDENT(cold); IDENT(__cold__);
+IDENT(hot); IDENT(__hot__);
IDENT(cdecl); IDENT(__cdecl__);
IDENT(stdcall); IDENT(__stdcall__);
IDENT(fastcall); IDENT(__fastcall__);
diff --git a/parse.c b/parse.c
index 137ba77..877414c 100644
--- a/parse.c
+++ b/parse.c
@@ -353,6 +353,10 @@ static struct init_keyword {
{ "__constructor__", NS_KEYWORD, .op = &ignore_attr_op },
{ "destructor", NS_KEYWORD, .op = &ignore_attr_op },
{ "__destructor__", NS_KEYWORD, .op = &ignore_attr_op },
+ { "cold", NS_KEYWORD, .op = &ignore_attr_op },
+ { "__cold__", NS_KEYWORD, .op = &ignore_attr_op },
+ { "hot", NS_KEYWORD, .op = &ignore_attr_op },
+ { "__hot__", NS_KEYWORD, .op = &ignore_attr_op },
};
void init_parser(int stream)