From c757f197903940115c1d42883240ec1fe7ef660c Mon Sep 17 00:00:00 2001 From: William Sengir Date: Sun, 13 Mar 2022 00:28:34 -0700 Subject: stage2: add debug info for globals in the LLVM backend LLVM backend: generate DIGlobalVariable's for non-function globals and rename linkage names when exporting functions and globals. zig_llvm.cpp: add some wrappers to convert a handful of DI classes into DINode's since DIGlobalVariable is not a DIScope like the others. zig_llvm.cpp: add some wrappers to allow replacing the LinkageName of DISubprogram and DIGlobalVariable. zig_llvm.cpp: fix DI class mixup causing nonsense reinterpret_cast. The end result is that GDB is now usable since you now no longer need to manually cast every global nor fully qualify every export. --- src/Module.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index d490568604..b6104df232 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -663,7 +663,7 @@ pub const Decl = struct { return (try decl.typedValue()).val; } - pub fn isFunction(decl: *Decl) !bool { + pub fn isFunction(decl: Decl) !bool { const tv = try decl.typedValue(); return tv.ty.zigTypeTag() == .Fn; } -- cgit v1.2.3