From f1b64017d044018c649492b75708429749408ed0 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Tue, 30 Dec 2014 17:44:31 +0200 Subject: Feature gate FFI imports of LLVM intrinsics Fixes #20313 --- src/libsyntax/feature_gate.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 4607520655e..8b4074abedc 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -56,6 +56,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("simd", Active), ("default_type_params", Active), ("quote", Active), + ("link_llvm_intrinsics", Active), ("linkage", Active), ("struct_inherit", Removed), @@ -292,6 +293,16 @@ impl<'a, 'v> Visitor<'v> for Context<'a> { "the `linkage` attribute is experimental \ and not portable across platforms") } + + let links_to_llvm = match attr::first_attr_value_str_by_name(i.attrs[], "link_name") { + Some(val) => val.get().starts_with("llvm."), + _ => false + }; + if links_to_llvm { + self.gate_feature("link_llvm_intrinsics", i.span, + "linking to LLVM intrinsics is experimental"); + } + visit::walk_foreign_item(self, i) } -- cgit 1.4.1-3-g733a5