Use this when you're building the IR of a function to reference a data object. TODO: Same as above.
(&self, data: DataId, func: &mut ir::Function)
| 921 | /// |
| 922 | /// TODO: Same as above. |
| 923 | fn declare_data_in_func(&self, data: DataId, func: &mut ir::Function) -> ir::GlobalValue { |
| 924 | let decl = &self.declarations().data_objects[data]; |
| 925 | let colocated = decl.linkage.is_final(); |
| 926 | let user_name_ref = func.declare_imported_user_function(ir::UserExternalName { |
| 927 | namespace: 1, |
| 928 | index: data.as_u32(), |
| 929 | }); |
| 930 | func.create_global_value(ir::GlobalValueData::Symbol { |
| 931 | name: ir::ExternalName::user(user_name_ref), |
| 932 | offset: ir::immediates::Imm64::new(0), |
| 933 | colocated, |
| 934 | tls: decl.tls, |
| 935 | }) |
| 936 | } |
| 937 | |
| 938 | /// TODO: Same as above. |
| 939 | fn declare_func_in_data(&self, func_id: FuncId, data: &mut DataDescription) -> ir::FuncRef { |
nothing calls this directly
no test coverage detected