MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / declare_global

Method declare_global

crates/rustc_codegen_spirv/src/codegen_cx/declare.rs:252–263  ·  view source on GitHub ↗
(&self, span: Span, ty: Word)

Source from the content-addressed store, hash-verified

250 }
251
252 fn declare_global(&self, span: Span, ty: Word) -> SpirvValue {
253 let ptr_ty = SpirvType::Pointer { pointee: ty }.def(span, self);
254 // FIXME(eddyb) figure out what the correct storage class is.
255 let result = self
256 .emit_global()
257 .variable(ptr_ty, None, StorageClass::Private, None)
258 .with_type(ptr_ty);
259 // TODO: These should be StorageClass::Private, so just zombie for now.
260 // FIXME(eddyb) why zombie? this looks like it should just work nowadays.
261 self.zombie_with_span(result.def_cx(self), span, "globals are not supported yet");
262 result
263 }
264}
265
266impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'tcx> {

Callers 2

get_staticMethod · 0.80
predefine_staticMethod · 0.80

Calls 5

with_typeMethod · 0.80
emit_globalMethod · 0.80
zombie_with_spanMethod · 0.80
def_cxMethod · 0.80
defMethod · 0.45

Tested by

no test coverage detected