llvm: force strip without libllvm to avoid unimplemented behavior

Also fix deinit bugs.
This commit is contained in:
Jacob Young committed 2023-08-08 23:32:40 -04:00
1 parent 53bea0f7e4
commit 3e1dd93bb2
2 files changed
+21 -6

No files matched your search

+10 -1
View File
@@ -1131,7 +1131,16 @@ void ZigLLVMEraseGlobalValue(LLVMValueRef GlobalVal) {
}
void ZigLLVMDeleteGlobalValue(LLVMValueRef GlobalVal) {
delete unwrap<GlobalVariable>(GlobalVal);
auto *GV = unwrap<GlobalValue>(GlobalVal);
assert(GV->getParent() == nullptr);
switch (GV->getValueID()) {
#define HANDLE_GLOBAL_VALUE(NAME) \
case Value::NAME##Val: \
delete static_cast<NAME *>(GV); \
break;
#include <llvm/IR/Value.def>
default: llvm_unreachable("Expected global value");
}
}
void ZigLLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal) {