aboutsummaryrefslogtreecommitdiff
path: root/src/zig_clang.cpp
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-01-10 13:36:42 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-01-10 16:34:40 -0500
commit570ffc470e1b3b186c079cea1c07adefe6d11c8a (patch)
tree2f93d933f85a402b0f33da68b8e4c7f780adc4e4 /src/zig_clang.cpp
parente06a6b9645827fa35cfa388bbea8813206d444ad (diff)
downloadzig-570ffc470e1b3b186c079cea1c07adefe6d11c8a.tar.gz
zig-570ffc470e1b3b186c079cea1c07adefe6d11c8a.zip
Handle forward-declared functions
Closes #4130
Diffstat (limited to 'src/zig_clang.cpp')
-rw-r--r--src/zig_clang.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/zig_clang.cpp b/src/zig_clang.cpp
index 426fec2c0c..dd003a4f9c 100644
--- a/src/zig_clang.cpp
+++ b/src/zig_clang.cpp
@@ -1734,6 +1734,31 @@ bool ZigClangFunctionDecl_doesDeclarationForceExternallyVisibleDefinition(const
return casted->doesDeclarationForceExternallyVisibleDefinition();
}
+bool ZigClangFunctionDecl_isThisDeclarationADefinition(const struct ZigClangFunctionDecl *self) {
+ auto casted = reinterpret_cast<const clang::FunctionDecl *>(self);
+ return casted->isThisDeclarationADefinition();
+}
+
+bool ZigClangFunctionDecl_doesThisDeclarationHaveABody(const struct ZigClangFunctionDecl *self) {
+ auto casted = reinterpret_cast<const clang::FunctionDecl *>(self);
+ return casted->doesThisDeclarationHaveABody();
+}
+
+bool ZigClangFunctionDecl_isDefined(const struct ZigClangFunctionDecl *self) {
+ auto casted = reinterpret_cast<const clang::FunctionDecl *>(self);
+ return casted->isDefined();
+}
+
+const ZigClangFunctionDecl* ZigClangFunctionDecl_getDefinition(const struct ZigClangFunctionDecl *self) {
+ auto casted = reinterpret_cast<const clang::FunctionDecl *>(self);
+ return reinterpret_cast<const ZigClangFunctionDecl *>(casted->getDefinition());
+}
+
+bool ZigClangTagDecl_isThisDeclarationADefinition(const struct ZigClangTagDecl *self) {
+ auto casted = reinterpret_cast<const clang::TagDecl *>(self);
+ return casted->isThisDeclarationADefinition();
+}
+
bool ZigClangFunctionDecl_isInlineSpecified(const struct ZigClangFunctionDecl *self) {
auto casted = reinterpret_cast<const clang::FunctionDecl *>(self);
return casted->isInlineSpecified();