mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Add "Dwarf Version" metadata for darwin on -llvm-api
This commit is contained in:
+16
-4
@@ -12471,11 +12471,23 @@ void lb_init_module(lbModule *m, Checker *c) {
|
|||||||
LLVMMetadataRef debug_ref = LLVMValueAsMetadata(LLVMConstInt(LLVMInt32TypeInContext(m->ctx), DEBUG_METADATA_VERSION, true));
|
LLVMMetadataRef debug_ref = LLVMValueAsMetadata(LLVMConstInt(LLVMInt32TypeInContext(m->ctx), DEBUG_METADATA_VERSION, true));
|
||||||
LLVMAddModuleFlag(m->mod, LLVMModuleFlagBehaviorWarning, "Debug Info Version", 18, debug_ref);
|
LLVMAddModuleFlag(m->mod, LLVMModuleFlagBehaviorWarning, "Debug Info Version", 18, debug_ref);
|
||||||
|
|
||||||
if (build_context.metrics.os == TargetOs_windows) {
|
switch (build_context.metrics.os) {
|
||||||
LLVMMetadataRef ref = LLVMValueAsMetadata(LLVMConstInt(LLVMInt32TypeInContext(m->ctx), 1, true));
|
case TargetOs_windows:
|
||||||
LLVMAddModuleFlag(m->mod, LLVMModuleFlagBehaviorWarning, "CodeView", 8, ref);
|
LLVMAddModuleFlag(m->mod,
|
||||||
m->debug_builder = LLVMCreateDIBuilder(m->mod);
|
LLVMModuleFlagBehaviorWarning,
|
||||||
|
"CodeView", 8,
|
||||||
|
LLVMValueAsMetadata(LLVMConstInt(LLVMInt32TypeInContext(m->ctx), 1, true)));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TargetOs_darwin:
|
||||||
|
// NOTE(bill): Darwin only supports DWARF2 (that I know of)
|
||||||
|
LLVMAddModuleFlag(m->mod,
|
||||||
|
LLVMModuleFlagBehaviorWarning,
|
||||||
|
"Dwarf Version", 13,
|
||||||
|
LLVMValueAsMetadata(LLVMConstInt(LLVMInt32TypeInContext(m->ctx), 2, true)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
m->debug_builder = LLVMCreateDIBuilder(m->mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
m->state_flags = 0;
|
m->state_flags = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user