| ... | ... | @@ -7999,11 +7999,13 @@ pub fn init(options: Options) InitError!Builder { |
| 7999 | 7999 | assert(try self.string("") == .empty); |
| 8000 | 8000 | |
| 8001 | 8001 | if (options.name.len > 0) self.source_filename = try self.string(options.name); |
| 8002 | | self.initializeLLVMTarget(options.target.cpu.arch); |
| 8003 | | if (self.useLibLlvm()) self.llvm.module = llvm.Module.createWithName( |
| 8004 | | (self.source_filename.slice(&self) orelse ""), |
| 8005 | | self.llvm.context, |
| 8006 | | ); |
| 8002 | if (self.useLibLlvm()) { |
| 8003 | initializeLLVMTarget(options.target.cpu.arch); |
| 8004 | self.llvm.module = llvm.Module.createWithName( |
| 8005 | (self.source_filename.slice(&self) orelse ""), |
| 8006 | self.llvm.context, |
| 8007 | ); |
| 8008 | } |
| 8007 | 8009 | |
| 8008 | 8010 | if (options.triple.len > 0) { |
| 8009 | 8011 | self.target_triple = try self.string(options.triple); |
| ... | ... | @@ -8117,8 +8119,7 @@ pub fn deinit(self: *Builder) void { |
| 8117 | 8119 | self.* = undefined; |
| 8118 | 8120 | } |
| 8119 | 8121 | |
| 8120 | | pub fn initializeLLVMTarget(self: *const Builder, arch: std.Target.Cpu.Arch) void { |
| 8121 | | if (!self.useLibLlvm()) return; |
| 8122 | pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { |
| 8122 | 8123 | switch (arch) { |
| 8123 | 8124 | .aarch64, .aarch64_be, .aarch64_32 => { |
| 8124 | 8125 | llvm.LLVMInitializeAArch64Target(); |