(&self, name: *const c_char, values: &[&'ll Value])
| 179 | } |
| 180 | |
| 181 | fn create_used_variable_impl(&self, name: *const c_char, values: &[&'ll Value]) { |
| 182 | let section = "llvm.metadata\0".as_ptr().cast(); |
| 183 | let array = self.const_array(self.type_ptr_to(self.type_i8()), values); |
| 184 | |
| 185 | unsafe { |
| 186 | trace!( |
| 187 | "Creating LLVM used variable with name `{}` and values:\n{:#?}", |
| 188 | CStr::from_ptr(name).to_str().unwrap(), |
| 189 | values |
| 190 | ); |
| 191 | let g = llvm::LLVMAddGlobal(self.llmod, self.val_ty(array), name); |
| 192 | llvm::LLVMSetInitializer(g, array); |
| 193 | llvm::LLVMRustSetLinkage(g, llvm::Linkage::AppendingLinkage); |
| 194 | llvm::LLVMSetSection(g, section); |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | fn sanitize_global_ident(name: &str) -> String { |
no test coverage detected