diff options
author | Brad King <brad.king@kitware.com> | 2014-02-26 21:48:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-21 21:07:15 (GMT) |
commit | 1b6c7e75a93ad4d44a1d1609c9a496f6979e0193 (patch) | |
tree | 9c7f976f05f36dfeca029c40ecc59632a76a3c5e | |
parent | 4dc642dd1ab2f4bcf3f212ae7a4f6ede636ab3b2 (diff) | |
download | CastXML-1b6c7e75a93ad4d44a1d1609c9a496f6979e0193.zip CastXML-1b6c7e75a93ad4d44a1d1609c9a496f6979e0193.tar.gz CastXML-1b6c7e75a93ad4d44a1d1609c9a496f6979e0193.tar.bz2 |
Output: Generate Ellipsis element inside variadic functions and types
-rw-r--r-- | src/Output.cxx | 6 | ||||
-rw-r--r-- | test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/expect/gccxml.Function-variadic-xml.txt | 11 | ||||
-rw-r--r-- | test/expect/gccxml.FunctionType-variadic-xml.txt | 12 | ||||
-rw-r--r-- | test/input/Function-variadic.cxx | 1 | ||||
-rw-r--r-- | test/input/FunctionType-variadic.cxx | 1 |
6 files changed, 33 insertions, 0 deletions
diff --git a/src/Output.cxx b/src/Output.cxx index c93acfc..6133a77 100644 --- a/src/Output.cxx +++ b/src/Output.cxx @@ -838,6 +838,9 @@ void ASTVisitor::OutputFunctionHelper(clang::FunctionDecl const* d, e = d->param_end(); i != e; ++i) { this->OutputFunctionArgument(*i, dn->Complete); } + if(d->isVariadic()) { + this->OS << " <Ellipsis/>\n"; + } this->OS << " </" << tag << ">\n"; } else { this->OS << "/>\n"; @@ -859,6 +862,9 @@ void ASTVisitor::OutputFunctionTypeHelper(clang::FunctionProtoType const* t, this->PrintTypeAttribute(*i, dn->Complete); this->OS << "/>\n"; } + if(t->isVariadic()) { + this->OS << " <Ellipsis/>\n"; + } this->OS << " </" << tag << ">\n"; } else { this->OS << "/>\n"; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e6a69f1..66ec112 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -75,7 +75,9 @@ castxml_test_gccxml(Field) castxml_test_gccxml(Function) castxml_test_gccxml(Function-template) castxml_test_gccxml(Function-throw) +castxml_test_gccxml(Function-variadic) castxml_test_gccxml(FunctionType) +castxml_test_gccxml(FunctionType-variadic) castxml_test_gccxml(FundamentalType) castxml_test_gccxml(Method) castxml_test_gccxml(Namespace) diff --git a/test/expect/gccxml.Function-variadic-xml.txt b/test/expect/gccxml.Function-variadic-xml.txt new file mode 100644 index 0000000..cd75d0f --- /dev/null +++ b/test/expect/gccxml.Function-variadic-xml.txt @@ -0,0 +1,11 @@ +^<\?xml version="1.0"\?> +<GCC_XML[^>]*> + <Function id="_1" name="start" returns="_2" context="_3" location="f1:1" file="f1" line="1"> + <Argument type="_4" location="f1:1" file="f1" line="1"/> + <Ellipsis/> + </Function> + <FundamentalType id="_2" name="void"/> + <FundamentalType id="_4" name="int"/> + <Namespace id="_3" name="::"/> + <File id="f1" name=".*/test/input/Function-variadic.cxx"/> +</GCC_XML>$ diff --git a/test/expect/gccxml.FunctionType-variadic-xml.txt b/test/expect/gccxml.FunctionType-variadic-xml.txt new file mode 100644 index 0000000..f13d334 --- /dev/null +++ b/test/expect/gccxml.FunctionType-variadic-xml.txt @@ -0,0 +1,12 @@ +^<\?xml version="1.0"\?> +<GCC_XML[^>]*> + <Typedef id="_1" name="start" type="_2" context="_3" location="f1:1" file="f1" line="1"/> + <FunctionType id="_2" returns="_4"> + <Argument type="_5"/> + <Ellipsis/> + </FunctionType> + <FundamentalType id="_4" name="void"/> + <FundamentalType id="_5" name="int"/> + <Namespace id="_3" name="::"/> + <File id="f1" name=".*/test/input/FunctionType-variadic.cxx"/> +</GCC_XML>$ diff --git a/test/input/Function-variadic.cxx b/test/input/Function-variadic.cxx new file mode 100644 index 0000000..2a2510b --- /dev/null +++ b/test/input/Function-variadic.cxx @@ -0,0 +1 @@ +void start(int,...); diff --git a/test/input/FunctionType-variadic.cxx b/test/input/FunctionType-variadic.cxx new file mode 100644 index 0000000..90b9294 --- /dev/null +++ b/test/input/FunctionType-variadic.cxx @@ -0,0 +1 @@ +typedef void start(int,...); |