diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-08-08 10:15:11 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2023-08-08 21:32:50 -0400 |
| commit | 2bdd180c6f6c76940ccfe8c8532fefec208661ea (patch) | |
| tree | 95fa180ff9bd13bff056e10ee6048a712f3809c1 /src/zig_llvm.cpp | |
| parent | 2499d8fb73b943640cbc7d0484377fffbee403c6 (diff) | |
| download | zig-2bdd180c6f6c76940ccfe8c8532fefec208661ea.tar.gz zig-2bdd180c6f6c76940ccfe8c8532fefec208661ea.zip | |
llvm: finish converting globals
Diffstat (limited to 'src/zig_llvm.cpp')
| -rw-r--r-- | src/zig_llvm.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index f2b8cf9da5..6dd54d3ae4 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -1122,6 +1122,22 @@ void ZigLLVMTakeName(LLVMValueRef new_owner, LLVMValueRef victim) { unwrap(new_owner)->takeName(unwrap(victim)); } +void ZigLLVMRemoveGlobalValue(LLVMValueRef GlobalVal) { + unwrap<GlobalValue>(GlobalVal)->removeFromParent(); +} + +void ZigLLVMEraseGlobalValue(LLVMValueRef GlobalVal) { + unwrap<GlobalValue>(GlobalVal)->eraseFromParent(); +} + +void ZigLLVMDeleteGlobalValue(LLVMValueRef GlobalVal) { + delete unwrap<GlobalVariable>(GlobalVal); +} + +void ZigLLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal) { + unwrap<GlobalVariable>(GlobalVar)->setInitializer(ConstantVal ? unwrap<Constant>(ConstantVal) : nullptr); +} + ZigLLVMDIGlobalVariable* ZigLLVMGlobalGetVariable(ZigLLVMDIGlobalVariableExpression *global_variable_expression) { return reinterpret_cast<ZigLLVMDIGlobalVariable*>(reinterpret_cast<DIGlobalVariableExpression*>(global_variable_expression)->getVariable()); } |
