diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2025-04-25 05:01:33 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2025-04-25 05:01:33 +0000 |
| commit | 65e76849ac460cebfce6db7d6f3db6b48eeff31d (patch) | |
| tree | 033589cdc25e12f84bf732fc1a3439208d9fee83 /compiler/rustc_codegen_llvm/src/context.rs | |
| parent | 37049558e43e72fa3890aa3f7c23e5f00414444c (diff) | |
| parent | 7018392337a938e25c9ed9190c4f0966737fffdb (diff) | |
| download | rust-65e76849ac460cebfce6db7d6f3db6b48eeff31d.tar.gz rust-65e76849ac460cebfce6db7d6f3db6b48eeff31d.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/context.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/context.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 4ec69995518..ed50515b707 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -698,6 +698,16 @@ impl<'ll, CX: Borrow<SCx<'ll>>> GenericCx<'ll, CX> { llvm::LLVMMDStringInContext2(self.llcx(), name.as_ptr() as *const c_char, name.len()) }) } + + pub(crate) fn get_functions(&self) -> Vec<&'ll Value> { + let mut functions = vec![]; + let mut func = unsafe { llvm::LLVMGetFirstFunction(self.llmod()) }; + while let Some(f) = func { + functions.push(f); + func = unsafe { llvm::LLVMGetNextFunction(f) } + } + functions + } } impl<'ll, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { |
