summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2015-05-21 15:39:34 -0300
committerAlexandre Oliva <aoliva@redhat.com>2016-02-19 19:54:59 -0200
commitbcc7ab25d9df0efbe9604ed86b11544902bff75f (patch)
treee0e31a95be20ef2a325ef8b145b16c8952600ba6
parent3e8b8dd563fa9de6ea15c7a80b265946ec7e500c (diff)
downloadgcc-bcc7ab25d9df0efbe9604ed86b11544902bff75f.tar.gz
Use build_lang_decl for functions
-rw-r--r--libcc1/libcp1plugin.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index 789be2c5adb..7a4270a193a 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -417,7 +417,13 @@ plugin_build_decl (cc1_plugin::connection *self,
source_location loc = ctx->get_source_location (filename, line_number);
- decl = build_decl (loc, code, identifier, sym_type);
+ if (code == FUNCTION_DECL)
+ {
+ decl = build_lang_decl (code, identifier, sym_type);
+ DECL_SOURCE_LOCATION (decl) = loc;
+ }
+ else
+ decl = build_decl (loc, code, identifier, sym_type);
TREE_USED (decl) = 1;
TREE_ADDRESSABLE (decl) = 1;