Merge pull request #12959 from kcbanner/fix_uwtable

llvm: fix missing unwind info (wrong uwtable attribute value)
This commit is contained in:
Jakub Konka 2022-09-26 23:05:39 +02:00 committed by GitHub
commit 9c2fb6e186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -2572,7 +2572,7 @@ pub const DeclGen = struct {
}
dg.addFnAttr(llvm_fn, "nounwind");
if (comp.unwind_tables) {
dg.addFnAttrString(llvm_fn, "uwtable", "sync");
dg.addFnAttrInt(llvm_fn, "uwtable", 2);
}
if (comp.bin_file.options.skip_linker_dependencies or
comp.bin_file.options.no_builtin)

View File

@ -223,7 +223,7 @@ static ZigLLVM_CallingConv get_llvm_cc(CodeGen *g, CallingConvention cc) {
static void add_uwtable_attr(CodeGen *g, LLVMValueRef fn_val) {
if (g->unwind_tables) {
addLLVMFnAttrStr(fn_val, "uwtable", "sync");
addLLVMFnAttrInt(fn_val, "uwtable", 2);
}
}