Skip to content

Commit

Permalink
_Bool becomes bool
Browse files Browse the repository at this point in the history
Closes #32.
  • Loading branch information
klemens-morgenstern committed May 10, 2023
1 parent 2d39eae commit beccd6f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions source/api/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ getTypeInfoForType(
QualType const& T)
{
TagDecl const* TD = getTagDeclForType(T);
if (T->isBuiltinType()
&& (T->getAs<clang::BuiltinType>()->getKind() == BuiltinType::Bool))
return TypeInfo(Reference(EmptySID, "bool"));
if(!TD)
return TypeInfo(Reference(EmptySID, T.getAsString()));
InfoType IT;
Expand All @@ -275,6 +278,8 @@ parseParameters(
// KRYSTIAN NOTE: call getOriginalType instead
// of getType if we want to preserve top-level
// cv-qualfiers/array types/function types
auto ti = getTypeInfoForType(P->getType());

FieldTypeInfo& FieldInfo = I.Params.emplace_back(
getTypeInfoForType(P->getType()),
P->getNameAsString());
Expand Down
2 changes: 1 addition & 1 deletion test-files/old-tests/attributes_1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<function name="f" id="s6nsa+zVhpzzrN+yUVPP5rvdXqs=">
<file path="attributes_1.cpp" line="2"/>
<attr id="nodiscard"/>
<return type="_Bool"/>
<return type="bool"/>
</function>
</namespace>
</mrdox>
8 changes: 4 additions & 4 deletions test-files/old-tests/explicit-conv-operator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
<function name="operator bool" access="public" id="hJXOxv26Y9uxUYMMVZRsp3Wps4A=">
<file path="explicit-conv-operator.cpp" line="8"/>
<attr id="is-explicit"/>
<return type="_Bool"/>
<return type="bool"/>
</function>
</struct>
<struct name="Explicit" id="bonobNKGOblPVcRjxpiPan4nYnc=">
<file path="explicit-conv-operator.cpp" line="3" class="def"/>
<function name="operator bool" access="public" id="64zY8rVu+TzEUayzMrnV65i9nFc=">
<file path="explicit-conv-operator.cpp" line="4"/>
<attr id="is-explicit"/>
<return type="_Bool"/>
<return type="bool"/>
</function>
</struct>
<struct name="ExplicitTrue" id="htdCGapMsdazR1XkXoanrOCkvDE=">
<file path="explicit-conv-operator.cpp" line="11" class="def"/>
<function name="operator bool" access="public" id="9tpZWv9eJGfWj37jmTdNTg+gp14=">
<file path="explicit-conv-operator.cpp" line="12"/>
<attr id="is-explicit"/>
<return type="_Bool"/>
<return type="bool"/>
</function>
</struct>
<struct name="ExplicitExpression" id="ztb0u1Q4SVBUQ0roTOM7MFlUt/o=">
Expand All @@ -32,7 +32,7 @@
<function name="operator bool" access="public" id="q6N8XkMK9WWWGKNQnlx/o2E1EYc=">
<file path="explicit-conv-operator.cpp" line="17"/>
<attr id="is-explicit"/>
<return type="_Bool"/>
<return type="bool"/>
</function>
</struct>
</namespace>
Expand Down
2 changes: 1 addition & 1 deletion test-files/old-tests/explicit-deduct-guide.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<file path="explicit-deduct-guide.cpp" line="6"/>
<attr id="has-trailing-return"/>
<return type="X&lt;0&gt;"/>
<param type="_Bool"/>
<param type="bool"/>
</function>
</namespace>
</mrdox>

0 comments on commit beccd6f

Please sign in to comment.