build system: consolidate duplicate code and more

* add ability to add assembly files when building an exe, obj, or lib
 * add implicit cast from `[N]T` to `?[]const T` (closes #343)
 * remove link_exe and link_lib in favor of allowing build_exe and
   build_lib support no root zig source file
This commit is contained in:
Andrew Kelley
2017-04-26 19:17:05 -04:00
parent 09bc4d6ba3
commit 7b0542d08b
13 changed files with 323 additions and 694 deletions

View File

@@ -90,7 +90,11 @@ pub fn writeStackTrace(out_stream: &io.OutStream, allocator: &mem.Allocator, tty
// at compile time. I'll call it issue #313
const ptr_hex = if (@sizeOf(usize) == 4) "0x{x8}" else "0x{x16}";
const compile_unit = findCompileUnit(st, return_address) ?? return error.MissingDebugInfo;
const compile_unit = findCompileUnit(st, return_address) ?? {
%return out_stream.print(DIM ++ ptr_hex ++ " in ??? (???)" ++ RESET ++ "\n\n\n", return_address);
%return out_stream.flush();
continue;
};
const compile_unit_name = %return compile_unit.die.getAttrString(st, DW.AT_name);
try (getLineNumberInfo(st, compile_unit, usize(return_address) - 1)) |line_info| {
defer line_info.deinit();