diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-14 18:27:59 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-06-14 18:27:59 -0400 |
| commit | 32dd98b19fe3cc384df32704dac0ff3e377dbe0c (patch) | |
| tree | 2eddf3618d80313bdd24c25bd589bd474f3d82fc /src-self-hosted/module.zig | |
| parent | ef7f69d14a017c6c2065e4a376bb8e1f05ace04b (diff) | |
| parent | f0697c28f80d64c544302aea576e41ebc443b41c (diff) | |
| download | zig-32dd98b19fe3cc384df32704dac0ff3e377dbe0c.tar.gz zig-32dd98b19fe3cc384df32704dac0ff3e377dbe0c.zip | |
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'src-self-hosted/module.zig')
| -rw-r--r-- | src-self-hosted/module.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src-self-hosted/module.zig b/src-self-hosted/module.zig index a7ddf3f9e9..575105f25f 100644 --- a/src-self-hosted/module.zig +++ b/src-self-hosted/module.zig @@ -130,13 +130,13 @@ pub const Module = struct { var name_buffer = try Buffer.init(allocator, name); errdefer name_buffer.deinit(); - const context = c.LLVMContextCreate() ?? return error.OutOfMemory; + const context = c.LLVMContextCreate() orelse return error.OutOfMemory; errdefer c.LLVMContextDispose(context); - const module = c.LLVMModuleCreateWithNameInContext(name_buffer.ptr(), context) ?? return error.OutOfMemory; + const module = c.LLVMModuleCreateWithNameInContext(name_buffer.ptr(), context) orelse return error.OutOfMemory; errdefer c.LLVMDisposeModule(module); - const builder = c.LLVMCreateBuilderInContext(context) ?? return error.OutOfMemory; + const builder = c.LLVMCreateBuilderInContext(context) orelse return error.OutOfMemory; errdefer c.LLVMDisposeBuilder(builder); const module_ptr = try allocator.create(Module); @@ -223,7 +223,7 @@ pub const Module = struct { c.ZigLLVMParseCommandLineOptions(self.llvm_argv.len + 1, c_compatible_args.ptr); } - const root_src_path = self.root_src_path ?? @panic("TODO handle null root src path"); + const root_src_path = self.root_src_path orelse @panic("TODO handle null root src path"); const root_src_real_path = os.path.real(self.allocator, root_src_path) catch |err| { try printError("unable to get real path '{}': {}", root_src_path, err); return err; |
