Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ Currently this adds the support for elaborated type specifiers.
\_\_va_list_tag and other hidden declarations (f1)
--------------------------------------------------

!!! This flag has been removed from pygccxml > 2.6
We will now always remove these declarations

When parsing with CastXML, the XML tree can contain declarations named
``__va_list_tag``. If the compiler is llvm 3.9, ``__NSConstantString_tag``
and ``__NSConstantString`` declarations may also be present.
Expand Down
22 changes: 10 additions & 12 deletions src/pygccxml/parser/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,15 @@ def __init__(self, xml_file, decl_factory, config, *args):
"__vr_offs",
]

# With CastXML and clang some __va_list_tag declarations are
# present in the tree
# With llvm 3.9 there is a __NSConstantString(_tag) in the tree
self.__declarations_to_skip = [
"__va_list_tag",
"__NSConstantString_tag",
"__NSConstantString"
]

self.__xml_generator_from_xml_file = None

@property
Expand Down Expand Up @@ -297,21 +306,10 @@ def startElement(self, name, attrs):
self.__read_access(attrs)
element_id = attrs.get(XML_AN_ID)

# With CastXML and clang some __va_list_tag declarations are
# present in the tree: we do not want to have these in the tree.
# With llvm 3.9 there is a __NSConstantString(_tag) in the tree
# We hide these declarations by default
rm1 = "f1" not in self.config.flags
names = [
"__va_list_tag",
"__NSConstantString_tag",
"__NSConstantString"]

if isinstance(obj, declarations.declaration_t):

if rm1 and str(obj.name) in names:
if obj.name in self.__declarations_to_skip:
return

self.__update_membership(attrs)
self.__declarations[element_id] = obj
if not isinstance(obj, declarations.namespace_t):
Expand Down
116 changes: 0 additions & 116 deletions tests/test_va_list_tag_removal.py

This file was deleted.