diff options
| author | Tshepang Mbambo <tshepang@gmail.com> | 2025-05-01 07:01:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-01 07:01:46 +0200 |
| commit | bf06eaf7a2e8ad08c23a3d8da1255cdcc4174c55 (patch) | |
| tree | a974f5bc634539b226397f38dd8f69c35fbee719 /compiler/rustc_codegen_llvm/src/context.rs | |
| parent | 9ce6c52c707b8d0dba9c0d5c4828cc9443dd8f4c (diff) | |
| parent | 560de7e51225559aa329d296f5ff0e9f95cbdf48 (diff) | |
| download | rust-bf06eaf7a2e8ad08c23a3d8da1255cdcc4174c55.tar.gz rust-bf06eaf7a2e8ad08c23a3d8da1255cdcc4174c55.zip | |
Merge pull request #2367 from rust-lang/rustc-pull
Rustc pull update
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> { |
