diff options
| author | The rustc-dev-guide Cronjob Bot <github-actions@github.com> | 2025-05-01 04:05:49 +0000 |
|---|---|---|
| committer | The rustc-dev-guide Cronjob Bot <github-actions@github.com> | 2025-05-01 04:05:49 +0000 |
| commit | 560de7e51225559aa329d296f5ff0e9f95cbdf48 (patch) | |
| tree | e0389ca43c9774070bd6259df2f482f863e6a243 /compiler/rustc_codegen_llvm/src/context.rs | |
| parent | 27eb27423382738ae8f6d3d40a96396c7c541a37 (diff) | |
| parent | 0c33fe2c3d3eecadd17a84b110bb067288a64f1c (diff) | |
| download | rust-560de7e51225559aa329d296f5ff0e9f95cbdf48.tar.gz rust-560de7e51225559aa329d296f5ff0e9f95cbdf48.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> { |
