| author | |
| committer | |
| log | 1fa4d2a5afd35ebb58c84ea030046fc557ffad01 |
| tree | 0835d834877cb84d0ec39d38dd3afaa484c234f3 |
| parent | 077cd4b9a46d431b09698554d321d7dad1bca8ca |
7 files changed, 329 insertions(+), 329 deletions(-)
src/all_types.hpp+7-7| ... | @@ -1015,7 +1015,7 @@ struct TypeTableEntry { | ... | @@ -1015,7 +1015,7 @@ struct TypeTableEntry { |
| 1015 | Buf name; | 1015 | Buf name; |
| 1016 | 1016 | ||
| 1017 | LLVMTypeRef type_ref; | 1017 | LLVMTypeRef type_ref; |
| 1018 | LLVMZigDIType *di_type; | 1018 | ZigLLVMDIType *di_type; |
| 1019 | 1019 | ||
| 1020 | bool zero_bits; | 1020 | bool zero_bits; |
| 1021 | bool deep_const; | 1021 | bool deep_const; |
| ... | @@ -1055,7 +1055,7 @@ struct ImportTableEntry { | ... | @@ -1055,7 +1055,7 @@ struct ImportTableEntry { |
| 1055 | AstNode *root; | 1055 | AstNode *root; |
| 1056 | Buf *path; // relative to root_package->root_src_dir | 1056 | Buf *path; // relative to root_package->root_src_dir |
| 1057 | PackageTableEntry *package; | 1057 | PackageTableEntry *package; |
| 1058 | LLVMZigDIFile *di_file; | 1058 | ZigLLVMDIFile *di_file; |
| 1059 | Buf *source_code; | 1059 | Buf *source_code; |
| 1060 | ZigList<int> *line_offsets; | 1060 | ZigList<int> *line_offsets; |
| 1061 | BlockContext *block_context; | 1061 | BlockContext *block_context; |
| ... | @@ -1190,8 +1190,8 @@ struct CodeGen { | ... | @@ -1190,8 +1190,8 @@ struct CodeGen { |
| 1190 | LLVMModuleRef module; | 1190 | LLVMModuleRef module; |
| 1191 | ZigList<ErrorMsg*> errors; | 1191 | ZigList<ErrorMsg*> errors; |
| 1192 | LLVMBuilderRef builder; | 1192 | LLVMBuilderRef builder; |
| 1193 | LLVMZigDIBuilder *dbuilder; | 1193 | ZigLLVMDIBuilder *dbuilder; |
| 1194 | LLVMZigDICompileUnit *compile_unit; | 1194 | ZigLLVMDICompileUnit *compile_unit; |
| 1195 | 1195 | ||
| 1196 | ZigList<Buf *> link_libs; // non-libc link libs | 1196 | ZigList<Buf *> link_libs; // non-libc link libs |
| 1197 | 1197 | ||
| ... | @@ -1271,7 +1271,7 @@ struct CodeGen { | ... | @@ -1271,7 +1271,7 @@ struct CodeGen { |
| 1271 | uint32_t target_environ_index; | 1271 | uint32_t target_environ_index; |
| 1272 | uint32_t target_oformat_index; | 1272 | uint32_t target_oformat_index; |
| 1273 | LLVMTargetMachineRef target_machine; | 1273 | LLVMTargetMachineRef target_machine; |
| 1274 | LLVMZigDIFile *dummy_di_file; | 1274 | ZigLLVMDIFile *dummy_di_file; |
| 1275 | bool is_native_target; | 1275 | bool is_native_target; |
| 1276 | PackageTableEntry *root_package; | 1276 | PackageTableEntry *root_package; |
| 1277 | PackageTableEntry *std_package; | 1277 | PackageTableEntry *std_package; |
| ... | @@ -1341,7 +1341,7 @@ struct VariableTableEntry { | ... | @@ -1341,7 +1341,7 @@ struct VariableTableEntry { |
| 1341 | AstNode *decl_node; | 1341 | AstNode *decl_node; |
| 1342 | // which node contains the ConstExprValue for this variable's value | 1342 | // which node contains the ConstExprValue for this variable's value |
| 1343 | AstNode *val_node; | 1343 | AstNode *val_node; |
| 1344 | LLVMZigDILocalVariable *di_loc_var; | 1344 | ZigLLVMDILocalVariable *di_loc_var; |
| 1345 | int src_arg_index; | 1345 | int src_arg_index; |
| 1346 | int gen_arg_index; | 1346 | int gen_arg_index; |
| 1347 | BlockContext *block_context; | 1347 | BlockContext *block_context; |
| ... | @@ -1383,7 +1383,7 @@ struct BlockContext { | ... | @@ -1383,7 +1383,7 @@ struct BlockContext { |
| 1383 | // it would pertain to | 1383 | // it would pertain to |
| 1384 | AstNode *parent_loop_node; | 1384 | AstNode *parent_loop_node; |
| 1385 | 1385 | ||
| 1386 | LLVMZigDIScope *di_scope; | 1386 | ZigLLVMDIScope *di_scope; |
| 1387 | Buf *c_import_buf; | 1387 | Buf *c_import_buf; |
| 1388 | 1388 | ||
| 1389 | // if this is true, then this code will not be generated | 1389 | // if this is true, then this code will not be generated |
src/analyze.cpp+68-68| ... | @@ -312,7 +312,7 @@ TypeTableEntry *get_pointer_to_type(CodeGen *g, TypeTableEntry *child_type, bool | ... | @@ -312,7 +312,7 @@ TypeTableEntry *get_pointer_to_type(CodeGen *g, TypeTableEntry *child_type, bool |
| 312 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 312 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 313 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 313 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 314 | assert(child_type->di_type); | 314 | assert(child_type->di_type); |
| 315 | entry->di_type = LLVMZigCreateDebugPointerType(g->dbuilder, child_type->di_type, | 315 | entry->di_type = ZigLLVMCreateDebugPointerType(g->dbuilder, child_type->di_type, |
| 316 | debug_size_in_bits, debug_align_in_bits, buf_ptr(&entry->name)); | 316 | debug_size_in_bits, debug_align_in_bits, buf_ptr(&entry->name)); |
| 317 | } | 317 | } |
| 318 | 318 | ||
| ... | @@ -355,11 +355,11 @@ TypeTableEntry *get_maybe_type(CodeGen *g, TypeTableEntry *child_type) { | ... | @@ -355,11 +355,11 @@ TypeTableEntry *get_maybe_type(CodeGen *g, TypeTableEntry *child_type) { |
| 355 | entry->type_ref = LLVMStructType(elem_types, 2, false); | 355 | entry->type_ref = LLVMStructType(elem_types, 2, false); |
| 356 | 356 | ||
| 357 | 357 | ||
| 358 | LLVMZigDIScope *compile_unit_scope = LLVMZigCompileUnitToScope(g->compile_unit); | 358 | ZigLLVMDIScope *compile_unit_scope = ZigLLVMCompileUnitToScope(g->compile_unit); |
| 359 | LLVMZigDIFile *di_file = nullptr; | 359 | ZigLLVMDIFile *di_file = nullptr; |
| 360 | unsigned line = 0; | 360 | unsigned line = 0; |
| 361 | entry->di_type = LLVMZigCreateReplaceableCompositeType(g->dbuilder, | 361 | entry->di_type = ZigLLVMCreateReplaceableCompositeType(g->dbuilder, |
| 362 | LLVMZigTag_DW_structure_type(), buf_ptr(&entry->name), | 362 | ZigLLVMTag_DW_structure_type(), buf_ptr(&entry->name), |
| 363 | compile_unit_scope, di_file, line); | 363 | compile_unit_scope, di_file, line); |
| 364 | 364 | ||
| 365 | uint64_t val_debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, child_type->type_ref); | 365 | uint64_t val_debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, child_type->type_ref); |
| ... | @@ -374,27 +374,27 @@ TypeTableEntry *get_maybe_type(CodeGen *g, TypeTableEntry *child_type) { | ... | @@ -374,27 +374,27 @@ TypeTableEntry *get_maybe_type(CodeGen *g, TypeTableEntry *child_type) { |
| 374 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 374 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 375 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 375 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 376 | 376 | ||
| 377 | LLVMZigDIType *di_element_types[] = { | 377 | ZigLLVMDIType *di_element_types[] = { |
| 378 | LLVMZigCreateDebugMemberType(g->dbuilder, LLVMZigTypeToScope(entry->di_type), | 378 | ZigLLVMCreateDebugMemberType(g->dbuilder, ZigLLVMTypeToScope(entry->di_type), |
| 379 | "val", di_file, line, | 379 | "val", di_file, line, |
| 380 | val_debug_size_in_bits, | 380 | val_debug_size_in_bits, |
| 381 | val_debug_align_in_bits, | 381 | val_debug_align_in_bits, |
| 382 | val_offset_in_bits, | 382 | val_offset_in_bits, |
| 383 | 0, child_type->di_type), | 383 | 0, child_type->di_type), |
| 384 | LLVMZigCreateDebugMemberType(g->dbuilder, LLVMZigTypeToScope(entry->di_type), | 384 | ZigLLVMCreateDebugMemberType(g->dbuilder, ZigLLVMTypeToScope(entry->di_type), |
| 385 | "maybe", di_file, line, | 385 | "maybe", di_file, line, |
| 386 | maybe_debug_size_in_bits, | 386 | maybe_debug_size_in_bits, |
| 387 | maybe_debug_align_in_bits, | 387 | maybe_debug_align_in_bits, |
| 388 | maybe_offset_in_bits, | 388 | maybe_offset_in_bits, |
| 389 | 0, child_type->di_type), | 389 | 0, child_type->di_type), |
| 390 | }; | 390 | }; |
| 391 | LLVMZigDIType *replacement_di_type = LLVMZigCreateDebugStructType(g->dbuilder, | 391 | ZigLLVMDIType *replacement_di_type = ZigLLVMCreateDebugStructType(g->dbuilder, |
| 392 | compile_unit_scope, | 392 | compile_unit_scope, |
| 393 | buf_ptr(&entry->name), | 393 | buf_ptr(&entry->name), |
| 394 | di_file, line, debug_size_in_bits, debug_align_in_bits, 0, | 394 | di_file, line, debug_size_in_bits, debug_align_in_bits, 0, |
| 395 | nullptr, di_element_types, 2, 0, nullptr, ""); | 395 | nullptr, di_element_types, 2, 0, nullptr, ""); |
| 396 | 396 | ||
| 397 | LLVMZigReplaceTemporary(g->dbuilder, entry->di_type, replacement_di_type); | 397 | ZigLLVMReplaceTemporary(g->dbuilder, entry->di_type, replacement_di_type); |
| 398 | entry->di_type = replacement_di_type; | 398 | entry->di_type = replacement_di_type; |
| 399 | } | 399 | } |
| 400 | 400 | ||
| ... | @@ -431,11 +431,11 @@ static TypeTableEntry *get_error_type(CodeGen *g, TypeTableEntry *child_type) { | ... | @@ -431,11 +431,11 @@ static TypeTableEntry *get_error_type(CodeGen *g, TypeTableEntry *child_type) { |
| 431 | }; | 431 | }; |
| 432 | entry->type_ref = LLVMStructType(elem_types, 2, false); | 432 | entry->type_ref = LLVMStructType(elem_types, 2, false); |
| 433 | 433 | ||
| 434 | LLVMZigDIScope *compile_unit_scope = LLVMZigCompileUnitToScope(g->compile_unit); | 434 | ZigLLVMDIScope *compile_unit_scope = ZigLLVMCompileUnitToScope(g->compile_unit); |
| 435 | LLVMZigDIFile *di_file = nullptr; | 435 | ZigLLVMDIFile *di_file = nullptr; |
| 436 | unsigned line = 0; | 436 | unsigned line = 0; |
| 437 | entry->di_type = LLVMZigCreateReplaceableCompositeType(g->dbuilder, | 437 | entry->di_type = ZigLLVMCreateReplaceableCompositeType(g->dbuilder, |
| 438 | LLVMZigTag_DW_structure_type(), buf_ptr(&entry->name), | 438 | ZigLLVMTag_DW_structure_type(), buf_ptr(&entry->name), |
| 439 | compile_unit_scope, di_file, line); | 439 | compile_unit_scope, di_file, line); |
| 440 | 440 | ||
| 441 | uint64_t tag_debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, g->err_tag_type->type_ref); | 441 | uint64_t tag_debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, g->err_tag_type->type_ref); |
| ... | @@ -449,14 +449,14 @@ static TypeTableEntry *get_error_type(CodeGen *g, TypeTableEntry *child_type) { | ... | @@ -449,14 +449,14 @@ static TypeTableEntry *get_error_type(CodeGen *g, TypeTableEntry *child_type) { |
| 449 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 449 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 450 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 450 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 451 | 451 | ||
| 452 | LLVMZigDIType *di_element_types[] = { | 452 | ZigLLVMDIType *di_element_types[] = { |
| 453 | LLVMZigCreateDebugMemberType(g->dbuilder, LLVMZigTypeToScope(entry->di_type), | 453 | ZigLLVMCreateDebugMemberType(g->dbuilder, ZigLLVMTypeToScope(entry->di_type), |
| 454 | "tag", di_file, line, | 454 | "tag", di_file, line, |
| 455 | tag_debug_size_in_bits, | 455 | tag_debug_size_in_bits, |
| 456 | tag_debug_align_in_bits, | 456 | tag_debug_align_in_bits, |
| 457 | tag_offset_in_bits, | 457 | tag_offset_in_bits, |
| 458 | 0, child_type->di_type), | 458 | 0, child_type->di_type), |
| 459 | LLVMZigCreateDebugMemberType(g->dbuilder, LLVMZigTypeToScope(entry->di_type), | 459 | ZigLLVMCreateDebugMemberType(g->dbuilder, ZigLLVMTypeToScope(entry->di_type), |
| 460 | "value", di_file, line, | 460 | "value", di_file, line, |
| 461 | value_debug_size_in_bits, | 461 | value_debug_size_in_bits, |
| 462 | value_debug_align_in_bits, | 462 | value_debug_align_in_bits, |
| ... | @@ -464,7 +464,7 @@ static TypeTableEntry *get_error_type(CodeGen *g, TypeTableEntry *child_type) { | ... | @@ -464,7 +464,7 @@ static TypeTableEntry *get_error_type(CodeGen *g, TypeTableEntry *child_type) { |
| 464 | 0, child_type->di_type), | 464 | 0, child_type->di_type), |
| 465 | }; | 465 | }; |
| 466 | 466 | ||
| 467 | LLVMZigDIType *replacement_di_type = LLVMZigCreateDebugStructType(g->dbuilder, | 467 | ZigLLVMDIType *replacement_di_type = ZigLLVMCreateDebugStructType(g->dbuilder, |
| 468 | compile_unit_scope, | 468 | compile_unit_scope, |
| 469 | buf_ptr(&entry->name), | 469 | buf_ptr(&entry->name), |
| 470 | di_file, line, | 470 | di_file, line, |
| ... | @@ -473,7 +473,7 @@ static TypeTableEntry *get_error_type(CodeGen *g, TypeTableEntry *child_type) { | ... | @@ -473,7 +473,7 @@ static TypeTableEntry *get_error_type(CodeGen *g, TypeTableEntry *child_type) { |
| 473 | 0, | 473 | 0, |
| 474 | nullptr, di_element_types, 2, 0, nullptr, ""); | 474 | nullptr, di_element_types, 2, 0, nullptr, ""); |
| 475 | 475 | ||
| 476 | LLVMZigReplaceTemporary(g->dbuilder, entry->di_type, replacement_di_type); | 476 | ZigLLVMReplaceTemporary(g->dbuilder, entry->di_type, replacement_di_type); |
| 477 | entry->di_type = replacement_di_type; | 477 | entry->di_type = replacement_di_type; |
| 478 | } | 478 | } |
| 479 | 479 | ||
| ... | @@ -500,7 +500,7 @@ TypeTableEntry *get_array_type(CodeGen *g, TypeTableEntry *child_type, uint64_t | ... | @@ -500,7 +500,7 @@ TypeTableEntry *get_array_type(CodeGen *g, TypeTableEntry *child_type, uint64_t |
| 500 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 500 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 501 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 501 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 502 | 502 | ||
| 503 | entry->di_type = LLVMZigCreateDebugArrayType(g->dbuilder, debug_size_in_bits, | 503 | entry->di_type = ZigLLVMCreateDebugArrayType(g->dbuilder, debug_size_in_bits, |
| 504 | debug_align_in_bits, child_type->di_type, array_size); | 504 | debug_align_in_bits, child_type->di_type, array_size); |
| 505 | } | 505 | } |
| 506 | entry->data.array.child_type = child_type; | 506 | entry->data.array.child_type = child_type; |
| ... | @@ -562,11 +562,11 @@ TypeTableEntry *get_slice_type(CodeGen *g, TypeTableEntry *child_type, bool is_c | ... | @@ -562,11 +562,11 @@ TypeTableEntry *get_slice_type(CodeGen *g, TypeTableEntry *child_type, bool is_c |
| 562 | buf_appendf(&entry->name, "[]%s", buf_ptr(&child_type->name)); | 562 | buf_appendf(&entry->name, "[]%s", buf_ptr(&child_type->name)); |
| 563 | entry->type_ref = LLVMStructCreateNamed(LLVMGetGlobalContext(), buf_ptr(&entry->name)); | 563 | entry->type_ref = LLVMStructCreateNamed(LLVMGetGlobalContext(), buf_ptr(&entry->name)); |
| 564 | 564 | ||
| 565 | LLVMZigDIScope *compile_unit_scope = LLVMZigCompileUnitToScope(g->compile_unit); | 565 | ZigLLVMDIScope *compile_unit_scope = ZigLLVMCompileUnitToScope(g->compile_unit); |
| 566 | LLVMZigDIFile *di_file = nullptr; | 566 | ZigLLVMDIFile *di_file = nullptr; |
| 567 | unsigned line = 0; | 567 | unsigned line = 0; |
| 568 | entry->di_type = LLVMZigCreateReplaceableCompositeType(g->dbuilder, | 568 | entry->di_type = ZigLLVMCreateReplaceableCompositeType(g->dbuilder, |
| 569 | LLVMZigTag_DW_structure_type(), buf_ptr(&entry->name), | 569 | ZigLLVMTag_DW_structure_type(), buf_ptr(&entry->name), |
| 570 | compile_unit_scope, di_file, line); | 570 | compile_unit_scope, di_file, line); |
| 571 | 571 | ||
| 572 | if (child_type->zero_bits) { | 572 | if (child_type->zero_bits) { |
| ... | @@ -589,21 +589,21 @@ TypeTableEntry *get_slice_type(CodeGen *g, TypeTableEntry *child_type, bool is_c | ... | @@ -589,21 +589,21 @@ TypeTableEntry *get_slice_type(CodeGen *g, TypeTableEntry *child_type, bool is_c |
| 589 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 589 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 590 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 590 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 591 | 591 | ||
| 592 | LLVMZigDIType *di_element_types[] = { | 592 | ZigLLVMDIType *di_element_types[] = { |
| 593 | LLVMZigCreateDebugMemberType(g->dbuilder, LLVMZigTypeToScope(entry->di_type), | 593 | ZigLLVMCreateDebugMemberType(g->dbuilder, ZigLLVMTypeToScope(entry->di_type), |
| 594 | "len", di_file, line, | 594 | "len", di_file, line, |
| 595 | len_debug_size_in_bits, | 595 | len_debug_size_in_bits, |
| 596 | len_debug_align_in_bits, | 596 | len_debug_align_in_bits, |
| 597 | len_offset_in_bits, | 597 | len_offset_in_bits, |
| 598 | 0, usize_type->di_type), | 598 | 0, usize_type->di_type), |
| 599 | }; | 599 | }; |
| 600 | LLVMZigDIType *replacement_di_type = LLVMZigCreateDebugStructType(g->dbuilder, | 600 | ZigLLVMDIType *replacement_di_type = ZigLLVMCreateDebugStructType(g->dbuilder, |
| 601 | compile_unit_scope, | 601 | compile_unit_scope, |
| 602 | buf_ptr(&entry->name), | 602 | buf_ptr(&entry->name), |
| 603 | di_file, line, debug_size_in_bits, debug_align_in_bits, 0, | 603 | di_file, line, debug_size_in_bits, debug_align_in_bits, 0, |
| 604 | nullptr, di_element_types, 1, 0, nullptr, ""); | 604 | nullptr, di_element_types, 1, 0, nullptr, ""); |
| 605 | 605 | ||
| 606 | LLVMZigReplaceTemporary(g->dbuilder, entry->di_type, replacement_di_type); | 606 | ZigLLVMReplaceTemporary(g->dbuilder, entry->di_type, replacement_di_type); |
| 607 | entry->di_type = replacement_di_type; | 607 | entry->di_type = replacement_di_type; |
| 608 | } else { | 608 | } else { |
| 609 | TypeTableEntry *pointer_type = get_pointer_to_type(g, child_type, is_const); | 609 | TypeTableEntry *pointer_type = get_pointer_to_type(g, child_type, is_const); |
| ... | @@ -630,27 +630,27 @@ TypeTableEntry *get_slice_type(CodeGen *g, TypeTableEntry *child_type, bool is_c | ... | @@ -630,27 +630,27 @@ TypeTableEntry *get_slice_type(CodeGen *g, TypeTableEntry *child_type, bool is_c |
| 630 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 630 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 631 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 631 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 632 | 632 | ||
| 633 | LLVMZigDIType *di_element_types[] = { | 633 | ZigLLVMDIType *di_element_types[] = { |
| 634 | LLVMZigCreateDebugMemberType(g->dbuilder, LLVMZigTypeToScope(entry->di_type), | 634 | ZigLLVMCreateDebugMemberType(g->dbuilder, ZigLLVMTypeToScope(entry->di_type), |
| 635 | "ptr", di_file, line, | 635 | "ptr", di_file, line, |
| 636 | ptr_debug_size_in_bits, | 636 | ptr_debug_size_in_bits, |
| 637 | ptr_debug_align_in_bits, | 637 | ptr_debug_align_in_bits, |
| 638 | ptr_offset_in_bits, | 638 | ptr_offset_in_bits, |
| 639 | 0, pointer_type->di_type), | 639 | 0, pointer_type->di_type), |
| 640 | LLVMZigCreateDebugMemberType(g->dbuilder, LLVMZigTypeToScope(entry->di_type), | 640 | ZigLLVMCreateDebugMemberType(g->dbuilder, ZigLLVMTypeToScope(entry->di_type), |
| 641 | "len", di_file, line, | 641 | "len", di_file, line, |
| 642 | len_debug_size_in_bits, | 642 | len_debug_size_in_bits, |
| 643 | len_debug_align_in_bits, | 643 | len_debug_align_in_bits, |
| 644 | len_offset_in_bits, | 644 | len_offset_in_bits, |
| 645 | 0, usize_type->di_type), | 645 | 0, usize_type->di_type), |
| 646 | }; | 646 | }; |
| 647 | LLVMZigDIType *replacement_di_type = LLVMZigCreateDebugStructType(g->dbuilder, | 647 | ZigLLVMDIType *replacement_di_type = ZigLLVMCreateDebugStructType(g->dbuilder, |
| 648 | compile_unit_scope, | 648 | compile_unit_scope, |
| 649 | buf_ptr(&entry->name), | 649 | buf_ptr(&entry->name), |
| 650 | di_file, line, debug_size_in_bits, debug_align_in_bits, 0, | 650 | di_file, line, debug_size_in_bits, debug_align_in_bits, 0, |
| 651 | nullptr, di_element_types, 2, 0, nullptr, ""); | 651 | nullptr, di_element_types, 2, 0, nullptr, ""); |
| 652 | 652 | ||
| 653 | LLVMZigReplaceTemporary(g->dbuilder, entry->di_type, replacement_di_type); | 653 | ZigLLVMReplaceTemporary(g->dbuilder, entry->di_type, replacement_di_type); |
| 654 | entry->di_type = replacement_di_type; | 654 | entry->di_type = replacement_di_type; |
| 655 | } | 655 | } |
| 656 | 656 | ||
| ... | @@ -736,7 +736,7 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id, bool gen_debug_inf | ... | @@ -736,7 +736,7 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id, bool gen_debug_inf |
| 736 | // +1 for maybe making the first argument the return value | 736 | // +1 for maybe making the first argument the return value |
| 737 | LLVMTypeRef *gen_param_types = allocate<LLVMTypeRef>(1 + fn_type_id->param_count); | 737 | LLVMTypeRef *gen_param_types = allocate<LLVMTypeRef>(1 + fn_type_id->param_count); |
| 738 | // +1 because 0 is the return type and +1 for maybe making first arg ret val | 738 | // +1 because 0 is the return type and +1 for maybe making first arg ret val |
| 739 | LLVMZigDIType **param_di_types = allocate<LLVMZigDIType*>(2 + fn_type_id->param_count); | 739 | ZigLLVMDIType **param_di_types = allocate<ZigLLVMDIType*>(2 + fn_type_id->param_count); |
| 740 | param_di_types[0] = fn_type_id->return_type->di_type; | 740 | param_di_types[0] = fn_type_id->return_type->di_type; |
| 741 | int gen_param_index = 0; | 741 | int gen_param_index = 0; |
| 742 | TypeTableEntry *gen_return_type; | 742 | TypeTableEntry *gen_return_type; |
| ... | @@ -788,7 +788,7 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id, bool gen_debug_inf | ... | @@ -788,7 +788,7 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id, bool gen_debug_inf |
| 788 | fn_type->data.fn.raw_type_ref = LLVMFunctionType(gen_return_type->type_ref, | 788 | fn_type->data.fn.raw_type_ref = LLVMFunctionType(gen_return_type->type_ref, |
| 789 | gen_param_types, gen_param_index, fn_type_id->is_var_args); | 789 | gen_param_types, gen_param_index, fn_type_id->is_var_args); |
| 790 | fn_type->type_ref = LLVMPointerType(fn_type->data.fn.raw_type_ref, 0); | 790 | fn_type->type_ref = LLVMPointerType(fn_type->data.fn.raw_type_ref, 0); |
| 791 | fn_type->di_type = LLVMZigCreateSubroutineType(g->dbuilder, param_di_types, gen_param_index + 1, 0); | 791 | fn_type->di_type = ZigLLVMCreateSubroutineType(g->dbuilder, param_di_types, gen_param_index + 1, 0); |
| 792 | } | 792 | } |
| 793 | 793 | ||
| 794 | g->fn_type_table.put(&fn_type->data.fn.fn_type_id, fn_type); | 794 | g->fn_type_table.put(&fn_type->data.fn.fn_type_id, fn_type); |
| ... | @@ -829,9 +829,9 @@ TypeTableEntry *get_partial_container_type(CodeGen *g, ImportTableEntry *import, | ... | @@ -829,9 +829,9 @@ TypeTableEntry *get_partial_container_type(CodeGen *g, ImportTableEntry *import, |
| 829 | unsigned line = decl_node ? decl_node->line : 0; | 829 | unsigned line = decl_node ? decl_node->line : 0; |
| 830 | 830 | ||
| 831 | entry->type_ref = LLVMStructCreateNamed(LLVMGetGlobalContext(), name); | 831 | entry->type_ref = LLVMStructCreateNamed(LLVMGetGlobalContext(), name); |
| 832 | entry->di_type = LLVMZigCreateReplaceableCompositeType(g->dbuilder, | 832 | entry->di_type = ZigLLVMCreateReplaceableCompositeType(g->dbuilder, |
| 833 | LLVMZigTag_DW_structure_type(), name, | 833 | ZigLLVMTag_DW_structure_type(), name, |
| 834 | LLVMZigFileToScope(import->di_file), import->di_file, line + 1); | 834 | ZigLLVMFileToScope(import->di_file), import->di_file, line + 1); |
| 835 | 835 | ||
| 836 | buf_init_from_str(&entry->name, name); | 836 | buf_init_from_str(&entry->name, name); |
| 837 | 837 | ||
| ... | @@ -1262,13 +1262,13 @@ static void resolve_function_proto(CodeGen *g, AstNode *node, FnTableEntry *fn_t | ... | @@ -1262,13 +1262,13 @@ static void resolve_function_proto(CodeGen *g, AstNode *node, FnTableEntry *fn_t |
| 1262 | bool is_definition = fn_table_entry->fn_def_node != nullptr; | 1262 | bool is_definition = fn_table_entry->fn_def_node != nullptr; |
| 1263 | unsigned flags = 0; | 1263 | unsigned flags = 0; |
| 1264 | bool is_optimized = g->is_release_build; | 1264 | bool is_optimized = g->is_release_build; |
| 1265 | LLVMZigDISubprogram *subprogram = LLVMZigCreateFunction(g->dbuilder, | 1265 | ZigLLVMDISubprogram *subprogram = ZigLLVMCreateFunction(g->dbuilder, |
| 1266 | containing_context->di_scope, buf_ptr(&fn_table_entry->symbol_name), "", | 1266 | containing_context->di_scope, buf_ptr(&fn_table_entry->symbol_name), "", |
| 1267 | import->di_file, line_number, | 1267 | import->di_file, line_number, |
| 1268 | fn_type->di_type, fn_table_entry->internal_linkage, | 1268 | fn_type->di_type, fn_table_entry->internal_linkage, |
| 1269 | is_definition, scope_line, flags, is_optimized, nullptr); | 1269 | is_definition, scope_line, flags, is_optimized, nullptr); |
| 1270 | 1270 | ||
| 1271 | fn_table_entry->fn_def_node->data.fn_def.block_context->di_scope = LLVMZigSubprogramToScope(subprogram); | 1271 | fn_table_entry->fn_def_node->data.fn_def.block_context->di_scope = ZigLLVMSubprogramToScope(subprogram); |
| 1272 | ZigLLVMFnSetSubprogram(fn_table_entry->fn_value, subprogram); | 1272 | ZigLLVMFnSetSubprogram(fn_table_entry->fn_value, subprogram); |
| 1273 | } | 1273 | } |
| 1274 | } | 1274 | } |
| ... | @@ -1302,11 +1302,11 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt | ... | @@ -1302,11 +1302,11 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt |
| 1302 | 1302 | ||
| 1303 | enum_type->data.enumeration.field_count = field_count; | 1303 | enum_type->data.enumeration.field_count = field_count; |
| 1304 | enum_type->data.enumeration.fields = allocate<TypeEnumField>(field_count); | 1304 | enum_type->data.enumeration.fields = allocate<TypeEnumField>(field_count); |
| 1305 | LLVMZigDIEnumerator **di_enumerators = allocate<LLVMZigDIEnumerator*>(field_count); | 1305 | ZigLLVMDIEnumerator **di_enumerators = allocate<ZigLLVMDIEnumerator*>(field_count); |
| 1306 | 1306 | ||
| 1307 | // we possibly allocate too much here since gen_field_count can be lower than field_count. | 1307 | // we possibly allocate too much here since gen_field_count can be lower than field_count. |
| 1308 | // the only problem is potential wasted space though. | 1308 | // the only problem is potential wasted space though. |
| 1309 | LLVMZigDIType **union_inner_di_types = allocate<LLVMZigDIType*>(field_count); | 1309 | ZigLLVMDIType **union_inner_di_types = allocate<ZigLLVMDIType*>(field_count); |
| 1310 | 1310 | ||
| 1311 | TypeTableEntry *biggest_union_member = nullptr; | 1311 | TypeTableEntry *biggest_union_member = nullptr; |
| 1312 | uint64_t biggest_align_in_bits = 0; | 1312 | uint64_t biggest_align_in_bits = 0; |
| ... | @@ -1332,7 +1332,7 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt | ... | @@ -1332,7 +1332,7 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt |
| 1332 | } | 1332 | } |
| 1333 | 1333 | ||
| 1334 | 1334 | ||
| 1335 | di_enumerators[i] = LLVMZigCreateDebugEnumerator(g->dbuilder, buf_ptr(type_enum_field->name), i); | 1335 | di_enumerators[i] = ZigLLVMCreateDebugEnumerator(g->dbuilder, buf_ptr(type_enum_field->name), i); |
| 1336 | 1336 | ||
| 1337 | if (field_type->id == TypeTableEntryIdStruct) { | 1337 | if (field_type->id == TypeTableEntryIdStruct) { |
| 1338 | resolve_struct_type(g, import, field_type); | 1338 | resolve_struct_type(g, import, field_type); |
| ... | @@ -1348,8 +1348,8 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt | ... | @@ -1348,8 +1348,8 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt |
| 1348 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, field_type->type_ref); | 1348 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, field_type->type_ref); |
| 1349 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, field_type->type_ref); | 1349 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, field_type->type_ref); |
| 1350 | 1350 | ||
| 1351 | union_inner_di_types[gen_field_index] = LLVMZigCreateDebugMemberType(g->dbuilder, | 1351 | union_inner_di_types[gen_field_index] = ZigLLVMCreateDebugMemberType(g->dbuilder, |
| 1352 | LLVMZigTypeToScope(enum_type->di_type), buf_ptr(type_enum_field->name), | 1352 | ZigLLVMTypeToScope(enum_type->di_type), buf_ptr(type_enum_field->name), |
| 1353 | import->di_file, field_node->line + 1, | 1353 | import->di_file, field_node->line + 1, |
| 1354 | debug_size_in_bits, | 1354 | debug_size_in_bits, |
| 1355 | debug_align_in_bits, | 1355 | debug_align_in_bits, |
| ... | @@ -1394,21 +1394,21 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt | ... | @@ -1394,21 +1394,21 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt |
| 1394 | // create debug type for tag | 1394 | // create debug type for tag |
| 1395 | uint64_t tag_debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, tag_type_entry->type_ref); | 1395 | uint64_t tag_debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, tag_type_entry->type_ref); |
| 1396 | uint64_t tag_debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, tag_type_entry->type_ref); | 1396 | uint64_t tag_debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, tag_type_entry->type_ref); |
| 1397 | LLVMZigDIType *tag_di_type = LLVMZigCreateDebugEnumerationType(g->dbuilder, | 1397 | ZigLLVMDIType *tag_di_type = ZigLLVMCreateDebugEnumerationType(g->dbuilder, |
| 1398 | LLVMZigTypeToScope(enum_type->di_type), "AnonEnum", import->di_file, decl_node->line + 1, | 1398 | ZigLLVMTypeToScope(enum_type->di_type), "AnonEnum", import->di_file, decl_node->line + 1, |
| 1399 | tag_debug_size_in_bits, tag_debug_align_in_bits, di_enumerators, field_count, | 1399 | tag_debug_size_in_bits, tag_debug_align_in_bits, di_enumerators, field_count, |
| 1400 | tag_type_entry->di_type, ""); | 1400 | tag_type_entry->di_type, ""); |
| 1401 | 1401 | ||
| 1402 | // create debug type for union | 1402 | // create debug type for union |
| 1403 | LLVMZigDIType *union_di_type = LLVMZigCreateDebugUnionType(g->dbuilder, | 1403 | ZigLLVMDIType *union_di_type = ZigLLVMCreateDebugUnionType(g->dbuilder, |
| 1404 | LLVMZigTypeToScope(enum_type->di_type), "AnonUnion", import->di_file, decl_node->line + 1, | 1404 | ZigLLVMTypeToScope(enum_type->di_type), "AnonUnion", import->di_file, decl_node->line + 1, |
| 1405 | biggest_union_member_size_in_bits, biggest_align_in_bits, 0, union_inner_di_types, | 1405 | biggest_union_member_size_in_bits, biggest_align_in_bits, 0, union_inner_di_types, |
| 1406 | gen_field_index, 0, ""); | 1406 | gen_field_index, 0, ""); |
| 1407 | 1407 | ||
| 1408 | // create debug types for members of root struct | 1408 | // create debug types for members of root struct |
| 1409 | uint64_t tag_offset_in_bits = 8*LLVMOffsetOfElement(g->target_data_ref, enum_type->type_ref, 0); | 1409 | uint64_t tag_offset_in_bits = 8*LLVMOffsetOfElement(g->target_data_ref, enum_type->type_ref, 0); |
| 1410 | LLVMZigDIType *tag_member_di_type = LLVMZigCreateDebugMemberType(g->dbuilder, | 1410 | ZigLLVMDIType *tag_member_di_type = ZigLLVMCreateDebugMemberType(g->dbuilder, |
| 1411 | LLVMZigTypeToScope(enum_type->di_type), "tag_field", | 1411 | ZigLLVMTypeToScope(enum_type->di_type), "tag_field", |
| 1412 | import->di_file, decl_node->line + 1, | 1412 | import->di_file, decl_node->line + 1, |
| 1413 | tag_debug_size_in_bits, | 1413 | tag_debug_size_in_bits, |
| 1414 | tag_debug_align_in_bits, | 1414 | tag_debug_align_in_bits, |
| ... | @@ -1416,8 +1416,8 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt | ... | @@ -1416,8 +1416,8 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt |
| 1416 | 0, tag_di_type); | 1416 | 0, tag_di_type); |
| 1417 | 1417 | ||
| 1418 | uint64_t union_offset_in_bits = 8*LLVMOffsetOfElement(g->target_data_ref, enum_type->type_ref, 1); | 1418 | uint64_t union_offset_in_bits = 8*LLVMOffsetOfElement(g->target_data_ref, enum_type->type_ref, 1); |
| 1419 | LLVMZigDIType *union_member_di_type = LLVMZigCreateDebugMemberType(g->dbuilder, | 1419 | ZigLLVMDIType *union_member_di_type = ZigLLVMCreateDebugMemberType(g->dbuilder, |
| 1420 | LLVMZigTypeToScope(enum_type->di_type), "union_field", | 1420 | ZigLLVMTypeToScope(enum_type->di_type), "union_field", |
| 1421 | import->di_file, decl_node->line + 1, | 1421 | import->di_file, decl_node->line + 1, |
| 1422 | biggest_union_member_size_in_bits, | 1422 | biggest_union_member_size_in_bits, |
| 1423 | biggest_align_in_bits, | 1423 | biggest_align_in_bits, |
| ... | @@ -1425,7 +1425,7 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt | ... | @@ -1425,7 +1425,7 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt |
| 1425 | 0, union_di_type); | 1425 | 0, union_di_type); |
| 1426 | 1426 | ||
| 1427 | // create debug type for root struct | 1427 | // create debug type for root struct |
| 1428 | LLVMZigDIType *di_root_members[] = { | 1428 | ZigLLVMDIType *di_root_members[] = { |
| 1429 | tag_member_di_type, | 1429 | tag_member_di_type, |
| 1430 | union_member_di_type, | 1430 | union_member_di_type, |
| 1431 | }; | 1431 | }; |
| ... | @@ -1433,15 +1433,15 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt | ... | @@ -1433,15 +1433,15 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt |
| 1433 | 1433 | ||
| 1434 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, enum_type->type_ref); | 1434 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, enum_type->type_ref); |
| 1435 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, enum_type->type_ref); | 1435 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, enum_type->type_ref); |
| 1436 | LLVMZigDIType *replacement_di_type = LLVMZigCreateDebugStructType(g->dbuilder, | 1436 | ZigLLVMDIType *replacement_di_type = ZigLLVMCreateDebugStructType(g->dbuilder, |
| 1437 | LLVMZigFileToScope(import->di_file), | 1437 | ZigLLVMFileToScope(import->di_file), |
| 1438 | buf_ptr(decl_node->data.struct_decl.name), | 1438 | buf_ptr(decl_node->data.struct_decl.name), |
| 1439 | import->di_file, decl_node->line + 1, | 1439 | import->di_file, decl_node->line + 1, |
| 1440 | debug_size_in_bits, | 1440 | debug_size_in_bits, |
| 1441 | debug_align_in_bits, | 1441 | debug_align_in_bits, |
| 1442 | 0, nullptr, di_root_members, 2, 0, nullptr, ""); | 1442 | 0, nullptr, di_root_members, 2, 0, nullptr, ""); |
| 1443 | 1443 | ||
| 1444 | LLVMZigReplaceTemporary(g->dbuilder, enum_type->di_type, replacement_di_type); | 1444 | ZigLLVMReplaceTemporary(g->dbuilder, enum_type->di_type, replacement_di_type); |
| 1445 | enum_type->di_type = replacement_di_type; | 1445 | enum_type->di_type = replacement_di_type; |
| 1446 | } else { | 1446 | } else { |
| 1447 | // create llvm type for root struct | 1447 | // create llvm type for root struct |
| ... | @@ -1450,15 +1450,15 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt | ... | @@ -1450,15 +1450,15 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt |
| 1450 | // create debug type for tag | 1450 | // create debug type for tag |
| 1451 | uint64_t tag_debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, tag_type_entry->type_ref); | 1451 | uint64_t tag_debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, tag_type_entry->type_ref); |
| 1452 | uint64_t tag_debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, tag_type_entry->type_ref); | 1452 | uint64_t tag_debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, tag_type_entry->type_ref); |
| 1453 | LLVMZigDIType *tag_di_type = LLVMZigCreateDebugEnumerationType(g->dbuilder, | 1453 | ZigLLVMDIType *tag_di_type = ZigLLVMCreateDebugEnumerationType(g->dbuilder, |
| 1454 | LLVMZigFileToScope(import->di_file), buf_ptr(decl_node->data.struct_decl.name), | 1454 | ZigLLVMFileToScope(import->di_file), buf_ptr(decl_node->data.struct_decl.name), |
| 1455 | import->di_file, decl_node->line + 1, | 1455 | import->di_file, decl_node->line + 1, |
| 1456 | tag_debug_size_in_bits, | 1456 | tag_debug_size_in_bits, |
| 1457 | tag_debug_align_in_bits, | 1457 | tag_debug_align_in_bits, |
| 1458 | di_enumerators, field_count, | 1458 | di_enumerators, field_count, |
| 1459 | tag_type_entry->di_type, ""); | 1459 | tag_type_entry->di_type, ""); |
| 1460 | 1460 | ||
| 1461 | LLVMZigReplaceTemporary(g->dbuilder, enum_type->di_type, tag_di_type); | 1461 | ZigLLVMReplaceTemporary(g->dbuilder, enum_type->di_type, tag_di_type); |
| 1462 | enum_type->di_type = tag_di_type; | 1462 | enum_type->di_type = tag_di_type; |
| 1463 | 1463 | ||
| 1464 | } | 1464 | } |
| ... | @@ -1552,7 +1552,7 @@ static void resolve_struct_type(CodeGen *g, ImportTableEntry *import, TypeTableE | ... | @@ -1552,7 +1552,7 @@ static void resolve_struct_type(CodeGen *g, ImportTableEntry *import, TypeTableE |
| 1552 | int gen_field_count = gen_field_index; | 1552 | int gen_field_count = gen_field_index; |
| 1553 | LLVMStructSetBody(struct_type->type_ref, element_types, gen_field_count, false); | 1553 | LLVMStructSetBody(struct_type->type_ref, element_types, gen_field_count, false); |
| 1554 | 1554 | ||
| 1555 | LLVMZigDIType **di_element_types = allocate<LLVMZigDIType*>(gen_field_count); | 1555 | ZigLLVMDIType **di_element_types = allocate<ZigLLVMDIType*>(gen_field_count); |
| 1556 | 1556 | ||
| 1557 | for (int i = 0; i < field_count; i += 1) { | 1557 | for (int i = 0; i < field_count; i += 1) { |
| 1558 | AstNode *field_node = decl_node->data.struct_decl.fields.at(i); | 1558 | AstNode *field_node = decl_node->data.struct_decl.fields.at(i); |
| ... | @@ -1568,8 +1568,8 @@ static void resolve_struct_type(CodeGen *g, ImportTableEntry *import, TypeTableE | ... | @@ -1568,8 +1568,8 @@ static void resolve_struct_type(CodeGen *g, ImportTableEntry *import, TypeTableE |
| 1568 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, field_type->type_ref); | 1568 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, field_type->type_ref); |
| 1569 | uint64_t debug_offset_in_bits = 8*LLVMOffsetOfElement(g->target_data_ref, struct_type->type_ref, | 1569 | uint64_t debug_offset_in_bits = 8*LLVMOffsetOfElement(g->target_data_ref, struct_type->type_ref, |
| 1570 | gen_field_index); | 1570 | gen_field_index); |
| 1571 | di_element_types[gen_field_index] = LLVMZigCreateDebugMemberType(g->dbuilder, | 1571 | di_element_types[gen_field_index] = ZigLLVMCreateDebugMemberType(g->dbuilder, |
| 1572 | LLVMZigTypeToScope(struct_type->di_type), buf_ptr(type_struct_field->name), | 1572 | ZigLLVMTypeToScope(struct_type->di_type), buf_ptr(type_struct_field->name), |
| 1573 | import->di_file, field_node->line + 1, | 1573 | import->di_file, field_node->line + 1, |
| 1574 | debug_size_in_bits, | 1574 | debug_size_in_bits, |
| 1575 | debug_align_in_bits, | 1575 | debug_align_in_bits, |
| ... | @@ -1582,15 +1582,15 @@ static void resolve_struct_type(CodeGen *g, ImportTableEntry *import, TypeTableE | ... | @@ -1582,15 +1582,15 @@ static void resolve_struct_type(CodeGen *g, ImportTableEntry *import, TypeTableE |
| 1582 | 1582 | ||
| 1583 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, struct_type->type_ref); | 1583 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, struct_type->type_ref); |
| 1584 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, struct_type->type_ref); | 1584 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, struct_type->type_ref); |
| 1585 | LLVMZigDIType *replacement_di_type = LLVMZigCreateDebugStructType(g->dbuilder, | 1585 | ZigLLVMDIType *replacement_di_type = ZigLLVMCreateDebugStructType(g->dbuilder, |
| 1586 | LLVMZigFileToScope(import->di_file), | 1586 | ZigLLVMFileToScope(import->di_file), |
| 1587 | buf_ptr(decl_node->data.struct_decl.name), | 1587 | buf_ptr(decl_node->data.struct_decl.name), |
| 1588 | import->di_file, decl_node->line + 1, | 1588 | import->di_file, decl_node->line + 1, |
| 1589 | debug_size_in_bits, | 1589 | debug_size_in_bits, |
| 1590 | debug_align_in_bits, | 1590 | debug_align_in_bits, |
| 1591 | 0, nullptr, di_element_types, gen_field_count, 0, nullptr, ""); | 1591 | 0, nullptr, di_element_types, gen_field_count, 0, nullptr, ""); |
| 1592 | 1592 | ||
| 1593 | LLVMZigReplaceTemporary(g->dbuilder, struct_type->di_type, replacement_di_type); | 1593 | ZigLLVMReplaceTemporary(g->dbuilder, struct_type->di_type, replacement_di_type); |
| 1594 | struct_type->di_type = replacement_di_type; | 1594 | struct_type->di_type = replacement_di_type; |
| 1595 | 1595 | ||
| 1596 | struct_type->zero_bits = (debug_size_in_bits == 0); | 1596 | struct_type->zero_bits = (debug_size_in_bits == 0); |
| ... | @@ -7059,12 +7059,12 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, | ... | @@ -7059,12 +7059,12 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, |
| 7059 | //ast_render(stderr, import_entry->root, 4); | 7059 | //ast_render(stderr, import_entry->root, 4); |
| 7060 | } | 7060 | } |
| 7061 | 7061 | ||
| 7062 | import_entry->di_file = LLVMZigCreateFile(g->dbuilder, buf_ptr(src_basename), buf_ptr(src_dirname)); | 7062 | import_entry->di_file = ZigLLVMCreateFile(g->dbuilder, buf_ptr(src_basename), buf_ptr(src_dirname)); |
| 7063 | g->import_table.put(abs_full_path, import_entry); | 7063 | g->import_table.put(abs_full_path, import_entry); |
| 7064 | g->import_queue.append(import_entry); | 7064 | g->import_queue.append(import_entry); |
| 7065 | 7065 | ||
| 7066 | import_entry->block_context = new_block_context(import_entry->root, nullptr); | 7066 | import_entry->block_context = new_block_context(import_entry->root, nullptr); |
| 7067 | import_entry->block_context->di_scope = LLVMZigFileToScope(import_entry->di_file); | 7067 | import_entry->block_context->di_scope = ZigLLVMFileToScope(import_entry->di_file); |
| 7068 | 7068 | ||
| 7069 | 7069 | ||
| 7070 | assert(import_entry->root->type == NodeTypeRoot); | 7070 | assert(import_entry->root->type == NodeTypeRoot); |
src/codegen.cpp+37-37| ... | @@ -1144,7 +1144,7 @@ static LLVMValueRef gen_fn_call_expr(CodeGen *g, AstNode *node) { | ... | @@ -1144,7 +1144,7 @@ static LLVMValueRef gen_fn_call_expr(CodeGen *g, AstNode *node) { |
| 1144 | } | 1144 | } |
| 1145 | 1145 | ||
| 1146 | set_debug_source_node(g, node); | 1146 | set_debug_source_node(g, node); |
| 1147 | LLVMValueRef result = LLVMZigBuildCall(g->builder, fn_val, | 1147 | LLVMValueRef result = ZigLLVMBuildCall(g->builder, fn_val, |
| 1148 | gen_param_values, gen_param_index, fn_type->data.fn.calling_convention, ""); | 1148 | gen_param_values, gen_param_index, fn_type->data.fn.calling_convention, ""); |
| 1149 | 1149 | ||
| 1150 | if (src_return_type->id == TypeTableEntryIdUnreachable) { | 1150 | if (src_return_type->id == TypeTableEntryIdUnreachable) { |
| ... | @@ -2631,9 +2631,9 @@ static LLVMValueRef gen_if_bool_expr(CodeGen *g, AstNode *node) { | ... | @@ -2631,9 +2631,9 @@ static LLVMValueRef gen_if_bool_expr(CodeGen *g, AstNode *node) { |
| 2631 | static void gen_var_debug_decl(CodeGen *g, VariableTableEntry *var) { | 2631 | static void gen_var_debug_decl(CodeGen *g, VariableTableEntry *var) { |
| 2632 | BlockContext *block_context = var->block_context; | 2632 | BlockContext *block_context = var->block_context; |
| 2633 | AstNode *source_node = var->decl_node; | 2633 | AstNode *source_node = var->decl_node; |
| 2634 | LLVMZigDILocation *debug_loc = LLVMZigGetDebugLoc(source_node->line + 1, source_node->column + 1, | 2634 | ZigLLVMDILocation *debug_loc = ZigLLVMGetDebugLoc(source_node->line + 1, source_node->column + 1, |
| 2635 | block_context->di_scope); | 2635 | block_context->di_scope); |
| 2636 | LLVMZigInsertDeclareAtEnd(g->dbuilder, var->value_ref, var->di_loc_var, debug_loc, | 2636 | ZigLLVMInsertDeclareAtEnd(g->dbuilder, var->value_ref, var->di_loc_var, debug_loc, |
| 2637 | LLVMGetInsertBlock(g->builder)); | 2637 | LLVMGetInsertBlock(g->builder)); |
| 2638 | } | 2638 | } |
| 2639 | 2639 | ||
| ... | @@ -3963,7 +3963,7 @@ static void gen_global_var(CodeGen *g, VariableTableEntry *var, LLVMValueRef ini | ... | @@ -3963,7 +3963,7 @@ static void gen_global_var(CodeGen *g, VariableTableEntry *var, LLVMValueRef ini |
| 3963 | assert(var->import); | 3963 | assert(var->import); |
| 3964 | assert(type_entry); | 3964 | assert(type_entry); |
| 3965 | bool is_local_to_unit = true; | 3965 | bool is_local_to_unit = true; |
| 3966 | LLVMZigCreateGlobalVariable(g->dbuilder, | 3966 | ZigLLVMCreateGlobalVariable(g->dbuilder, |
| 3967 | var->block_context->di_scope, buf_ptr(&var->name), | 3967 | var->block_context->di_scope, buf_ptr(&var->name), |
| 3968 | buf_ptr(&var->name), var->import->di_file, var->decl_node->line + 1, | 3968 | buf_ptr(&var->name), var->import->di_file, var->decl_node->line + 1, |
| 3969 | type_entry->di_type, is_local_to_unit, init_val); | 3969 | type_entry->di_type, is_local_to_unit, init_val); |
| ... | @@ -4073,13 +4073,13 @@ static void do_code_gen(CodeGen *g) { | ... | @@ -4073,13 +4073,13 @@ static void do_code_gen(CodeGen *g) { |
| 4073 | if (!type_has_bits(fn_type->data.fn.fn_type_id.return_type)) { | 4073 | if (!type_has_bits(fn_type->data.fn.fn_type_id.return_type)) { |
| 4074 | // nothing to do | 4074 | // nothing to do |
| 4075 | } else if (fn_type->data.fn.fn_type_id.return_type->id == TypeTableEntryIdPointer) { | 4075 | } else if (fn_type->data.fn.fn_type_id.return_type->id == TypeTableEntryIdPointer) { |
| 4076 | LLVMZigAddNonNullAttr(fn_table_entry->fn_value, 0); | 4076 | ZigLLVMAddNonNullAttr(fn_table_entry->fn_value, 0); |
| 4077 | } else if (handle_is_ptr(fn_type->data.fn.fn_type_id.return_type) && | 4077 | } else if (handle_is_ptr(fn_type->data.fn.fn_type_id.return_type) && |
| 4078 | !fn_type->data.fn.fn_type_id.is_extern) | 4078 | !fn_type->data.fn.fn_type_id.is_extern) |
| 4079 | { | 4079 | { |
| 4080 | LLVMValueRef first_arg = LLVMGetParam(fn_table_entry->fn_value, 0); | 4080 | LLVMValueRef first_arg = LLVMGetParam(fn_table_entry->fn_value, 0); |
| 4081 | LLVMAddAttribute(first_arg, LLVMStructRetAttribute); | 4081 | LLVMAddAttribute(first_arg, LLVMStructRetAttribute); |
| 4082 | LLVMZigAddNonNullAttr(fn_table_entry->fn_value, 1); | 4082 | ZigLLVMAddNonNullAttr(fn_table_entry->fn_value, 1); |
| 4083 | is_sret = true; | 4083 | is_sret = true; |
| 4084 | } | 4084 | } |
| 4085 | if (fn_table_entry->is_pure && !is_sret && g->is_release_build) { | 4085 | if (fn_table_entry->is_pure && !is_sret && g->is_release_build) { |
| ... | @@ -4112,7 +4112,7 @@ static void do_code_gen(CodeGen *g) { | ... | @@ -4112,7 +4112,7 @@ static void do_code_gen(CodeGen *g) { |
| 4112 | LLVMAddAttribute(argument_val, LLVMReadOnlyAttribute); | 4112 | LLVMAddAttribute(argument_val, LLVMReadOnlyAttribute); |
| 4113 | } | 4113 | } |
| 4114 | if (param_type->id == TypeTableEntryIdPointer) { | 4114 | if (param_type->id == TypeTableEntryIdPointer) { |
| 4115 | LLVMZigAddNonNullAttr(fn_table_entry->fn_value, gen_index + 1); | 4115 | ZigLLVMAddNonNullAttr(fn_table_entry->fn_value, gen_index + 1); |
| 4116 | } | 4116 | } |
| 4117 | if (is_byval) { | 4117 | if (is_byval) { |
| 4118 | // TODO | 4118 | // TODO |
| ... | @@ -4189,12 +4189,12 @@ static void do_code_gen(CodeGen *g) { | ... | @@ -4189,12 +4189,12 @@ static void do_code_gen(CodeGen *g) { |
| 4189 | BlockContext *block_context = fn_table_entry->all_block_contexts.at(bc_i); | 4189 | BlockContext *block_context = fn_table_entry->all_block_contexts.at(bc_i); |
| 4190 | 4190 | ||
| 4191 | if (!block_context->di_scope) { | 4191 | if (!block_context->di_scope) { |
| 4192 | LLVMZigDILexicalBlock *di_block = LLVMZigCreateLexicalBlock(g->dbuilder, | 4192 | ZigLLVMDILexicalBlock *di_block = ZigLLVMCreateLexicalBlock(g->dbuilder, |
| 4193 | block_context->parent->di_scope, | 4193 | block_context->parent->di_scope, |
| 4194 | import->di_file, | 4194 | import->di_file, |
| 4195 | block_context->node->line + 1, | 4195 | block_context->node->line + 1, |
| 4196 | block_context->node->column + 1); | 4196 | block_context->node->column + 1); |
| 4197 | block_context->di_scope = LLVMZigLexicalBlockToScope(di_block); | 4197 | block_context->di_scope = ZigLLVMLexicalBlockToScope(di_block); |
| 4198 | } | 4198 | } |
| 4199 | 4199 | ||
| 4200 | 4200 | ||
| ... | @@ -4237,7 +4237,7 @@ static void do_code_gen(CodeGen *g) { | ... | @@ -4237,7 +4237,7 @@ static void do_code_gen(CodeGen *g) { |
| 4237 | unsigned align_bytes = ZigLLVMGetPrefTypeAlignment(g->target_data_ref, var->type->type_ref); | 4237 | unsigned align_bytes = ZigLLVMGetPrefTypeAlignment(g->target_data_ref, var->type->type_ref); |
| 4238 | LLVMSetAlignment(var->value_ref, align_bytes); | 4238 | LLVMSetAlignment(var->value_ref, align_bytes); |
| 4239 | } | 4239 | } |
| 4240 | var->di_loc_var = LLVMZigCreateParameterVariable(g->dbuilder, var->block_context->di_scope, | 4240 | var->di_loc_var = ZigLLVMCreateParameterVariable(g->dbuilder, var->block_context->di_scope, |
| 4241 | buf_ptr(&var->name), import->di_file, var->decl_node->line + 1, | 4241 | buf_ptr(&var->name), import->di_file, var->decl_node->line + 1, |
| 4242 | gen_type->di_type, !g->strip_debug_symbols, 0, var->gen_arg_index + 1); | 4242 | gen_type->di_type, !g->strip_debug_symbols, 0, var->gen_arg_index + 1); |
| 4243 | 4243 | ||
| ... | @@ -4248,7 +4248,7 @@ static void do_code_gen(CodeGen *g) { | ... | @@ -4248,7 +4248,7 @@ static void do_code_gen(CodeGen *g) { |
| 4248 | unsigned align_bytes = ZigLLVMGetPrefTypeAlignment(g->target_data_ref, var->type->type_ref); | 4248 | unsigned align_bytes = ZigLLVMGetPrefTypeAlignment(g->target_data_ref, var->type->type_ref); |
| 4249 | LLVMSetAlignment(var->value_ref, align_bytes); | 4249 | LLVMSetAlignment(var->value_ref, align_bytes); |
| 4250 | 4250 | ||
| 4251 | var->di_loc_var = LLVMZigCreateAutoVariable(g->dbuilder, var->block_context->di_scope, | 4251 | var->di_loc_var = ZigLLVMCreateAutoVariable(g->dbuilder, var->block_context->di_scope, |
| 4252 | buf_ptr(&var->name), import->di_file, var->decl_node->line + 1, | 4252 | buf_ptr(&var->name), import->di_file, var->decl_node->line + 1, |
| 4253 | var->type->di_type, !g->strip_debug_symbols, 0); | 4253 | var->type->di_type, !g->strip_debug_symbols, 0); |
| 4254 | } | 4254 | } |
| ... | @@ -4283,7 +4283,7 @@ static void do_code_gen(CodeGen *g) { | ... | @@ -4283,7 +4283,7 @@ static void do_code_gen(CodeGen *g) { |
| 4283 | } | 4283 | } |
| 4284 | assert(!g->errors.length); | 4284 | assert(!g->errors.length); |
| 4285 | 4285 | ||
| 4286 | LLVMZigDIBuilderFinalize(g->dbuilder); | 4286 | ZigLLVMDIBuilderFinalize(g->dbuilder); |
| 4287 | 4287 | ||
| 4288 | if (g->verbose) { | 4288 | if (g->verbose) { |
| 4289 | LLVMDumpModule(g->module); | 4289 | LLVMDumpModule(g->module); |
| ... | @@ -4387,21 +4387,21 @@ static void define_builtin_types(CodeGen *g) { | ... | @@ -4387,21 +4387,21 @@ static void define_builtin_types(CodeGen *g) { |
| 4387 | unsigned dwarf_tag; | 4387 | unsigned dwarf_tag; |
| 4388 | if (is_signed) { | 4388 | if (is_signed) { |
| 4389 | if (size_in_bits == 8) { | 4389 | if (size_in_bits == 8) { |
| 4390 | dwarf_tag = LLVMZigEncoding_DW_ATE_signed_char(); | 4390 | dwarf_tag = ZigLLVMEncoding_DW_ATE_signed_char(); |
| 4391 | } else { | 4391 | } else { |
| 4392 | dwarf_tag = LLVMZigEncoding_DW_ATE_signed(); | 4392 | dwarf_tag = ZigLLVMEncoding_DW_ATE_signed(); |
| 4393 | } | 4393 | } |
| 4394 | } else { | 4394 | } else { |
| 4395 | if (size_in_bits == 8) { | 4395 | if (size_in_bits == 8) { |
| 4396 | dwarf_tag = LLVMZigEncoding_DW_ATE_unsigned_char(); | 4396 | dwarf_tag = ZigLLVMEncoding_DW_ATE_unsigned_char(); |
| 4397 | } else { | 4397 | } else { |
| 4398 | dwarf_tag = LLVMZigEncoding_DW_ATE_unsigned(); | 4398 | dwarf_tag = ZigLLVMEncoding_DW_ATE_unsigned(); |
| 4399 | } | 4399 | } |
| 4400 | } | 4400 | } |
| 4401 | 4401 | ||
| 4402 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 4402 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 4403 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 4403 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 4404 | entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), | 4404 | entry->di_type = ZigLLVMCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), |
| 4405 | debug_size_in_bits, debug_align_in_bits, dwarf_tag); | 4405 | debug_size_in_bits, debug_align_in_bits, dwarf_tag); |
| 4406 | entry->data.integral.is_signed = is_signed; | 4406 | entry->data.integral.is_signed = is_signed; |
| 4407 | entry->data.integral.bit_count = size_in_bits; | 4407 | entry->data.integral.bit_count = size_in_bits; |
| ... | @@ -4424,10 +4424,10 @@ static void define_builtin_types(CodeGen *g) { | ... | @@ -4424,10 +4424,10 @@ static void define_builtin_types(CodeGen *g) { |
| 4424 | 4424 | ||
| 4425 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 4425 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 4426 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 4426 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 4427 | entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), | 4427 | entry->di_type = ZigLLVMCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), |
| 4428 | debug_size_in_bits, | 4428 | debug_size_in_bits, |
| 4429 | debug_align_in_bits, | 4429 | debug_align_in_bits, |
| 4430 | is_signed ? LLVMZigEncoding_DW_ATE_signed() : LLVMZigEncoding_DW_ATE_unsigned()); | 4430 | is_signed ? ZigLLVMEncoding_DW_ATE_signed() : ZigLLVMEncoding_DW_ATE_unsigned()); |
| 4431 | entry->data.integral.is_signed = is_signed; | 4431 | entry->data.integral.is_signed = is_signed; |
| 4432 | entry->data.integral.bit_count = size_in_bits; | 4432 | entry->data.integral.bit_count = size_in_bits; |
| 4433 | g->primitive_type_table.put(&entry->name, entry); | 4433 | g->primitive_type_table.put(&entry->name, entry); |
| ... | @@ -4442,10 +4442,10 @@ static void define_builtin_types(CodeGen *g) { | ... | @@ -4442,10 +4442,10 @@ static void define_builtin_types(CodeGen *g) { |
| 4442 | buf_init_from_str(&entry->name, "bool"); | 4442 | buf_init_from_str(&entry->name, "bool"); |
| 4443 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 4443 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 4444 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 4444 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 4445 | entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), | 4445 | entry->di_type = ZigLLVMCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), |
| 4446 | debug_size_in_bits, | 4446 | debug_size_in_bits, |
| 4447 | debug_align_in_bits, | 4447 | debug_align_in_bits, |
| 4448 | LLVMZigEncoding_DW_ATE_boolean()); | 4448 | ZigLLVMEncoding_DW_ATE_boolean()); |
| 4449 | g->builtin_types.entry_bool = entry; | 4449 | g->builtin_types.entry_bool = entry; |
| 4450 | g->primitive_type_table.put(&entry->name, entry); | 4450 | g->primitive_type_table.put(&entry->name, entry); |
| 4451 | } | 4451 | } |
| ... | @@ -4466,10 +4466,10 @@ static void define_builtin_types(CodeGen *g) { | ... | @@ -4466,10 +4466,10 @@ static void define_builtin_types(CodeGen *g) { |
| 4466 | 4466 | ||
| 4467 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 4467 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 4468 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 4468 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 4469 | entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), | 4469 | entry->di_type = ZigLLVMCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), |
| 4470 | debug_size_in_bits, | 4470 | debug_size_in_bits, |
| 4471 | debug_align_in_bits, | 4471 | debug_align_in_bits, |
| 4472 | is_signed ? LLVMZigEncoding_DW_ATE_signed() : LLVMZigEncoding_DW_ATE_unsigned()); | 4472 | is_signed ? ZigLLVMEncoding_DW_ATE_signed() : ZigLLVMEncoding_DW_ATE_unsigned()); |
| 4473 | g->primitive_type_table.put(&entry->name, entry); | 4473 | g->primitive_type_table.put(&entry->name, entry); |
| 4474 | 4474 | ||
| 4475 | if (is_signed) { | 4475 | if (is_signed) { |
| ... | @@ -4487,10 +4487,10 @@ static void define_builtin_types(CodeGen *g) { | ... | @@ -4487,10 +4487,10 @@ static void define_builtin_types(CodeGen *g) { |
| 4487 | 4487 | ||
| 4488 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 4488 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 4489 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 4489 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 4490 | entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), | 4490 | entry->di_type = ZigLLVMCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), |
| 4491 | debug_size_in_bits, | 4491 | debug_size_in_bits, |
| 4492 | debug_align_in_bits, | 4492 | debug_align_in_bits, |
| 4493 | LLVMZigEncoding_DW_ATE_float()); | 4493 | ZigLLVMEncoding_DW_ATE_float()); |
| 4494 | g->builtin_types.entry_f32 = entry; | 4494 | g->builtin_types.entry_f32 = entry; |
| 4495 | g->primitive_type_table.put(&entry->name, entry); | 4495 | g->primitive_type_table.put(&entry->name, entry); |
| 4496 | } | 4496 | } |
| ... | @@ -4503,10 +4503,10 @@ static void define_builtin_types(CodeGen *g) { | ... | @@ -4503,10 +4503,10 @@ static void define_builtin_types(CodeGen *g) { |
| 4503 | 4503 | ||
| 4504 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 4504 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 4505 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 4505 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 4506 | entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), | 4506 | entry->di_type = ZigLLVMCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), |
| 4507 | debug_size_in_bits, | 4507 | debug_size_in_bits, |
| 4508 | debug_align_in_bits, | 4508 | debug_align_in_bits, |
| 4509 | LLVMZigEncoding_DW_ATE_float()); | 4509 | ZigLLVMEncoding_DW_ATE_float()); |
| 4510 | g->builtin_types.entry_f64 = entry; | 4510 | g->builtin_types.entry_f64 = entry; |
| 4511 | g->primitive_type_table.put(&entry->name, entry); | 4511 | g->primitive_type_table.put(&entry->name, entry); |
| 4512 | } | 4512 | } |
| ... | @@ -4519,10 +4519,10 @@ static void define_builtin_types(CodeGen *g) { | ... | @@ -4519,10 +4519,10 @@ static void define_builtin_types(CodeGen *g) { |
| 4519 | 4519 | ||
| 4520 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); | 4520 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| 4521 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); | 4521 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); |
| 4522 | entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), | 4522 | entry->di_type = ZigLLVMCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), |
| 4523 | debug_size_in_bits, | 4523 | debug_size_in_bits, |
| 4524 | debug_align_in_bits, | 4524 | debug_align_in_bits, |
| 4525 | LLVMZigEncoding_DW_ATE_float()); | 4525 | ZigLLVMEncoding_DW_ATE_float()); |
| 4526 | g->builtin_types.entry_c_long_double = entry; | 4526 | g->builtin_types.entry_c_long_double = entry; |
| 4527 | g->primitive_type_table.put(&entry->name, entry); | 4527 | g->primitive_type_table.put(&entry->name, entry); |
| 4528 | } | 4528 | } |
| ... | @@ -4532,10 +4532,10 @@ static void define_builtin_types(CodeGen *g) { | ... | @@ -4532,10 +4532,10 @@ static void define_builtin_types(CodeGen *g) { |
| 4532 | entry->type_ref = LLVMVoidType(); | 4532 | entry->type_ref = LLVMVoidType(); |
| 4533 | entry->zero_bits = true; | 4533 | entry->zero_bits = true; |
| 4534 | buf_init_from_str(&entry->name, "void"); | 4534 | buf_init_from_str(&entry->name, "void"); |
| 4535 | entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), | 4535 | entry->di_type = ZigLLVMCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), |
| 4536 | 0, | 4536 | 0, |
| 4537 | 0, | 4537 | 0, |
| 4538 | LLVMZigEncoding_DW_ATE_unsigned()); | 4538 | ZigLLVMEncoding_DW_ATE_unsigned()); |
| 4539 | g->builtin_types.entry_void = entry; | 4539 | g->builtin_types.entry_void = entry; |
| 4540 | g->primitive_type_table.put(&entry->name, entry); | 4540 | g->primitive_type_table.put(&entry->name, entry); |
| 4541 | } | 4541 | } |
| ... | @@ -4884,8 +4884,8 @@ static void init(CodeGen *g, Buf *source_path) { | ... | @@ -4884,8 +4884,8 @@ static void init(CodeGen *g, Buf *source_path) { |
| 4884 | const char *target_specific_cpu_args; | 4884 | const char *target_specific_cpu_args; |
| 4885 | const char *target_specific_features; | 4885 | const char *target_specific_features; |
| 4886 | if (g->is_native_target) { | 4886 | if (g->is_native_target) { |
| 4887 | target_specific_cpu_args = LLVMZigGetHostCPUName(); | 4887 | target_specific_cpu_args = ZigLLVMGetHostCPUName(); |
| 4888 | target_specific_features = LLVMZigGetNativeFeatures(); | 4888 | target_specific_features = ZigLLVMGetNativeFeatures(); |
| 4889 | } else { | 4889 | } else { |
| 4890 | target_specific_cpu_args = ""; | 4890 | target_specific_cpu_args = ""; |
| 4891 | target_specific_features = ""; | 4891 | target_specific_features = ""; |
| ... | @@ -4904,16 +4904,16 @@ static void init(CodeGen *g, Buf *source_path) { | ... | @@ -4904,16 +4904,16 @@ static void init(CodeGen *g, Buf *source_path) { |
| 4904 | g->is_big_endian = (LLVMByteOrder(g->target_data_ref) == LLVMBigEndian); | 4904 | g->is_big_endian = (LLVMByteOrder(g->target_data_ref) == LLVMBigEndian); |
| 4905 | 4905 | ||
| 4906 | g->builder = LLVMCreateBuilder(); | 4906 | g->builder = LLVMCreateBuilder(); |
| 4907 | g->dbuilder = LLVMZigCreateDIBuilder(g->module, true); | 4907 | g->dbuilder = ZigLLVMCreateDIBuilder(g->module, true); |
| 4908 | 4908 | ||
| 4909 | LLVMZigSetFastMath(g->builder, true); | 4909 | ZigLLVMSetFastMath(g->builder, true); |
| 4910 | 4910 | ||
| 4911 | 4911 | ||
| 4912 | Buf *producer = buf_sprintf("zig %s", ZIG_VERSION_STRING); | 4912 | Buf *producer = buf_sprintf("zig %s", ZIG_VERSION_STRING); |
| 4913 | bool is_optimized = g->is_release_build; | 4913 | bool is_optimized = g->is_release_build; |
| 4914 | const char *flags = ""; | 4914 | const char *flags = ""; |
| 4915 | unsigned runtime_version = 0; | 4915 | unsigned runtime_version = 0; |
| 4916 | g->compile_unit = LLVMZigCreateCompileUnit(g->dbuilder, LLVMZigLang_DW_LANG_C99(), | 4916 | g->compile_unit = ZigLLVMCreateCompileUnit(g->dbuilder, ZigLLVMLang_DW_LANG_C99(), |
| 4917 | buf_ptr(source_path), buf_ptr(&g->root_package->root_src_dir), | 4917 | buf_ptr(source_path), buf_ptr(&g->root_package->root_src_dir), |
| 4918 | buf_ptr(producer), is_optimized, flags, runtime_version, | 4918 | buf_ptr(producer), is_optimized, flags, runtime_version, |
| 4919 | "", 0, !g->strip_debug_symbols); | 4919 | "", 0, !g->strip_debug_symbols); |
| ... | @@ -4938,7 +4938,7 @@ void codegen_parseh(CodeGen *g, Buf *src_dirname, Buf *src_basename, Buf *source | ... | @@ -4938,7 +4938,7 @@ void codegen_parseh(CodeGen *g, Buf *src_dirname, Buf *src_basename, Buf *source |
| 4938 | 4938 | ||
| 4939 | init(g, full_path); | 4939 | init(g, full_path); |
| 4940 | 4940 | ||
| 4941 | import->di_file = LLVMZigCreateFile(g->dbuilder, buf_ptr(src_basename), buf_ptr(src_dirname)); | 4941 | import->di_file = ZigLLVMCreateFile(g->dbuilder, buf_ptr(src_basename), buf_ptr(src_dirname)); |
| 4942 | 4942 | ||
| 4943 | ZigList<ErrorMsg *> errors = {0}; | 4943 | ZigList<ErrorMsg *> errors = {0}; |
| 4944 | int err = parse_h_buf(import, &errors, source_code, g, nullptr); | 4944 | int err = parse_h_buf(import, &errors, source_code, g, nullptr); |
src/link.cpp+1-1| ... | @@ -763,7 +763,7 @@ void codegen_link(CodeGen *g, const char *out_file) { | ... | @@ -763,7 +763,7 @@ void codegen_link(CodeGen *g, const char *out_file) { |
| 763 | fprintf(stderr, "---------------\n"); | 763 | fprintf(stderr, "---------------\n"); |
| 764 | } | 764 | } |
| 765 | 765 | ||
| 766 | LLVMZigOptimizeModule(g->target_machine, g->module); | 766 | ZigLLVMOptimizeModule(g->target_machine, g->module); |
| 767 | 767 | ||
| 768 | if (g->verbose) { | 768 | if (g->verbose) { |
| 769 | LLVMDumpModule(g->module); | 769 | LLVMDumpModule(g->module); |
src/parseh.cpp+15-15| ... | @@ -808,11 +808,11 @@ static void add_alias(Context *c, const char *new_name, const char *target_name) | ... | @@ -808,11 +808,11 @@ static void add_alias(Context *c, const char *new_name, const char *target_name) |
| 808 | 808 | ||
| 809 | static void replace_with_fwd_decl(Context *c, TypeTableEntry *struct_type, Buf *full_type_name) { | 809 | static void replace_with_fwd_decl(Context *c, TypeTableEntry *struct_type, Buf *full_type_name) { |
| 810 | unsigned line = c->source_node ? c->source_node->line : 0; | 810 | unsigned line = c->source_node ? c->source_node->line : 0; |
| 811 | LLVMZigDIType *replacement_di_type = LLVMZigCreateDebugForwardDeclType(c->codegen->dbuilder, | 811 | ZigLLVMDIType *replacement_di_type = ZigLLVMCreateDebugForwardDeclType(c->codegen->dbuilder, |
| 812 | LLVMZigTag_DW_structure_type(), buf_ptr(full_type_name), | 812 | ZigLLVMTag_DW_structure_type(), buf_ptr(full_type_name), |
| 813 | LLVMZigFileToScope(c->import->di_file), c->import->di_file, line); | 813 | ZigLLVMFileToScope(c->import->di_file), c->import->di_file, line); |
| 814 | 814 | ||
| 815 | LLVMZigReplaceTemporary(c->codegen->dbuilder, struct_type->di_type, replacement_di_type); | 815 | ZigLLVMReplaceTemporary(c->codegen->dbuilder, struct_type->di_type, replacement_di_type); |
| 816 | struct_type->di_type = replacement_di_type; | 816 | struct_type->di_type = replacement_di_type; |
| 817 | } | 817 | } |
| 818 | 818 | ||
| ... | @@ -872,7 +872,7 @@ static TypeTableEntry *resolve_enum_decl(Context *c, const EnumDecl *enum_decl) | ... | @@ -872,7 +872,7 @@ static TypeTableEntry *resolve_enum_decl(Context *c, const EnumDecl *enum_decl) |
| 872 | 872 | ||
| 873 | enum_type->data.enumeration.field_count = field_count; | 873 | enum_type->data.enumeration.field_count = field_count; |
| 874 | enum_type->data.enumeration.fields = allocate<TypeEnumField>(field_count); | 874 | enum_type->data.enumeration.fields = allocate<TypeEnumField>(field_count); |
| 875 | LLVMZigDIEnumerator **di_enumerators = allocate<LLVMZigDIEnumerator*>(field_count); | 875 | ZigLLVMDIEnumerator **di_enumerators = allocate<ZigLLVMDIEnumerator*>(field_count); |
| 876 | 876 | ||
| 877 | uint32_t i = 0; | 877 | uint32_t i = 0; |
| 878 | for (auto it = enum_def->enumerator_begin(), | 878 | for (auto it = enum_def->enumerator_begin(), |
| ... | @@ -894,7 +894,7 @@ static TypeTableEntry *resolve_enum_decl(Context *c, const EnumDecl *enum_decl) | ... | @@ -894,7 +894,7 @@ static TypeTableEntry *resolve_enum_decl(Context *c, const EnumDecl *enum_decl) |
| 894 | type_enum_field->type_entry = c->codegen->builtin_types.entry_void; | 894 | type_enum_field->type_entry = c->codegen->builtin_types.entry_void; |
| 895 | type_enum_field->value = i; | 895 | type_enum_field->value = i; |
| 896 | 896 | ||
| 897 | di_enumerators[i] = LLVMZigCreateDebugEnumerator(c->codegen->dbuilder, buf_ptr(type_enum_field->name), i); | 897 | di_enumerators[i] = ZigLLVMCreateDebugEnumerator(c->codegen->dbuilder, buf_ptr(type_enum_field->name), i); |
| 898 | 898 | ||
| 899 | 899 | ||
| 900 | // in C each enum value is in the global namespace. so we put them there too. | 900 | // in C each enum value is in the global namespace. so we put them there too. |
| ... | @@ -913,14 +913,14 @@ static TypeTableEntry *resolve_enum_decl(Context *c, const EnumDecl *enum_decl) | ... | @@ -913,14 +913,14 @@ static TypeTableEntry *resolve_enum_decl(Context *c, const EnumDecl *enum_decl) |
| 913 | unsigned line = c->source_node ? (c->source_node->line + 1) : 0; | 913 | unsigned line = c->source_node ? (c->source_node->line + 1) : 0; |
| 914 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(c->codegen->target_data_ref, enum_type->type_ref); | 914 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(c->codegen->target_data_ref, enum_type->type_ref); |
| 915 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(c->codegen->target_data_ref, enum_type->type_ref); | 915 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(c->codegen->target_data_ref, enum_type->type_ref); |
| 916 | LLVMZigDIType *tag_di_type = LLVMZigCreateDebugEnumerationType(c->codegen->dbuilder, | 916 | ZigLLVMDIType *tag_di_type = ZigLLVMCreateDebugEnumerationType(c->codegen->dbuilder, |
| 917 | LLVMZigFileToScope(c->import->di_file), buf_ptr(bare_name), | 917 | ZigLLVMFileToScope(c->import->di_file), buf_ptr(bare_name), |
| 918 | c->import->di_file, line, | 918 | c->import->di_file, line, |
| 919 | debug_size_in_bits, | 919 | debug_size_in_bits, |
| 920 | debug_align_in_bits, | 920 | debug_align_in_bits, |
| 921 | di_enumerators, field_count, tag_type_entry->di_type, ""); | 921 | di_enumerators, field_count, tag_type_entry->di_type, ""); |
| 922 | 922 | ||
| 923 | LLVMZigReplaceTemporary(c->codegen->dbuilder, enum_type->di_type, tag_di_type); | 923 | ZigLLVMReplaceTemporary(c->codegen->dbuilder, enum_type->di_type, tag_di_type); |
| 924 | enum_type->di_type = tag_di_type; | 924 | enum_type->di_type = tag_di_type; |
| 925 | 925 | ||
| 926 | return enum_type; | 926 | return enum_type; |
| ... | @@ -1053,7 +1053,7 @@ static TypeTableEntry *resolve_record_decl(Context *c, const RecordDecl *record_ | ... | @@ -1053,7 +1053,7 @@ static TypeTableEntry *resolve_record_decl(Context *c, const RecordDecl *record_ |
| 1053 | struct_type->data.structure.src_field_count = field_count; | 1053 | struct_type->data.structure.src_field_count = field_count; |
| 1054 | struct_type->data.structure.fields = allocate<TypeStructField>(field_count); | 1054 | struct_type->data.structure.fields = allocate<TypeStructField>(field_count); |
| 1055 | LLVMTypeRef *element_types = allocate<LLVMTypeRef>(field_count); | 1055 | LLVMTypeRef *element_types = allocate<LLVMTypeRef>(field_count); |
| 1056 | LLVMZigDIType **di_element_types = allocate<LLVMZigDIType*>(field_count); | 1056 | ZigLLVMDIType **di_element_types = allocate<ZigLLVMDIType*>(field_count); |
| 1057 | 1057 | ||
| 1058 | // next, populate element_types as its needed for LLVMStructSetBody which is needed for LLVMOffsetOfElement | 1058 | // next, populate element_types as its needed for LLVMStructSetBody which is needed for LLVMOffsetOfElement |
| 1059 | uint32_t i = 0; | 1059 | uint32_t i = 0; |
| ... | @@ -1094,8 +1094,8 @@ static TypeTableEntry *resolve_record_decl(Context *c, const RecordDecl *record_ | ... | @@ -1094,8 +1094,8 @@ static TypeTableEntry *resolve_record_decl(Context *c, const RecordDecl *record_ |
| 1094 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(c->codegen->target_data_ref, field_type->type_ref); | 1094 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(c->codegen->target_data_ref, field_type->type_ref); |
| 1095 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(c->codegen->target_data_ref, field_type->type_ref); | 1095 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(c->codegen->target_data_ref, field_type->type_ref); |
| 1096 | uint64_t debug_offset_in_bits = 8*LLVMOffsetOfElement(c->codegen->target_data_ref, struct_type->type_ref, i); | 1096 | uint64_t debug_offset_in_bits = 8*LLVMOffsetOfElement(c->codegen->target_data_ref, struct_type->type_ref, i); |
| 1097 | di_element_types[i] = LLVMZigCreateDebugMemberType(c->codegen->dbuilder, | 1097 | di_element_types[i] = ZigLLVMCreateDebugMemberType(c->codegen->dbuilder, |
| 1098 | LLVMZigTypeToScope(struct_type->di_type), buf_ptr(type_struct_field->name), | 1098 | ZigLLVMTypeToScope(struct_type->di_type), buf_ptr(type_struct_field->name), |
| 1099 | c->import->di_file, line + 1, | 1099 | c->import->di_file, line + 1, |
| 1100 | debug_size_in_bits, | 1100 | debug_size_in_bits, |
| 1101 | debug_align_in_bits, | 1101 | debug_align_in_bits, |
| ... | @@ -1112,15 +1112,15 @@ static TypeTableEntry *resolve_record_decl(Context *c, const RecordDecl *record_ | ... | @@ -1112,15 +1112,15 @@ static TypeTableEntry *resolve_record_decl(Context *c, const RecordDecl *record_ |
| 1112 | 1112 | ||
| 1113 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(c->codegen->target_data_ref, struct_type->type_ref); | 1113 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(c->codegen->target_data_ref, struct_type->type_ref); |
| 1114 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(c->codegen->target_data_ref, struct_type->type_ref); | 1114 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(c->codegen->target_data_ref, struct_type->type_ref); |
| 1115 | LLVMZigDIType *replacement_di_type = LLVMZigCreateDebugStructType(c->codegen->dbuilder, | 1115 | ZigLLVMDIType *replacement_di_type = ZigLLVMCreateDebugStructType(c->codegen->dbuilder, |
| 1116 | LLVMZigFileToScope(c->import->di_file), | 1116 | ZigLLVMFileToScope(c->import->di_file), |
| 1117 | buf_ptr(full_type_name), c->import->di_file, line + 1, | 1117 | buf_ptr(full_type_name), c->import->di_file, line + 1, |
| 1118 | debug_size_in_bits, | 1118 | debug_size_in_bits, |
| 1119 | debug_align_in_bits, | 1119 | debug_align_in_bits, |
| 1120 | 0, | 1120 | 0, |
| 1121 | nullptr, di_element_types, field_count, 0, nullptr, ""); | 1121 | nullptr, di_element_types, field_count, 0, nullptr, ""); |
| 1122 | 1122 | ||
| 1123 | LLVMZigReplaceTemporary(c->codegen->dbuilder, struct_type->di_type, replacement_di_type); | 1123 | ZigLLVMReplaceTemporary(c->codegen->dbuilder, struct_type->di_type, replacement_di_type); |
| 1124 | struct_type->di_type = replacement_di_type; | 1124 | struct_type->di_type = replacement_di_type; |
| 1125 | 1125 | ||
| 1126 | return struct_type; | 1126 | return struct_type; |
src/zig_llvm.cpp+105-105| ... | @@ -44,20 +44,20 @@ | ... | @@ -44,20 +44,20 @@ |
| 44 | 44 | ||
| 45 | using namespace llvm; | 45 | using namespace llvm; |
| 46 | 46 | ||
| 47 | void LLVMZigInitializeLoopStrengthReducePass(LLVMPassRegistryRef R) { | 47 | void ZigLLVMInitializeLoopStrengthReducePass(LLVMPassRegistryRef R) { |
| 48 | initializeLoopStrengthReducePass(*unwrap(R)); | 48 | initializeLoopStrengthReducePass(*unwrap(R)); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | void LLVMZigInitializeLowerIntrinsicsPass(LLVMPassRegistryRef R) { | 51 | void ZigLLVMInitializeLowerIntrinsicsPass(LLVMPassRegistryRef R) { |
| 52 | initializeLowerIntrinsicsPass(*unwrap(R)); | 52 | initializeLowerIntrinsicsPass(*unwrap(R)); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | char *LLVMZigGetHostCPUName(void) { | 55 | char *ZigLLVMGetHostCPUName(void) { |
| 56 | std::string str = sys::getHostCPUName(); | 56 | std::string str = sys::getHostCPUName(); |
| 57 | return strdup(str.c_str()); | 57 | return strdup(str.c_str()); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | char *LLVMZigGetNativeFeatures(void) { | 60 | char *ZigLLVMGetNativeFeatures(void) { |
| 61 | SubtargetFeatures features; | 61 | SubtargetFeatures features; |
| 62 | 62 | ||
| 63 | StringMap<bool> host_features; | 63 | StringMap<bool> host_features; |
| ... | @@ -74,7 +74,7 @@ static void addAddDiscriminatorsPass(const PassManagerBuilder &Builder, legacy:: | ... | @@ -74,7 +74,7 @@ static void addAddDiscriminatorsPass(const PassManagerBuilder &Builder, legacy:: |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | 76 | ||
| 77 | void LLVMZigOptimizeModule(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref) { | 77 | void ZigLLVMOptimizeModule(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref) { |
| 78 | TargetMachine* target_machine = reinterpret_cast<TargetMachine*>(targ_machine_ref); | 78 | TargetMachine* target_machine = reinterpret_cast<TargetMachine*>(targ_machine_ref); |
| 79 | Module* module = unwrap(module_ref); | 79 | Module* module = unwrap(module_ref); |
| 80 | TargetLibraryInfoImpl tlii(Triple(module->getTargetTriple())); | 80 | TargetLibraryInfoImpl tlii(Triple(module->getTargetTriple())); |
| ... | @@ -129,7 +129,7 @@ void LLVMZigOptimizeModule(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef | ... | @@ -129,7 +129,7 @@ void LLVMZigOptimizeModule(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef |
| 129 | MPM->run(*module); | 129 | MPM->run(*module); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | LLVMValueRef LLVMZigBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args, | 132 | LLVMValueRef ZigLLVMBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args, |
| 133 | unsigned NumArgs, unsigned CC, const char *Name) | 133 | unsigned NumArgs, unsigned CC, const char *Name) |
| 134 | { | 134 | { |
| 135 | CallInst *call_inst = CallInst::Create(unwrap(Fn), makeArrayRef(unwrap(Args), NumArgs), Name); | 135 | CallInst *call_inst = CallInst::Create(unwrap(Fn), makeArrayRef(unwrap(Args), NumArgs), Name); |
| ... | @@ -137,7 +137,7 @@ LLVMValueRef LLVMZigBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *A | ... | @@ -137,7 +137,7 @@ LLVMValueRef LLVMZigBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *A |
| 137 | return wrap(unwrap(B)->Insert(call_inst)); | 137 | return wrap(unwrap(B)->Insert(call_inst)); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | void LLVMZigAddNonNullAttr(LLVMValueRef fn, unsigned i) | 140 | void ZigLLVMAddNonNullAttr(LLVMValueRef fn, unsigned i) |
| 141 | { | 141 | { |
| 142 | assert( isa<Function>(unwrap(fn)) ); | 142 | assert( isa<Function>(unwrap(fn)) ); |
| 143 | 143 | ||
| ... | @@ -146,31 +146,31 @@ void LLVMZigAddNonNullAttr(LLVMValueRef fn, unsigned i) | ... | @@ -146,31 +146,31 @@ void LLVMZigAddNonNullAttr(LLVMValueRef fn, unsigned i) |
| 146 | unwrapped_function->addAttribute(i, Attribute::NonNull); | 146 | unwrapped_function->addAttribute(i, Attribute::NonNull); |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | void ZigLLVMFnSetSubprogram(LLVMValueRef fn, LLVMZigDISubprogram *subprogram) { | 149 | void ZigLLVMFnSetSubprogram(LLVMValueRef fn, ZigLLVMDISubprogram *subprogram) { |
| 150 | assert( isa<Function>(unwrap(fn)) ); | 150 | assert( isa<Function>(unwrap(fn)) ); |
| 151 | Function *unwrapped_function = reinterpret_cast<Function*>(unwrap(fn)); | 151 | Function *unwrapped_function = reinterpret_cast<Function*>(unwrap(fn)); |
| 152 | unwrapped_function->setSubprogram(reinterpret_cast<DISubprogram*>(subprogram)); | 152 | unwrapped_function->setSubprogram(reinterpret_cast<DISubprogram*>(subprogram)); |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | 155 | ||
| 156 | LLVMZigDIType *LLVMZigCreateDebugPointerType(LLVMZigDIBuilder *dibuilder, LLVMZigDIType *pointee_type, | 156 | ZigLLVMDIType *ZigLLVMCreateDebugPointerType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIType *pointee_type, |
| 157 | uint64_t size_in_bits, uint64_t align_in_bits, const char *name) | 157 | uint64_t size_in_bits, uint64_t align_in_bits, const char *name) |
| 158 | { | 158 | { |
| 159 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createPointerType( | 159 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createPointerType( |
| 160 | reinterpret_cast<DIType*>(pointee_type), size_in_bits, align_in_bits, name); | 160 | reinterpret_cast<DIType*>(pointee_type), size_in_bits, align_in_bits, name); |
| 161 | return reinterpret_cast<LLVMZigDIType*>(di_type); | 161 | return reinterpret_cast<ZigLLVMDIType*>(di_type); |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | LLVMZigDIType *LLVMZigCreateDebugBasicType(LLVMZigDIBuilder *dibuilder, const char *name, | 164 | ZigLLVMDIType *ZigLLVMCreateDebugBasicType(ZigLLVMDIBuilder *dibuilder, const char *name, |
| 165 | uint64_t size_in_bits, uint64_t align_in_bits, unsigned encoding) | 165 | uint64_t size_in_bits, uint64_t align_in_bits, unsigned encoding) |
| 166 | { | 166 | { |
| 167 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createBasicType( | 167 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createBasicType( |
| 168 | name, size_in_bits, align_in_bits, encoding); | 168 | name, size_in_bits, align_in_bits, encoding); |
| 169 | return reinterpret_cast<LLVMZigDIType*>(di_type); | 169 | return reinterpret_cast<ZigLLVMDIType*>(di_type); |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | LLVMZigDIType *LLVMZigCreateDebugArrayType(LLVMZigDIBuilder *dibuilder, uint64_t size_in_bits, | 172 | ZigLLVMDIType *ZigLLVMCreateDebugArrayType(ZigLLVMDIBuilder *dibuilder, uint64_t size_in_bits, |
| 173 | uint64_t align_in_bits, LLVMZigDIType *elem_type, int elem_count) | 173 | uint64_t align_in_bits, ZigLLVMDIType *elem_type, int elem_count) |
| 174 | { | 174 | { |
| 175 | SmallVector<Metadata *, 1> subrange; | 175 | SmallVector<Metadata *, 1> subrange; |
| 176 | subrange.push_back(reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateSubrange(0, elem_count)); | 176 | subrange.push_back(reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateSubrange(0, elem_count)); |
| ... | @@ -178,18 +178,18 @@ LLVMZigDIType *LLVMZigCreateDebugArrayType(LLVMZigDIBuilder *dibuilder, uint64_t | ... | @@ -178,18 +178,18 @@ LLVMZigDIType *LLVMZigCreateDebugArrayType(LLVMZigDIBuilder *dibuilder, uint64_t |
| 178 | size_in_bits, align_in_bits, | 178 | size_in_bits, align_in_bits, |
| 179 | reinterpret_cast<DIType*>(elem_type), | 179 | reinterpret_cast<DIType*>(elem_type), |
| 180 | reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateArray(subrange)); | 180 | reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateArray(subrange)); |
| 181 | return reinterpret_cast<LLVMZigDIType*>(di_type); | 181 | return reinterpret_cast<ZigLLVMDIType*>(di_type); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | LLVMZigDIEnumerator *LLVMZigCreateDebugEnumerator(LLVMZigDIBuilder *dibuilder, const char *name, int64_t val) { | 184 | ZigLLVMDIEnumerator *ZigLLVMCreateDebugEnumerator(ZigLLVMDIBuilder *dibuilder, const char *name, int64_t val) { |
| 185 | DIEnumerator *di_enumerator = reinterpret_cast<DIBuilder*>(dibuilder)->createEnumerator(name, val); | 185 | DIEnumerator *di_enumerator = reinterpret_cast<DIBuilder*>(dibuilder)->createEnumerator(name, val); |
| 186 | return reinterpret_cast<LLVMZigDIEnumerator*>(di_enumerator); | 186 | return reinterpret_cast<ZigLLVMDIEnumerator*>(di_enumerator); |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | LLVMZigDIType *LLVMZigCreateDebugEnumerationType(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 189 | ZigLLVMDIType *ZigLLVMCreateDebugEnumerationType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 190 | const char *name, LLVMZigDIFile *file, unsigned line_number, uint64_t size_in_bits, | 190 | const char *name, ZigLLVMDIFile *file, unsigned line_number, uint64_t size_in_bits, |
| 191 | uint64_t align_in_bits, LLVMZigDIEnumerator **enumerator_array, int enumerator_array_len, | 191 | uint64_t align_in_bits, ZigLLVMDIEnumerator **enumerator_array, int enumerator_array_len, |
| 192 | LLVMZigDIType *underlying_type, const char *unique_id) | 192 | ZigLLVMDIType *underlying_type, const char *unique_id) |
| 193 | { | 193 | { |
| 194 | SmallVector<Metadata *, 8> fields; | 194 | SmallVector<Metadata *, 8> fields; |
| 195 | for (int i = 0; i < enumerator_array_len; i += 1) { | 195 | for (int i = 0; i < enumerator_array_len; i += 1) { |
| ... | @@ -204,12 +204,12 @@ LLVMZigDIType *LLVMZigCreateDebugEnumerationType(LLVMZigDIBuilder *dibuilder, LL | ... | @@ -204,12 +204,12 @@ LLVMZigDIType *LLVMZigCreateDebugEnumerationType(LLVMZigDIBuilder *dibuilder, LL |
| 204 | reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateArray(fields), | 204 | reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateArray(fields), |
| 205 | reinterpret_cast<DIType*>(underlying_type), | 205 | reinterpret_cast<DIType*>(underlying_type), |
| 206 | unique_id); | 206 | unique_id); |
| 207 | return reinterpret_cast<LLVMZigDIType*>(di_type); | 207 | return reinterpret_cast<ZigLLVMDIType*>(di_type); |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | LLVMZigDIType *LLVMZigCreateDebugMemberType(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 210 | ZigLLVMDIType *ZigLLVMCreateDebugMemberType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 211 | const char *name, LLVMZigDIFile *file, unsigned line, uint64_t size_in_bits, | 211 | const char *name, ZigLLVMDIFile *file, unsigned line, uint64_t size_in_bits, |
| 212 | uint64_t align_in_bits, uint64_t offset_in_bits, unsigned flags, LLVMZigDIType *type) | 212 | uint64_t align_in_bits, uint64_t offset_in_bits, unsigned flags, ZigLLVMDIType *type) |
| 213 | { | 213 | { |
| 214 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createMemberType( | 214 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createMemberType( |
| 215 | reinterpret_cast<DIScope*>(scope), | 215 | reinterpret_cast<DIScope*>(scope), |
| ... | @@ -217,12 +217,12 @@ LLVMZigDIType *LLVMZigCreateDebugMemberType(LLVMZigDIBuilder *dibuilder, LLVMZig | ... | @@ -217,12 +217,12 @@ LLVMZigDIType *LLVMZigCreateDebugMemberType(LLVMZigDIBuilder *dibuilder, LLVMZig |
| 217 | reinterpret_cast<DIFile*>(file), | 217 | reinterpret_cast<DIFile*>(file), |
| 218 | line, size_in_bits, align_in_bits, offset_in_bits, flags, | 218 | line, size_in_bits, align_in_bits, offset_in_bits, flags, |
| 219 | reinterpret_cast<DIType*>(type)); | 219 | reinterpret_cast<DIType*>(type)); |
| 220 | return reinterpret_cast<LLVMZigDIType*>(di_type); | 220 | return reinterpret_cast<ZigLLVMDIType*>(di_type); |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | LLVMZigDIType *LLVMZigCreateDebugUnionType(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 223 | ZigLLVMDIType *ZigLLVMCreateDebugUnionType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 224 | const char *name, LLVMZigDIFile *file, unsigned line_number, uint64_t size_in_bits, | 224 | const char *name, ZigLLVMDIFile *file, unsigned line_number, uint64_t size_in_bits, |
| 225 | uint64_t align_in_bits, unsigned flags, LLVMZigDIType **types_array, int types_array_len, | 225 | uint64_t align_in_bits, unsigned flags, ZigLLVMDIType **types_array, int types_array_len, |
| 226 | unsigned run_time_lang, const char *unique_id) | 226 | unsigned run_time_lang, const char *unique_id) |
| 227 | { | 227 | { |
| 228 | SmallVector<Metadata *, 8> fields; | 228 | SmallVector<Metadata *, 8> fields; |
| ... | @@ -237,13 +237,13 @@ LLVMZigDIType *LLVMZigCreateDebugUnionType(LLVMZigDIBuilder *dibuilder, LLVMZigD | ... | @@ -237,13 +237,13 @@ LLVMZigDIType *LLVMZigCreateDebugUnionType(LLVMZigDIBuilder *dibuilder, LLVMZigD |
| 237 | line_number, size_in_bits, align_in_bits, flags, | 237 | line_number, size_in_bits, align_in_bits, flags, |
| 238 | reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateArray(fields), | 238 | reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateArray(fields), |
| 239 | run_time_lang, unique_id); | 239 | run_time_lang, unique_id); |
| 240 | return reinterpret_cast<LLVMZigDIType*>(di_type); | 240 | return reinterpret_cast<ZigLLVMDIType*>(di_type); |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | LLVMZigDIType *LLVMZigCreateDebugStructType(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 243 | ZigLLVMDIType *ZigLLVMCreateDebugStructType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 244 | const char *name, LLVMZigDIFile *file, unsigned line_number, uint64_t size_in_bits, | 244 | const char *name, ZigLLVMDIFile *file, unsigned line_number, uint64_t size_in_bits, |
| 245 | uint64_t align_in_bits, unsigned flags, LLVMZigDIType *derived_from, | 245 | uint64_t align_in_bits, unsigned flags, ZigLLVMDIType *derived_from, |
| 246 | LLVMZigDIType **types_array, int types_array_len, unsigned run_time_lang, LLVMZigDIType *vtable_holder, | 246 | ZigLLVMDIType **types_array, int types_array_len, unsigned run_time_lang, ZigLLVMDIType *vtable_holder, |
| 247 | const char *unique_id) | 247 | const char *unique_id) |
| 248 | { | 248 | { |
| 249 | SmallVector<Metadata *, 8> fields; | 249 | SmallVector<Metadata *, 8> fields; |
| ... | @@ -261,41 +261,41 @@ LLVMZigDIType *LLVMZigCreateDebugStructType(LLVMZigDIBuilder *dibuilder, LLVMZig | ... | @@ -261,41 +261,41 @@ LLVMZigDIType *LLVMZigCreateDebugStructType(LLVMZigDIBuilder *dibuilder, LLVMZig |
| 261 | run_time_lang, | 261 | run_time_lang, |
| 262 | reinterpret_cast<DIType*>(vtable_holder), | 262 | reinterpret_cast<DIType*>(vtable_holder), |
| 263 | unique_id); | 263 | unique_id); |
| 264 | return reinterpret_cast<LLVMZigDIType*>(di_type); | 264 | return reinterpret_cast<ZigLLVMDIType*>(di_type); |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | LLVMZigDIType *LLVMZigCreateReplaceableCompositeType(LLVMZigDIBuilder *dibuilder, unsigned tag, | 267 | ZigLLVMDIType *ZigLLVMCreateReplaceableCompositeType(ZigLLVMDIBuilder *dibuilder, unsigned tag, |
| 268 | const char *name, LLVMZigDIScope *scope, LLVMZigDIFile *file, unsigned line) | 268 | const char *name, ZigLLVMDIScope *scope, ZigLLVMDIFile *file, unsigned line) |
| 269 | { | 269 | { |
| 270 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createReplaceableCompositeType( | 270 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createReplaceableCompositeType( |
| 271 | tag, name, | 271 | tag, name, |
| 272 | reinterpret_cast<DIScope*>(scope), | 272 | reinterpret_cast<DIScope*>(scope), |
| 273 | reinterpret_cast<DIFile*>(file), | 273 | reinterpret_cast<DIFile*>(file), |
| 274 | line); | 274 | line); |
| 275 | return reinterpret_cast<LLVMZigDIType*>(di_type); | 275 | return reinterpret_cast<ZigLLVMDIType*>(di_type); |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | LLVMZigDIType *LLVMZigCreateDebugForwardDeclType(LLVMZigDIBuilder *dibuilder, unsigned tag, | 278 | ZigLLVMDIType *ZigLLVMCreateDebugForwardDeclType(ZigLLVMDIBuilder *dibuilder, unsigned tag, |
| 279 | const char *name, LLVMZigDIScope *scope, LLVMZigDIFile *file, unsigned line) | 279 | const char *name, ZigLLVMDIScope *scope, ZigLLVMDIFile *file, unsigned line) |
| 280 | { | 280 | { |
| 281 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createForwardDecl( | 281 | DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createForwardDecl( |
| 282 | tag, name, | 282 | tag, name, |
| 283 | reinterpret_cast<DIScope*>(scope), | 283 | reinterpret_cast<DIScope*>(scope), |
| 284 | reinterpret_cast<DIFile*>(file), | 284 | reinterpret_cast<DIFile*>(file), |
| 285 | line); | 285 | line); |
| 286 | return reinterpret_cast<LLVMZigDIType*>(di_type); | 286 | return reinterpret_cast<ZigLLVMDIType*>(di_type); |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | void LLVMZigReplaceTemporary(LLVMZigDIBuilder *dibuilder, LLVMZigDIType *type, | 289 | void ZigLLVMReplaceTemporary(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIType *type, |
| 290 | LLVMZigDIType *replacement) | 290 | ZigLLVMDIType *replacement) |
| 291 | { | 291 | { |
| 292 | reinterpret_cast<DIBuilder*>(dibuilder)->replaceTemporary( | 292 | reinterpret_cast<DIBuilder*>(dibuilder)->replaceTemporary( |
| 293 | TempDIType(reinterpret_cast<DIType*>(type)), | 293 | TempDIType(reinterpret_cast<DIType*>(type)), |
| 294 | reinterpret_cast<DIType*>(replacement)); | 294 | reinterpret_cast<DIType*>(replacement)); |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | void LLVMZigReplaceDebugArrays(LLVMZigDIBuilder *dibuilder, LLVMZigDIType *type, | 297 | void ZigLLVMReplaceDebugArrays(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIType *type, |
| 298 | LLVMZigDIType **types_array, int types_array_len) | 298 | ZigLLVMDIType **types_array, int types_array_len) |
| 299 | { | 299 | { |
| 300 | SmallVector<Metadata *, 8> fields; | 300 | SmallVector<Metadata *, 8> fields; |
| 301 | for (int i = 0; i < types_array_len; i += 1) { | 301 | for (int i = 0; i < types_array_len; i += 1) { |
| ... | @@ -308,8 +308,8 @@ void LLVMZigReplaceDebugArrays(LLVMZigDIBuilder *dibuilder, LLVMZigDIType *type, | ... | @@ -308,8 +308,8 @@ void LLVMZigReplaceDebugArrays(LLVMZigDIBuilder *dibuilder, LLVMZigDIType *type, |
| 308 | reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateArray(fields)); | 308 | reinterpret_cast<DIBuilder*>(dibuilder)->getOrCreateArray(fields)); |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | LLVMZigDIType *LLVMZigCreateSubroutineType(LLVMZigDIBuilder *dibuilder_wrapped, | 311 | ZigLLVMDIType *ZigLLVMCreateSubroutineType(ZigLLVMDIBuilder *dibuilder_wrapped, |
| 312 | LLVMZigDIType **types_array, int types_array_len, unsigned flags) | 312 | ZigLLVMDIType **types_array, int types_array_len, unsigned flags) |
| 313 | { | 313 | { |
| 314 | SmallVector<Metadata *, 8> types; | 314 | SmallVector<Metadata *, 8> types; |
| 315 | for (int i = 0; i < types_array_len; i += 1) { | 315 | for (int i = 0; i < types_array_len; i += 1) { |
| ... | @@ -321,51 +321,51 @@ LLVMZigDIType *LLVMZigCreateSubroutineType(LLVMZigDIBuilder *dibuilder_wrapped, | ... | @@ -321,51 +321,51 @@ LLVMZigDIType *LLVMZigCreateSubroutineType(LLVMZigDIBuilder *dibuilder_wrapped, |
| 321 | dibuilder->getOrCreateTypeArray(types), | 321 | dibuilder->getOrCreateTypeArray(types), |
| 322 | flags); | 322 | flags); |
| 323 | DIType *ditype = subroutine_type; | 323 | DIType *ditype = subroutine_type; |
| 324 | return reinterpret_cast<LLVMZigDIType*>(ditype); | 324 | return reinterpret_cast<ZigLLVMDIType*>(ditype); |
| 325 | } | 325 | } |
| 326 | 326 | ||
| 327 | unsigned LLVMZigEncoding_DW_ATE_unsigned(void) { | 327 | unsigned ZigLLVMEncoding_DW_ATE_unsigned(void) { |
| 328 | return dwarf::DW_ATE_unsigned; | 328 | return dwarf::DW_ATE_unsigned; |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | unsigned LLVMZigEncoding_DW_ATE_signed(void) { | 331 | unsigned ZigLLVMEncoding_DW_ATE_signed(void) { |
| 332 | return dwarf::DW_ATE_signed; | 332 | return dwarf::DW_ATE_signed; |
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | unsigned LLVMZigEncoding_DW_ATE_float(void) { | 335 | unsigned ZigLLVMEncoding_DW_ATE_float(void) { |
| 336 | return dwarf::DW_ATE_float; | 336 | return dwarf::DW_ATE_float; |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | unsigned LLVMZigEncoding_DW_ATE_boolean(void) { | 339 | unsigned ZigLLVMEncoding_DW_ATE_boolean(void) { |
| 340 | return dwarf::DW_ATE_boolean; | 340 | return dwarf::DW_ATE_boolean; |
| 341 | } | 341 | } |
| 342 | 342 | ||
| 343 | unsigned LLVMZigEncoding_DW_ATE_unsigned_char(void) { | 343 | unsigned ZigLLVMEncoding_DW_ATE_unsigned_char(void) { |
| 344 | return dwarf::DW_ATE_unsigned_char; | 344 | return dwarf::DW_ATE_unsigned_char; |
| 345 | } | 345 | } |
| 346 | 346 | ||
| 347 | unsigned LLVMZigEncoding_DW_ATE_signed_char(void) { | 347 | unsigned ZigLLVMEncoding_DW_ATE_signed_char(void) { |
| 348 | return dwarf::DW_ATE_signed_char; | 348 | return dwarf::DW_ATE_signed_char; |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | unsigned LLVMZigLang_DW_LANG_C99(void) { | 351 | unsigned ZigLLVMLang_DW_LANG_C99(void) { |
| 352 | return dwarf::DW_LANG_C99; | 352 | return dwarf::DW_LANG_C99; |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | unsigned LLVMZigTag_DW_variable(void) { | 355 | unsigned ZigLLVMTag_DW_variable(void) { |
| 356 | return dwarf::DW_TAG_variable; | 356 | return dwarf::DW_TAG_variable; |
| 357 | } | 357 | } |
| 358 | 358 | ||
| 359 | unsigned LLVMZigTag_DW_structure_type(void) { | 359 | unsigned ZigLLVMTag_DW_structure_type(void) { |
| 360 | return dwarf::DW_TAG_structure_type; | 360 | return dwarf::DW_TAG_structure_type; |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | LLVMZigDIBuilder *LLVMZigCreateDIBuilder(LLVMModuleRef module, bool allow_unresolved) { | 363 | ZigLLVMDIBuilder *ZigLLVMCreateDIBuilder(LLVMModuleRef module, bool allow_unresolved) { |
| 364 | DIBuilder *di_builder = new DIBuilder(*unwrap(module), allow_unresolved); | 364 | DIBuilder *di_builder = new DIBuilder(*unwrap(module), allow_unresolved); |
| 365 | return reinterpret_cast<LLVMZigDIBuilder *>(di_builder); | 365 | return reinterpret_cast<ZigLLVMDIBuilder *>(di_builder); |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | void ZigLLVMSetCurrentDebugLocation(LLVMBuilderRef builder, int line, int column, LLVMZigDIScope *scope) { | 368 | void ZigLLVMSetCurrentDebugLocation(LLVMBuilderRef builder, int line, int column, ZigLLVMDIScope *scope) { |
| 369 | unwrap(builder)->SetCurrentDebugLocation(DebugLoc::get( | 369 | unwrap(builder)->SetCurrentDebugLocation(DebugLoc::get( |
| 370 | line, column, reinterpret_cast<DIScope*>(scope))); | 370 | line, column, reinterpret_cast<DIScope*>(scope))); |
| 371 | } | 371 | } |
| ... | @@ -375,20 +375,20 @@ void ZigLLVMClearCurrentDebugLocation(LLVMBuilderRef builder) { | ... | @@ -375,20 +375,20 @@ void ZigLLVMClearCurrentDebugLocation(LLVMBuilderRef builder) { |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | 377 | ||
| 378 | LLVMZigDILexicalBlock *LLVMZigCreateLexicalBlock(LLVMZigDIBuilder *dbuilder, LLVMZigDIScope *scope, | 378 | ZigLLVMDILexicalBlock *ZigLLVMCreateLexicalBlock(ZigLLVMDIBuilder *dbuilder, ZigLLVMDIScope *scope, |
| 379 | LLVMZigDIFile *file, unsigned line, unsigned col) | 379 | ZigLLVMDIFile *file, unsigned line, unsigned col) |
| 380 | { | 380 | { |
| 381 | DILexicalBlock *result = reinterpret_cast<DIBuilder*>(dbuilder)->createLexicalBlock( | 381 | DILexicalBlock *result = reinterpret_cast<DIBuilder*>(dbuilder)->createLexicalBlock( |
| 382 | reinterpret_cast<DIScope*>(scope), | 382 | reinterpret_cast<DIScope*>(scope), |
| 383 | reinterpret_cast<DIFile*>(file), | 383 | reinterpret_cast<DIFile*>(file), |
| 384 | line, | 384 | line, |
| 385 | col); | 385 | col); |
| 386 | return reinterpret_cast<LLVMZigDILexicalBlock*>(result); | 386 | return reinterpret_cast<ZigLLVMDILexicalBlock*>(result); |
| 387 | } | 387 | } |
| 388 | 388 | ||
| 389 | LLVMZigDILocalVariable *LLVMZigCreateAutoVariable(LLVMZigDIBuilder *dbuilder, | 389 | ZigLLVMDILocalVariable *ZigLLVMCreateAutoVariable(ZigLLVMDIBuilder *dbuilder, |
| 390 | LLVMZigDIScope *scope, const char *name, LLVMZigDIFile *file, unsigned line_no, | 390 | ZigLLVMDIScope *scope, const char *name, ZigLLVMDIFile *file, unsigned line_no, |
| 391 | LLVMZigDIType *type, bool always_preserve, unsigned flags) | 391 | ZigLLVMDIType *type, bool always_preserve, unsigned flags) |
| 392 | { | 392 | { |
| 393 | DILocalVariable *result = reinterpret_cast<DIBuilder*>(dbuilder)->createAutoVariable( | 393 | DILocalVariable *result = reinterpret_cast<DIBuilder*>(dbuilder)->createAutoVariable( |
| 394 | reinterpret_cast<DIScope*>(scope), | 394 | reinterpret_cast<DIScope*>(scope), |
| ... | @@ -398,12 +398,12 @@ LLVMZigDILocalVariable *LLVMZigCreateAutoVariable(LLVMZigDIBuilder *dbuilder, | ... | @@ -398,12 +398,12 @@ LLVMZigDILocalVariable *LLVMZigCreateAutoVariable(LLVMZigDIBuilder *dbuilder, |
| 398 | reinterpret_cast<DIType*>(type), | 398 | reinterpret_cast<DIType*>(type), |
| 399 | always_preserve, | 399 | always_preserve, |
| 400 | flags); | 400 | flags); |
| 401 | return reinterpret_cast<LLVMZigDILocalVariable*>(result); | 401 | return reinterpret_cast<ZigLLVMDILocalVariable*>(result); |
| 402 | } | 402 | } |
| 403 | 403 | ||
| 404 | LLVMZigDIGlobalVariable *LLVMZigCreateGlobalVariable(LLVMZigDIBuilder *dbuilder, | 404 | ZigLLVMDIGlobalVariable *ZigLLVMCreateGlobalVariable(ZigLLVMDIBuilder *dbuilder, |
| 405 | LLVMZigDIScope *scope, const char *name, const char *linkage_name, LLVMZigDIFile *file, | 405 | ZigLLVMDIScope *scope, const char *name, const char *linkage_name, ZigLLVMDIFile *file, |
| 406 | unsigned line_no, LLVMZigDIType *di_type, bool is_local_to_unit, LLVMValueRef constant_val) | 406 | unsigned line_no, ZigLLVMDIType *di_type, bool is_local_to_unit, LLVMValueRef constant_val) |
| 407 | { | 407 | { |
| 408 | DIGlobalVariable *result = reinterpret_cast<DIBuilder*>(dbuilder)->createGlobalVariable( | 408 | DIGlobalVariable *result = reinterpret_cast<DIBuilder*>(dbuilder)->createGlobalVariable( |
| 409 | reinterpret_cast<DIScope*>(scope), | 409 | reinterpret_cast<DIScope*>(scope), |
| ... | @@ -414,12 +414,12 @@ LLVMZigDIGlobalVariable *LLVMZigCreateGlobalVariable(LLVMZigDIBuilder *dbuilder, | ... | @@ -414,12 +414,12 @@ LLVMZigDIGlobalVariable *LLVMZigCreateGlobalVariable(LLVMZigDIBuilder *dbuilder, |
| 414 | reinterpret_cast<DIType*>(di_type), | 414 | reinterpret_cast<DIType*>(di_type), |
| 415 | is_local_to_unit, | 415 | is_local_to_unit, |
| 416 | reinterpret_cast<llvm::Constant *>(constant_val)); | 416 | reinterpret_cast<llvm::Constant *>(constant_val)); |
| 417 | return reinterpret_cast<LLVMZigDIGlobalVariable*>(result); | 417 | return reinterpret_cast<ZigLLVMDIGlobalVariable*>(result); |
| 418 | } | 418 | } |
| 419 | 419 | ||
| 420 | LLVMZigDILocalVariable *LLVMZigCreateParameterVariable(LLVMZigDIBuilder *dbuilder, | 420 | ZigLLVMDILocalVariable *ZigLLVMCreateParameterVariable(ZigLLVMDIBuilder *dbuilder, |
| 421 | LLVMZigDIScope *scope, const char *name, LLVMZigDIFile *file, unsigned line_no, | 421 | ZigLLVMDIScope *scope, const char *name, ZigLLVMDIFile *file, unsigned line_no, |
| 422 | LLVMZigDIType *type, bool always_preserve, unsigned flags, unsigned arg_no) | 422 | ZigLLVMDIType *type, bool always_preserve, unsigned flags, unsigned arg_no) |
| 423 | { | 423 | { |
| 424 | DILocalVariable *result = reinterpret_cast<DIBuilder*>(dbuilder)->createParameterVariable( | 424 | DILocalVariable *result = reinterpret_cast<DIBuilder*>(dbuilder)->createParameterVariable( |
| 425 | reinterpret_cast<DIScope*>(scope), | 425 | reinterpret_cast<DIScope*>(scope), |
| ... | @@ -430,54 +430,54 @@ LLVMZigDILocalVariable *LLVMZigCreateParameterVariable(LLVMZigDIBuilder *dbuilde | ... | @@ -430,54 +430,54 @@ LLVMZigDILocalVariable *LLVMZigCreateParameterVariable(LLVMZigDIBuilder *dbuilde |
| 430 | reinterpret_cast<DIType*>(type), | 430 | reinterpret_cast<DIType*>(type), |
| 431 | always_preserve, | 431 | always_preserve, |
| 432 | flags); | 432 | flags); |
| 433 | return reinterpret_cast<LLVMZigDILocalVariable*>(result); | 433 | return reinterpret_cast<ZigLLVMDILocalVariable*>(result); |
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | LLVMZigDIScope *LLVMZigLexicalBlockToScope(LLVMZigDILexicalBlock *lexical_block) { | 436 | ZigLLVMDIScope *ZigLLVMLexicalBlockToScope(ZigLLVMDILexicalBlock *lexical_block) { |
| 437 | DIScope *scope = reinterpret_cast<DILexicalBlock*>(lexical_block); | 437 | DIScope *scope = reinterpret_cast<DILexicalBlock*>(lexical_block); |
| 438 | return reinterpret_cast<LLVMZigDIScope*>(scope); | 438 | return reinterpret_cast<ZigLLVMDIScope*>(scope); |
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | LLVMZigDIScope *LLVMZigCompileUnitToScope(LLVMZigDICompileUnit *compile_unit) { | 441 | ZigLLVMDIScope *ZigLLVMCompileUnitToScope(ZigLLVMDICompileUnit *compile_unit) { |
| 442 | DIScope *scope = reinterpret_cast<DICompileUnit*>(compile_unit); | 442 | DIScope *scope = reinterpret_cast<DICompileUnit*>(compile_unit); |
| 443 | return reinterpret_cast<LLVMZigDIScope*>(scope); | 443 | return reinterpret_cast<ZigLLVMDIScope*>(scope); |
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | LLVMZigDIScope *LLVMZigFileToScope(LLVMZigDIFile *difile) { | 446 | ZigLLVMDIScope *ZigLLVMFileToScope(ZigLLVMDIFile *difile) { |
| 447 | DIScope *scope = reinterpret_cast<DIFile*>(difile); | 447 | DIScope *scope = reinterpret_cast<DIFile*>(difile); |
| 448 | return reinterpret_cast<LLVMZigDIScope*>(scope); | 448 | return reinterpret_cast<ZigLLVMDIScope*>(scope); |
| 449 | } | 449 | } |
| 450 | 450 | ||
| 451 | LLVMZigDIScope *LLVMZigSubprogramToScope(LLVMZigDISubprogram *subprogram) { | 451 | ZigLLVMDIScope *ZigLLVMSubprogramToScope(ZigLLVMDISubprogram *subprogram) { |
| 452 | DIScope *scope = reinterpret_cast<DISubprogram*>(subprogram); | 452 | DIScope *scope = reinterpret_cast<DISubprogram*>(subprogram); |
| 453 | return reinterpret_cast<LLVMZigDIScope*>(scope); | 453 | return reinterpret_cast<ZigLLVMDIScope*>(scope); |
| 454 | } | 454 | } |
| 455 | 455 | ||
| 456 | LLVMZigDIScope *LLVMZigTypeToScope(LLVMZigDIType *type) { | 456 | ZigLLVMDIScope *ZigLLVMTypeToScope(ZigLLVMDIType *type) { |
| 457 | DIScope *scope = reinterpret_cast<DIType*>(type); | 457 | DIScope *scope = reinterpret_cast<DIType*>(type); |
| 458 | return reinterpret_cast<LLVMZigDIScope*>(scope); | 458 | return reinterpret_cast<ZigLLVMDIScope*>(scope); |
| 459 | } | 459 | } |
| 460 | 460 | ||
| 461 | LLVMZigDICompileUnit *LLVMZigCreateCompileUnit(LLVMZigDIBuilder *dibuilder, | 461 | ZigLLVMDICompileUnit *ZigLLVMCreateCompileUnit(ZigLLVMDIBuilder *dibuilder, |
| 462 | unsigned lang, const char *file, const char *dir, const char *producer, | 462 | unsigned lang, const char *file, const char *dir, const char *producer, |
| 463 | bool is_optimized, const char *flags, unsigned runtime_version, const char *split_name, | 463 | bool is_optimized, const char *flags, unsigned runtime_version, const char *split_name, |
| 464 | uint64_t dwo_id, bool emit_debug_info) | 464 | uint64_t dwo_id, bool emit_debug_info) |
| 465 | { | 465 | { |
| 466 | DICompileUnit *result = reinterpret_cast<DIBuilder*>(dibuilder)->createCompileUnit( | 466 | DICompileUnit *result = reinterpret_cast<DIBuilder*>(dibuilder)->createCompileUnit( |
| 467 | lang, file, dir, producer, is_optimized, flags, runtime_version, split_name); | 467 | lang, file, dir, producer, is_optimized, flags, runtime_version, split_name); |
| 468 | return reinterpret_cast<LLVMZigDICompileUnit*>(result); | 468 | return reinterpret_cast<ZigLLVMDICompileUnit*>(result); |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | 471 | ||
| 472 | LLVMZigDIFile *LLVMZigCreateFile(LLVMZigDIBuilder *dibuilder, const char *filename, const char *directory) { | 472 | ZigLLVMDIFile *ZigLLVMCreateFile(ZigLLVMDIBuilder *dibuilder, const char *filename, const char *directory) { |
| 473 | DIFile *result = reinterpret_cast<DIBuilder*>(dibuilder)->createFile(filename, directory); | 473 | DIFile *result = reinterpret_cast<DIBuilder*>(dibuilder)->createFile(filename, directory); |
| 474 | return reinterpret_cast<LLVMZigDIFile*>(result); | 474 | return reinterpret_cast<ZigLLVMDIFile*>(result); |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | LLVMZigDISubprogram *LLVMZigCreateFunction(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 477 | ZigLLVMDISubprogram *ZigLLVMCreateFunction(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 478 | const char *name, const char *linkage_name, LLVMZigDIFile *file, unsigned lineno, | 478 | const char *name, const char *linkage_name, ZigLLVMDIFile *file, unsigned lineno, |
| 479 | LLVMZigDIType *fn_di_type, bool is_local_to_unit, bool is_definition, unsigned scope_line, | 479 | ZigLLVMDIType *fn_di_type, bool is_local_to_unit, bool is_definition, unsigned scope_line, |
| 480 | unsigned flags, bool is_optimized, LLVMZigDISubprogram *decl_subprogram) | 480 | unsigned flags, bool is_optimized, ZigLLVMDISubprogram *decl_subprogram) |
| 481 | { | 481 | { |
| 482 | DISubroutineType *di_sub_type = static_cast<DISubroutineType*>(reinterpret_cast<DIType*>(fn_di_type)); | 482 | DISubroutineType *di_sub_type = static_cast<DISubroutineType*>(reinterpret_cast<DIType*>(fn_di_type)); |
| 483 | DISubprogram *result = reinterpret_cast<DIBuilder*>(dibuilder)->createFunction( | 483 | DISubprogram *result = reinterpret_cast<DIBuilder*>(dibuilder)->createFunction( |
| ... | @@ -489,26 +489,26 @@ LLVMZigDISubprogram *LLVMZigCreateFunction(LLVMZigDIBuilder *dibuilder, LLVMZigD | ... | @@ -489,26 +489,26 @@ LLVMZigDISubprogram *LLVMZigCreateFunction(LLVMZigDIBuilder *dibuilder, LLVMZigD |
| 489 | is_local_to_unit, is_definition, scope_line, flags, is_optimized, | 489 | is_local_to_unit, is_definition, scope_line, flags, is_optimized, |
| 490 | nullptr, | 490 | nullptr, |
| 491 | reinterpret_cast<DISubprogram *>(decl_subprogram)); | 491 | reinterpret_cast<DISubprogram *>(decl_subprogram)); |
| 492 | return reinterpret_cast<LLVMZigDISubprogram*>(result); | 492 | return reinterpret_cast<ZigLLVMDISubprogram*>(result); |
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | void LLVMZigDIBuilderFinalize(LLVMZigDIBuilder *dibuilder) { | 495 | void ZigLLVMDIBuilderFinalize(ZigLLVMDIBuilder *dibuilder) { |
| 496 | reinterpret_cast<DIBuilder*>(dibuilder)->finalize(); | 496 | reinterpret_cast<DIBuilder*>(dibuilder)->finalize(); |
| 497 | } | 497 | } |
| 498 | 498 | ||
| 499 | LLVMZigInsertionPoint *LLVMZigSaveInsertPoint(LLVMBuilderRef builder_wrapped) { | 499 | ZigLLVMInsertionPoint *ZigLLVMSaveInsertPoint(LLVMBuilderRef builder_wrapped) { |
| 500 | IRBuilderBase::InsertPoint *ip = new IRBuilderBase::InsertPoint(); | 500 | IRBuilderBase::InsertPoint *ip = new IRBuilderBase::InsertPoint(); |
| 501 | *ip = unwrap(builder_wrapped)->saveIP(); | 501 | *ip = unwrap(builder_wrapped)->saveIP(); |
| 502 | return reinterpret_cast<LLVMZigInsertionPoint*>(ip); | 502 | return reinterpret_cast<ZigLLVMInsertionPoint*>(ip); |
| 503 | } | 503 | } |
| 504 | 504 | ||
| 505 | void LLVMZigRestoreInsertPoint(LLVMBuilderRef builder, LLVMZigInsertionPoint *ip_wrapped) { | 505 | void ZigLLVMRestoreInsertPoint(LLVMBuilderRef builder, ZigLLVMInsertionPoint *ip_wrapped) { |
| 506 | IRBuilderBase::InsertPoint *ip = reinterpret_cast<IRBuilderBase::InsertPoint*>(ip_wrapped); | 506 | IRBuilderBase::InsertPoint *ip = reinterpret_cast<IRBuilderBase::InsertPoint*>(ip_wrapped); |
| 507 | unwrap(builder)->restoreIP(*ip); | 507 | unwrap(builder)->restoreIP(*ip); |
| 508 | } | 508 | } |
| 509 | 509 | ||
| 510 | LLVMValueRef LLVMZigInsertDeclareAtEnd(LLVMZigDIBuilder *dibuilder, LLVMValueRef storage, | 510 | LLVMValueRef ZigLLVMInsertDeclareAtEnd(ZigLLVMDIBuilder *dibuilder, LLVMValueRef storage, |
| 511 | LLVMZigDILocalVariable *var_info, LLVMZigDILocation *debug_loc, LLVMBasicBlockRef basic_block_ref) | 511 | ZigLLVMDILocalVariable *var_info, ZigLLVMDILocation *debug_loc, LLVMBasicBlockRef basic_block_ref) |
| 512 | { | 512 | { |
| 513 | Instruction *result = reinterpret_cast<DIBuilder*>(dibuilder)->insertDeclare( | 513 | Instruction *result = reinterpret_cast<DIBuilder*>(dibuilder)->insertDeclare( |
| 514 | unwrap(storage), | 514 | unwrap(storage), |
| ... | @@ -519,8 +519,8 @@ LLVMValueRef LLVMZigInsertDeclareAtEnd(LLVMZigDIBuilder *dibuilder, LLVMValueRef | ... | @@ -519,8 +519,8 @@ LLVMValueRef LLVMZigInsertDeclareAtEnd(LLVMZigDIBuilder *dibuilder, LLVMValueRef |
| 519 | return wrap(result); | 519 | return wrap(result); |
| 520 | } | 520 | } |
| 521 | 521 | ||
| 522 | LLVMValueRef LLVMZigInsertDeclare(LLVMZigDIBuilder *dibuilder, LLVMValueRef storage, | 522 | LLVMValueRef ZigLLVMInsertDeclare(ZigLLVMDIBuilder *dibuilder, LLVMValueRef storage, |
| 523 | LLVMZigDILocalVariable *var_info, LLVMZigDILocation *debug_loc, LLVMValueRef insert_before_instr) | 523 | ZigLLVMDILocalVariable *var_info, ZigLLVMDILocation *debug_loc, LLVMValueRef insert_before_instr) |
| 524 | { | 524 | { |
| 525 | Instruction *result = reinterpret_cast<DIBuilder*>(dibuilder)->insertDeclare( | 525 | Instruction *result = reinterpret_cast<DIBuilder*>(dibuilder)->insertDeclare( |
| 526 | unwrap(storage), | 526 | unwrap(storage), |
| ... | @@ -531,12 +531,12 @@ LLVMValueRef LLVMZigInsertDeclare(LLVMZigDIBuilder *dibuilder, LLVMValueRef stor | ... | @@ -531,12 +531,12 @@ LLVMValueRef LLVMZigInsertDeclare(LLVMZigDIBuilder *dibuilder, LLVMValueRef stor |
| 531 | return wrap(result); | 531 | return wrap(result); |
| 532 | } | 532 | } |
| 533 | 533 | ||
| 534 | LLVMZigDILocation *LLVMZigGetDebugLoc(unsigned line, unsigned col, LLVMZigDIScope *scope) { | 534 | ZigLLVMDILocation *ZigLLVMGetDebugLoc(unsigned line, unsigned col, ZigLLVMDIScope *scope) { |
| 535 | DebugLoc debug_loc = DebugLoc::get(line, col, reinterpret_cast<DIScope*>(scope), nullptr); | 535 | DebugLoc debug_loc = DebugLoc::get(line, col, reinterpret_cast<DIScope*>(scope), nullptr); |
| 536 | return reinterpret_cast<LLVMZigDILocation*>(debug_loc.get()); | 536 | return reinterpret_cast<ZigLLVMDILocation*>(debug_loc.get()); |
| 537 | } | 537 | } |
| 538 | 538 | ||
| 539 | void LLVMZigSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state) { | 539 | void ZigLLVMSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state) { |
| 540 | if (on_state) { | 540 | if (on_state) { |
| 541 | FastMathFlags fmf; | 541 | FastMathFlags fmf; |
| 542 | fmf.setUnsafeAlgebra(); | 542 | fmf.setUnsafeAlgebra(); |
src/zig_llvm.hpp+96-96| ... | @@ -14,29 +14,29 @@ | ... | @@ -14,29 +14,29 @@ |
| 14 | #include <llvm-c/Initialization.h> | 14 | #include <llvm-c/Initialization.h> |
| 15 | #include <llvm-c/TargetMachine.h> | 15 | #include <llvm-c/TargetMachine.h> |
| 16 | 16 | ||
| 17 | struct LLVMZigDIType; | 17 | struct ZigLLVMDIType; |
| 18 | struct LLVMZigDIBuilder; | 18 | struct ZigLLVMDIBuilder; |
| 19 | struct LLVMZigDICompileUnit; | 19 | struct ZigLLVMDICompileUnit; |
| 20 | struct LLVMZigDIScope; | 20 | struct ZigLLVMDIScope; |
| 21 | struct LLVMZigDIFile; | 21 | struct ZigLLVMDIFile; |
| 22 | struct LLVMZigDILexicalBlock; | 22 | struct ZigLLVMDILexicalBlock; |
| 23 | struct LLVMZigDISubprogram; | 23 | struct ZigLLVMDISubprogram; |
| 24 | struct LLVMZigDISubroutineType; | 24 | struct ZigLLVMDISubroutineType; |
| 25 | struct LLVMZigDILocalVariable; | 25 | struct ZigLLVMDILocalVariable; |
| 26 | struct LLVMZigDIGlobalVariable; | 26 | struct ZigLLVMDIGlobalVariable; |
| 27 | struct LLVMZigDILocation; | 27 | struct ZigLLVMDILocation; |
| 28 | struct LLVMZigDIEnumerator; | 28 | struct ZigLLVMDIEnumerator; |
| 29 | struct LLVMZigInsertionPoint; | 29 | struct ZigLLVMInsertionPoint; |
| 30 | 30 | ||
| 31 | void LLVMZigInitializeLoopStrengthReducePass(LLVMPassRegistryRef R); | 31 | void ZigLLVMInitializeLoopStrengthReducePass(LLVMPassRegistryRef R); |
| 32 | void LLVMZigInitializeLowerIntrinsicsPass(LLVMPassRegistryRef R); | 32 | void ZigLLVMInitializeLowerIntrinsicsPass(LLVMPassRegistryRef R); |
| 33 | 33 | ||
| 34 | char *LLVMZigGetHostCPUName(void); | 34 | char *ZigLLVMGetHostCPUName(void); |
| 35 | char *LLVMZigGetNativeFeatures(void); | 35 | char *ZigLLVMGetNativeFeatures(void); |
| 36 | 36 | ||
| 37 | void LLVMZigOptimizeModule(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref); | 37 | void ZigLLVMOptimizeModule(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref); |
| 38 | 38 | ||
| 39 | LLVMValueRef LLVMZigBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args, | 39 | LLVMValueRef ZigLLVMBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args, |
| 40 | unsigned NumArgs, unsigned CC, const char *Name); | 40 | unsigned NumArgs, unsigned CC, const char *Name); |
| 41 | 41 | ||
| 42 | LLVMValueRef ZigLLVMBuildCmpXchg(LLVMBuilderRef builder, LLVMValueRef ptr, LLVMValueRef cmp, | 42 | LLVMValueRef ZigLLVMBuildCmpXchg(LLVMBuilderRef builder, LLVMValueRef ptr, LLVMValueRef cmp, |
| ... | @@ -51,118 +51,118 @@ LLVMValueRef ZigLLVMBuildExactUDiv(LLVMBuilderRef B, LLVMValueRef LHS, | ... | @@ -51,118 +51,118 @@ LLVMValueRef ZigLLVMBuildExactUDiv(LLVMBuilderRef B, LLVMValueRef LHS, |
| 51 | LLVMValueRef RHS, const char *Name); | 51 | LLVMValueRef RHS, const char *Name); |
| 52 | 52 | ||
| 53 | // 0 is return value, 1 is first arg | 53 | // 0 is return value, 1 is first arg |
| 54 | void LLVMZigAddNonNullAttr(LLVMValueRef fn, unsigned i); | 54 | void ZigLLVMAddNonNullAttr(LLVMValueRef fn, unsigned i); |
| 55 | 55 | ||
| 56 | LLVMZigDIType *LLVMZigCreateDebugPointerType(LLVMZigDIBuilder *dibuilder, LLVMZigDIType *pointee_type, | 56 | ZigLLVMDIType *ZigLLVMCreateDebugPointerType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIType *pointee_type, |
| 57 | uint64_t size_in_bits, uint64_t align_in_bits, const char *name); | 57 | uint64_t size_in_bits, uint64_t align_in_bits, const char *name); |
| 58 | 58 | ||
| 59 | LLVMZigDIType *LLVMZigCreateDebugBasicType(LLVMZigDIBuilder *dibuilder, const char *name, | 59 | ZigLLVMDIType *ZigLLVMCreateDebugBasicType(ZigLLVMDIBuilder *dibuilder, const char *name, |
| 60 | uint64_t size_in_bits, uint64_t align_in_bits, unsigned encoding); | 60 | uint64_t size_in_bits, uint64_t align_in_bits, unsigned encoding); |
| 61 | 61 | ||
| 62 | LLVMZigDIType *LLVMZigCreateDebugArrayType(LLVMZigDIBuilder *dibuilder, | 62 | ZigLLVMDIType *ZigLLVMCreateDebugArrayType(ZigLLVMDIBuilder *dibuilder, |
| 63 | uint64_t size_in_bits, uint64_t align_in_bits, LLVMZigDIType *elem_type, | 63 | uint64_t size_in_bits, uint64_t align_in_bits, ZigLLVMDIType *elem_type, |
| 64 | int elem_count); | 64 | int elem_count); |
| 65 | 65 | ||
| 66 | LLVMZigDIEnumerator *LLVMZigCreateDebugEnumerator(LLVMZigDIBuilder *dibuilder, const char *name, int64_t val); | 66 | ZigLLVMDIEnumerator *ZigLLVMCreateDebugEnumerator(ZigLLVMDIBuilder *dibuilder, const char *name, int64_t val); |
| 67 | 67 | ||
| 68 | LLVMZigDIType *LLVMZigCreateDebugEnumerationType(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 68 | ZigLLVMDIType *ZigLLVMCreateDebugEnumerationType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 69 | const char *name, LLVMZigDIFile *file, unsigned line_number, uint64_t size_in_bits, | 69 | const char *name, ZigLLVMDIFile *file, unsigned line_number, uint64_t size_in_bits, |
| 70 | uint64_t align_in_bits, LLVMZigDIEnumerator **enumerator_array, int enumerator_array_len, | 70 | uint64_t align_in_bits, ZigLLVMDIEnumerator **enumerator_array, int enumerator_array_len, |
| 71 | LLVMZigDIType *underlying_type, const char *unique_id); | 71 | ZigLLVMDIType *underlying_type, const char *unique_id); |
| 72 | 72 | ||
| 73 | LLVMZigDIType *LLVMZigCreateDebugStructType(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 73 | ZigLLVMDIType *ZigLLVMCreateDebugStructType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 74 | const char *name, LLVMZigDIFile *file, unsigned line_number, uint64_t size_in_bits, | 74 | const char *name, ZigLLVMDIFile *file, unsigned line_number, uint64_t size_in_bits, |
| 75 | uint64_t align_in_bits, unsigned flags, LLVMZigDIType *derived_from, | 75 | uint64_t align_in_bits, unsigned flags, ZigLLVMDIType *derived_from, |
| 76 | LLVMZigDIType **types_array, int types_array_len, unsigned run_time_lang, LLVMZigDIType *vtable_holder, | 76 | ZigLLVMDIType **types_array, int types_array_len, unsigned run_time_lang, ZigLLVMDIType *vtable_holder, |
| 77 | const char *unique_id); | 77 | const char *unique_id); |
| 78 | 78 | ||
| 79 | LLVMZigDIType *LLVMZigCreateDebugUnionType(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 79 | ZigLLVMDIType *ZigLLVMCreateDebugUnionType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 80 | const char *name, LLVMZigDIFile *file, unsigned line_number, uint64_t size_in_bits, | 80 | const char *name, ZigLLVMDIFile *file, unsigned line_number, uint64_t size_in_bits, |
| 81 | uint64_t align_in_bits, unsigned flags, LLVMZigDIType **types_array, int types_array_len, | 81 | uint64_t align_in_bits, unsigned flags, ZigLLVMDIType **types_array, int types_array_len, |
| 82 | unsigned run_time_lang, const char *unique_id); | 82 | unsigned run_time_lang, const char *unique_id); |
| 83 | 83 | ||
| 84 | LLVMZigDIType *LLVMZigCreateDebugMemberType(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 84 | ZigLLVMDIType *ZigLLVMCreateDebugMemberType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 85 | const char *name, LLVMZigDIFile *file, unsigned line, uint64_t size_in_bits, | 85 | const char *name, ZigLLVMDIFile *file, unsigned line, uint64_t size_in_bits, |
| 86 | uint64_t align_in_bits, uint64_t offset_in_bits, unsigned flags, LLVMZigDIType *type); | 86 | uint64_t align_in_bits, uint64_t offset_in_bits, unsigned flags, ZigLLVMDIType *type); |
| 87 | 87 | ||
| 88 | LLVMZigDIType *LLVMZigCreateReplaceableCompositeType(LLVMZigDIBuilder *dibuilder, unsigned tag, | 88 | ZigLLVMDIType *ZigLLVMCreateReplaceableCompositeType(ZigLLVMDIBuilder *dibuilder, unsigned tag, |
| 89 | const char *name, LLVMZigDIScope *scope, LLVMZigDIFile *file, unsigned line); | 89 | const char *name, ZigLLVMDIScope *scope, ZigLLVMDIFile *file, unsigned line); |
| 90 | 90 | ||
| 91 | LLVMZigDIType *LLVMZigCreateDebugForwardDeclType(LLVMZigDIBuilder *dibuilder, unsigned tag, | 91 | ZigLLVMDIType *ZigLLVMCreateDebugForwardDeclType(ZigLLVMDIBuilder *dibuilder, unsigned tag, |
| 92 | const char *name, LLVMZigDIScope *scope, LLVMZigDIFile *file, unsigned line); | 92 | const char *name, ZigLLVMDIScope *scope, ZigLLVMDIFile *file, unsigned line); |
| 93 | 93 | ||
| 94 | void LLVMZigReplaceTemporary(LLVMZigDIBuilder *dibuilder, LLVMZigDIType *type, | 94 | void ZigLLVMReplaceTemporary(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIType *type, |
| 95 | LLVMZigDIType *replacement); | 95 | ZigLLVMDIType *replacement); |
| 96 | 96 | ||
| 97 | void LLVMZigReplaceDebugArrays(LLVMZigDIBuilder *dibuilder, LLVMZigDIType *type, | 97 | void ZigLLVMReplaceDebugArrays(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIType *type, |
| 98 | LLVMZigDIType **types_array, int types_array_len); | 98 | ZigLLVMDIType **types_array, int types_array_len); |
| 99 | 99 | ||
| 100 | LLVMZigDIType *LLVMZigCreateSubroutineType(LLVMZigDIBuilder *dibuilder_wrapped, | 100 | ZigLLVMDIType *ZigLLVMCreateSubroutineType(ZigLLVMDIBuilder *dibuilder_wrapped, |
| 101 | LLVMZigDIType **types_array, int types_array_len, unsigned flags); | 101 | ZigLLVMDIType **types_array, int types_array_len, unsigned flags); |
| 102 | 102 | ||
| 103 | unsigned LLVMZigEncoding_DW_ATE_unsigned(void); | 103 | unsigned ZigLLVMEncoding_DW_ATE_unsigned(void); |
| 104 | unsigned LLVMZigEncoding_DW_ATE_signed(void); | 104 | unsigned ZigLLVMEncoding_DW_ATE_signed(void); |
| 105 | unsigned LLVMZigEncoding_DW_ATE_float(void); | 105 | unsigned ZigLLVMEncoding_DW_ATE_float(void); |
| 106 | unsigned LLVMZigEncoding_DW_ATE_boolean(void); | 106 | unsigned ZigLLVMEncoding_DW_ATE_boolean(void); |
| 107 | unsigned LLVMZigEncoding_DW_ATE_unsigned_char(void); | 107 | unsigned ZigLLVMEncoding_DW_ATE_unsigned_char(void); |
| 108 | unsigned LLVMZigEncoding_DW_ATE_signed_char(void); | 108 | unsigned ZigLLVMEncoding_DW_ATE_signed_char(void); |
| 109 | unsigned LLVMZigLang_DW_LANG_C99(void); | 109 | unsigned ZigLLVMLang_DW_LANG_C99(void); |
| 110 | unsigned LLVMZigTag_DW_variable(void); | 110 | unsigned ZigLLVMTag_DW_variable(void); |
| 111 | unsigned LLVMZigTag_DW_structure_type(void); | 111 | unsigned ZigLLVMTag_DW_structure_type(void); |
| 112 | 112 | ||
| 113 | LLVMZigDIBuilder *LLVMZigCreateDIBuilder(LLVMModuleRef module, bool allow_unresolved); | 113 | ZigLLVMDIBuilder *ZigLLVMCreateDIBuilder(LLVMModuleRef module, bool allow_unresolved); |
| 114 | void ZigLLVMAddModuleDebugInfoFlag(LLVMModuleRef module); | 114 | void ZigLLVMAddModuleDebugInfoFlag(LLVMModuleRef module); |
| 115 | 115 | ||
| 116 | void ZigLLVMSetCurrentDebugLocation(LLVMBuilderRef builder, int line, int column, LLVMZigDIScope *scope); | 116 | void ZigLLVMSetCurrentDebugLocation(LLVMBuilderRef builder, int line, int column, ZigLLVMDIScope *scope); |
| 117 | void ZigLLVMClearCurrentDebugLocation(LLVMBuilderRef builder); | 117 | void ZigLLVMClearCurrentDebugLocation(LLVMBuilderRef builder); |
| 118 | 118 | ||
| 119 | LLVMZigDIScope *LLVMZigLexicalBlockToScope(LLVMZigDILexicalBlock *lexical_block); | 119 | ZigLLVMDIScope *ZigLLVMLexicalBlockToScope(ZigLLVMDILexicalBlock *lexical_block); |
| 120 | LLVMZigDIScope *LLVMZigCompileUnitToScope(LLVMZigDICompileUnit *compile_unit); | 120 | ZigLLVMDIScope *ZigLLVMCompileUnitToScope(ZigLLVMDICompileUnit *compile_unit); |
| 121 | LLVMZigDIScope *LLVMZigFileToScope(LLVMZigDIFile *difile); | 121 | ZigLLVMDIScope *ZigLLVMFileToScope(ZigLLVMDIFile *difile); |
| 122 | LLVMZigDIScope *LLVMZigSubprogramToScope(LLVMZigDISubprogram *subprogram); | 122 | ZigLLVMDIScope *ZigLLVMSubprogramToScope(ZigLLVMDISubprogram *subprogram); |
| 123 | LLVMZigDIScope *LLVMZigTypeToScope(LLVMZigDIType *type); | 123 | ZigLLVMDIScope *ZigLLVMTypeToScope(ZigLLVMDIType *type); |
| 124 | 124 | ||
| 125 | LLVMZigDILocalVariable *LLVMZigCreateAutoVariable(LLVMZigDIBuilder *dbuilder, | 125 | ZigLLVMDILocalVariable *ZigLLVMCreateAutoVariable(ZigLLVMDIBuilder *dbuilder, |
| 126 | LLVMZigDIScope *scope, const char *name, LLVMZigDIFile *file, unsigned line_no, | 126 | ZigLLVMDIScope *scope, const char *name, ZigLLVMDIFile *file, unsigned line_no, |
| 127 | LLVMZigDIType *type, bool always_preserve, unsigned flags); | 127 | ZigLLVMDIType *type, bool always_preserve, unsigned flags); |
| 128 | 128 | ||
| 129 | LLVMZigDIGlobalVariable *LLVMZigCreateGlobalVariable(LLVMZigDIBuilder *dbuilder, | 129 | ZigLLVMDIGlobalVariable *ZigLLVMCreateGlobalVariable(ZigLLVMDIBuilder *dbuilder, |
| 130 | LLVMZigDIScope *scope, const char *name, const char *linkage_name, LLVMZigDIFile *file, | 130 | ZigLLVMDIScope *scope, const char *name, const char *linkage_name, ZigLLVMDIFile *file, |
| 131 | unsigned line_no, LLVMZigDIType *di_type, bool is_local_to_unit, LLVMValueRef constant_val); | 131 | unsigned line_no, ZigLLVMDIType *di_type, bool is_local_to_unit, LLVMValueRef constant_val); |
| 132 | 132 | ||
| 133 | LLVMZigDILocalVariable *LLVMZigCreateParameterVariable(LLVMZigDIBuilder *dbuilder, | 133 | ZigLLVMDILocalVariable *ZigLLVMCreateParameterVariable(ZigLLVMDIBuilder *dbuilder, |
| 134 | LLVMZigDIScope *scope, const char *name, LLVMZigDIFile *file, unsigned line_no, | 134 | ZigLLVMDIScope *scope, const char *name, ZigLLVMDIFile *file, unsigned line_no, |
| 135 | LLVMZigDIType *type, bool always_preserve, unsigned flags, unsigned arg_no); | 135 | ZigLLVMDIType *type, bool always_preserve, unsigned flags, unsigned arg_no); |
| 136 | 136 | ||
| 137 | LLVMZigDILexicalBlock *LLVMZigCreateLexicalBlock(LLVMZigDIBuilder *dbuilder, LLVMZigDIScope *scope, | 137 | ZigLLVMDILexicalBlock *ZigLLVMCreateLexicalBlock(ZigLLVMDIBuilder *dbuilder, ZigLLVMDIScope *scope, |
| 138 | LLVMZigDIFile *file, unsigned line, unsigned col); | 138 | ZigLLVMDIFile *file, unsigned line, unsigned col); |
| 139 | 139 | ||
| 140 | LLVMZigDICompileUnit *LLVMZigCreateCompileUnit(LLVMZigDIBuilder *dibuilder, | 140 | ZigLLVMDICompileUnit *ZigLLVMCreateCompileUnit(ZigLLVMDIBuilder *dibuilder, |
| 141 | unsigned lang, const char *file, const char *dir, const char *producer, | 141 | unsigned lang, const char *file, const char *dir, const char *producer, |
| 142 | bool is_optimized, const char *flags, unsigned runtime_version, const char *split_name, | 142 | bool is_optimized, const char *flags, unsigned runtime_version, const char *split_name, |
| 143 | uint64_t dwo_id, bool emit_debug_info); | 143 | uint64_t dwo_id, bool emit_debug_info); |
| 144 | 144 | ||
| 145 | LLVMZigDIFile *LLVMZigCreateFile(LLVMZigDIBuilder *dibuilder, const char *filename, const char *directory); | 145 | ZigLLVMDIFile *ZigLLVMCreateFile(ZigLLVMDIBuilder *dibuilder, const char *filename, const char *directory); |
| 146 | 146 | ||
| 147 | LLVMZigDISubprogram *LLVMZigCreateFunction(LLVMZigDIBuilder *dibuilder, LLVMZigDIScope *scope, | 147 | ZigLLVMDISubprogram *ZigLLVMCreateFunction(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, |
| 148 | const char *name, const char *linkage_name, LLVMZigDIFile *file, unsigned lineno, | 148 | const char *name, const char *linkage_name, ZigLLVMDIFile *file, unsigned lineno, |
| 149 | LLVMZigDIType *fn_di_type, bool is_local_to_unit, bool is_definition, unsigned scope_line, | 149 | ZigLLVMDIType *fn_di_type, bool is_local_to_unit, bool is_definition, unsigned scope_line, |
| 150 | unsigned flags, bool is_optimized, LLVMZigDISubprogram *decl_subprogram); | 150 | unsigned flags, bool is_optimized, ZigLLVMDISubprogram *decl_subprogram); |
| 151 | 151 | ||
| 152 | void ZigLLVMFnSetSubprogram(LLVMValueRef fn, LLVMZigDISubprogram *subprogram); | 152 | void ZigLLVMFnSetSubprogram(LLVMValueRef fn, ZigLLVMDISubprogram *subprogram); |
| 153 | 153 | ||
| 154 | void LLVMZigDIBuilderFinalize(LLVMZigDIBuilder *dibuilder); | 154 | void ZigLLVMDIBuilderFinalize(ZigLLVMDIBuilder *dibuilder); |
| 155 | 155 | ||
| 156 | LLVMZigInsertionPoint *LLVMZigSaveInsertPoint(LLVMBuilderRef builder); | 156 | ZigLLVMInsertionPoint *ZigLLVMSaveInsertPoint(LLVMBuilderRef builder); |
| 157 | void LLVMZigRestoreInsertPoint(LLVMBuilderRef builder, LLVMZigInsertionPoint *point); | 157 | void ZigLLVMRestoreInsertPoint(LLVMBuilderRef builder, ZigLLVMInsertionPoint *point); |
| 158 | 158 | ||
| 159 | LLVMValueRef LLVMZigInsertDeclareAtEnd(LLVMZigDIBuilder *dibuilder, LLVMValueRef storage, | 159 | LLVMValueRef ZigLLVMInsertDeclareAtEnd(ZigLLVMDIBuilder *dibuilder, LLVMValueRef storage, |
| 160 | LLVMZigDILocalVariable *var_info, LLVMZigDILocation *debug_loc, LLVMBasicBlockRef basic_block_ref); | 160 | ZigLLVMDILocalVariable *var_info, ZigLLVMDILocation *debug_loc, LLVMBasicBlockRef basic_block_ref); |
| 161 | LLVMValueRef LLVMZigInsertDeclare(LLVMZigDIBuilder *dibuilder, LLVMValueRef storage, | 161 | LLVMValueRef ZigLLVMInsertDeclare(ZigLLVMDIBuilder *dibuilder, LLVMValueRef storage, |
| 162 | LLVMZigDILocalVariable *var_info, LLVMZigDILocation *debug_loc, LLVMValueRef insert_before_instr); | 162 | ZigLLVMDILocalVariable *var_info, ZigLLVMDILocation *debug_loc, LLVMValueRef insert_before_instr); |
| 163 | LLVMZigDILocation *LLVMZigGetDebugLoc(unsigned line, unsigned col, LLVMZigDIScope *scope); | 163 | ZigLLVMDILocation *ZigLLVMGetDebugLoc(unsigned line, unsigned col, ZigLLVMDIScope *scope); |
| 164 | 164 | ||
| 165 | void LLVMZigSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state); | 165 | void ZigLLVMSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state); |
| 166 | 166 | ||
| 167 | void ZigLLVMAddFunctionAttr(LLVMValueRef fn, const char *attr_name, const char *attr_value); | 167 | void ZigLLVMAddFunctionAttr(LLVMValueRef fn, const char *attr_name, const char *attr_value); |
| 168 | 168 |