mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
llvm: force strip without libllvm to avoid unimplemented behavior
Also fix deinit bugs.
This commit is contained in:
1 parent
53bea0f7e4
commit
3e1dd93bb2
2 files changed
+21
-6
No files matched your search
+10
-1
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user