summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorJeff Muizelaar <jmuizelaar@mozilla.com>2017-10-22 18:38:50 -0400
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-10-24 08:59:31 +0200
commit02dc2bff695ce6c3068ec4f53bb37f92b5873a84 (patch)
treef0725df21c6ad5c2653c0e956585ac03ec9c3d2e /src/codegen/mod.rs
parent8582a90ee76384df63876c879646da0c1555166b (diff)
Store function linkage in the ir
This lets us capture 'static inline' functions in the ir and filter them later down the pipeline. This is the first step on the way to handling these functions better.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index ac28244c..e4928a45 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -20,7 +20,7 @@ use ir::derive::{CanDeriveCopy, CanDeriveDebug, CanDeriveDefault,
CanDerivePartialEq, CanDeriveEq, CannotDeriveReason};
use ir::dot;
use ir::enum_ty::{Enum, EnumVariant, EnumVariantValue};
-use ir::function::{Abi, Function, FunctionSig};
+use ir::function::{Abi, Function, FunctionSig, Linkage};
use ir::int::IntKind;
use ir::item::{IsOpaque, Item, ItemCanonicalName, ItemCanonicalPath};
use ir::item_kind::ItemKind;
@@ -3127,6 +3127,13 @@ impl CodeGenerator for Function {
debug!("<Function as CodeGenerator>::codegen: item = {:?}", item);
debug_assert!(item.is_enabled_for_codegen(ctx));
+ // We can't currently do anything with Internal functions so just
+ // avoid generating anything for them.
+ match self.linkage() {
+ Linkage::Internal => return,
+ Linkage::External => {}
+ }
+
// Similar to static member variables in a class template, we can't
// generate bindings to template functions, because the set of
// instantiations is open ended and we have no way of knowing which