llvm: finish converting globals

This commit is contained in:
Jacob Young
2023-08-08 10:15:11 -04:00
parent 2499d8fb73
commit 2bdd180c6f
5 changed files with 984 additions and 788 deletions

View File

@@ -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());
}