Skip to main content

Module declare

Module declare 

Source
Expand description

Declare various LLVM values.

Prefer using functions and methods from this module rather than calling LLVM functions directly. These functions do some additional work to ensure we do the right thing given the preconceptions of codegen.

Some useful guidelines:

  • Use declare_* family of methods if you are declaring, but are not interested in defining the Value they return.
  • Use define_* family of methods when you might be defining the Value.
  • When in doubt, define.

Re-exportsยง

use std::borrow::Borrow; ๐Ÿ”’
use itertools::Itertools; ๐Ÿ”’
use rustc_abi::AddressSpace; ๐Ÿ”’
use rustc_codegen_ssa::traits::MiscCodegenMethods; ๐Ÿ”’
use rustc_codegen_ssa::traits::TypeMembershipCodegenMethods; ๐Ÿ”’
use rustc_data_structures::fx::FxIndexSet; ๐Ÿ”’
use rustc_middle::ty::Instance; ๐Ÿ”’
use rustc_middle::ty::Ty; ๐Ÿ”’
use rustc_sanitizers::cfi; ๐Ÿ”’
use rustc_sanitizers::kcfi; ๐Ÿ”’
use rustc_target::callconv::FnAbi; ๐Ÿ”’
use smallvec::SmallVec; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use crate::abi::FnAbiLlvmExt; ๐Ÿ”’
use crate::attributes; ๐Ÿ”’
use crate::context::CodegenCx; ๐Ÿ”’
use crate::context::GenericCx; ๐Ÿ”’
use crate::context::SCx; ๐Ÿ”’
use crate::context::SimpleCx; ๐Ÿ”’
use crate::llvm::AttributePlace::Function; ๐Ÿ”’
use crate::llvm; ๐Ÿ”’
use crate::llvm::FromGeneric; ๐Ÿ”’
use crate::llvm::Type; ๐Ÿ”’
use crate::llvm::Value; ๐Ÿ”’
use crate::llvm::Visibility; ๐Ÿ”’

Functionsยง

declare_raw_fn ๐Ÿ”’
Declare a function.
declare_simple_fn ๐Ÿ”’
Declare a function with a SimpleCx.