aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-base.cc
diff options
context:
space:
mode:
authorliushuyu <liushuyu011@gmail.com>2022-06-11 20:02:54 -0600
committerliushuyu <liushuyu011@gmail.com>2022-06-28 17:54:18 -0600
commit649d3c45afa9c65cad99c8d195e342b3c8bea43c (patch)
tree6d341c9824ead55b0fa10d5920d66d7cadb3d860 /gcc/rust/backend/rust-compile-base.cc
parent04cc46cfe8cad9736ccf2d5c884af50e57b67ce6 (diff)
downloadgcc-649d3c45afa9c65cad99c8d195e342b3c8bea43c.zip
gcc-649d3c45afa9c65cad99c8d195e342b3c8bea43c.tar.gz
gcc-649d3c45afa9c65cad99c8d195e342b3c8bea43c.tar.bz2
rust/backend: scan for any deprecated function calls ...
... and emit warnings using GCC's own deprecation warning system
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.cc')
-rw-r--r--gcc/rust/backend/rust-compile-base.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc
index 335a6d4..066ef43 100644
--- a/gcc/rust/backend/rust-compile-base.cc
+++ b/gcc/rust/backend/rust-compile-base.cc
@@ -209,8 +209,13 @@ HIRCompileBase::handle_deprecated_attribute_on_fndecl (
}
}
- DECL_ATTRIBUTES (fndecl) = tree_cons (get_identifier ("deprecated"), value,
- DECL_ATTRIBUTES (fndecl));
+ if (value)
+ {
+ tree attr_list = build_tree_list (NULL_TREE, value);
+ DECL_ATTRIBUTES (fndecl)
+ = tree_cons (get_identifier ("deprecated"), attr_list,
+ DECL_ATTRIBUTES (fndecl));
+ }
}
void