aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-31 17:48:19 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-31 17:48:19 -0700
commit41b95cc2374010f39b903cb4b90d233d2f7d57c4 (patch)
treedb26d562e8b0f2621df474b9bd16aec0289caa14 /src/zig_llvm.cpp
parent773cd851fe83d1ee89d7e0ca9e7ad7327d2962c9 (diff)
downloadzig-41b95cc2374010f39b903cb4b90d233d2f7d57c4.tar.gz
zig-41b95cc2374010f39b903cb4b90d233d2f7d57c4.zip
parseh: correct debug for forward decls
also C typedefs emit simply `const Foo = Bar;` since in C you can implicitly cast from a typedef child to parent but in zig you can't.
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index a46d591298..ea4606bffa 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -262,6 +262,17 @@ LLVMZigDIType *LLVMZigCreateReplaceableCompositeType(LLVMZigDIBuilder *dibuilder
return reinterpret_cast<LLVMZigDIType*>(di_type);
}
+LLVMZigDIType *LLVMZigCreateDebugForwardDeclType(LLVMZigDIBuilder *dibuilder, unsigned tag,
+ const char *name, LLVMZigDIScope *scope, LLVMZigDIFile *file, unsigned line)
+{
+ DIType *di_type = reinterpret_cast<DIBuilder*>(dibuilder)->createForwardDecl(
+ tag, name,
+ reinterpret_cast<DIScope*>(scope),
+ reinterpret_cast<DIFile*>(file),
+ line);
+ return reinterpret_cast<LLVMZigDIType*>(di_type);
+}
+
void LLVMZigReplaceTemporary(LLVMZigDIBuilder *dibuilder, LLVMZigDIType *type,
LLVMZigDIType *replacement)
{