Skip to content

single InfoNodes.inc header #893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 1, 2025
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
24 changes: 0 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,26 +192,6 @@ add_custom_command(
COMMENT "Generating Config Source Files"
)

add_custom_command(
COMMAND
${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/util/generate-info-files.py
src/lib/Metadata/InfoNodes.json
${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/util/generate-info-files.py
src/lib/Metadata/InfoNodes.json
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/Metadata/InfoNodesLower.inc
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/Metadata/InfoNodesPascal.inc
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/Metadata/InfoNodesPascalAndLower.inc
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/Metadata/InfoNodesPascalPlural.inc
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating Info Include Files"
)


# Main library
file(
GLOB_RECURSE LIB_SOURCES CONFIGURE_DEPENDS
Expand All @@ -232,10 +212,6 @@ list(APPEND LIB_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/Version.hpp
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/PublicSettings.hpp
${CMAKE_CURRENT_BINARY_DIR}/src/lib/Lib/PublicSettings.cpp
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/Metadata/InfoNodesLower.inc
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/Metadata/InfoNodesPascal.inc
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/Metadata/InfoNodesPascalAndLower.inc
${CMAKE_CURRENT_BINARY_DIR}/include/mrdocs/Metadata/InfoNodesPascalPlural.inc
)
add_library(mrdocs-core ${LIB_SOURCES})
target_compile_features(mrdocs-core PUBLIC cxx_std_20)
Expand Down
1 change: 0 additions & 1 deletion docs/antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ asciidoc:
- '@asciidoctor/tabs'
- ./extensions/mrdocs-demos.js
- ./extensions/mrdocs-releases.js
- ./extensions/c-preprocessor.js
- ./extensions/config-options-reference.js
37 changes: 0 additions & 37 deletions docs/extensions/c-preprocessor.js

This file was deleted.

16 changes: 0 additions & 16 deletions docs/modules/ROOT/pages/contribute.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,6 @@ For each compilation command:
==== Info Nodes

MrDocs represents each C++ symbol or construct as an `Info` node (`mrdocs/Metadata/Info.hpp`).
MrDocs currently defines the following `Info` nodes:

[c-preprocessor]
====

[cols="1,3,2"]
|===
| Name | Description | Declaration

#define INFO_PASCAL_AND_DESC(Type, Desc) | `pass:[Type]pass:[Info]` | Desc | `mrdocs/Metadata/pass:[Type].hpp`

include::partial$InfoNodes.inc[]

|===
====

`Info` can not only represent direct AST symbols but also {cpp} constructs that need to be inferred from these symbols.
Nodes in the first category will typically be created in the initial extraction step, and nodes in the second category will be created in the finalization step.

Expand Down
110 changes: 0 additions & 110 deletions docs/modules/ROOT/partials/InfoNodes.inc

This file was deleted.

1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"@antora/lunr-extension": "^1.0.0-alpha.8",
"@asciidoctor/tabs": "^1.0.0-beta.3",
"asciidoctor": "^2.2.6",
"c-preprocessor": "^0.2.13",
"sync-request": "^6.1.0"
}
}
2 changes: 1 addition & 1 deletion include/mrdocs/Metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <mrdocs/Metadata/Javadoc.hpp>
#include <mrdocs/Metadata/Name.hpp>
#include <mrdocs/Metadata/Source.hpp>
#include <mrdocs/Metadata/Symbols.hpp>
#include <mrdocs/Metadata/SymbolID.hpp>
#include <mrdocs/Metadata/Template.hpp>
#include <mrdocs/Metadata/Type.hpp>

Expand Down
22 changes: 11 additions & 11 deletions include/mrdocs/Metadata/Info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <mrdocs/Metadata/ExtractionMode.hpp>
#include <mrdocs/Metadata/Javadoc.hpp>
#include <mrdocs/Metadata/Specifiers.hpp>
#include <mrdocs/Metadata/Symbols.hpp>
#include <mrdocs/Metadata/SymbolID.hpp>
#include <mrdocs/Metadata/Source.hpp>
#include <mrdocs/Metadata/DomCorpus.hpp>
#include <mrdocs/Support/Concepts.hpp>
Expand All @@ -30,15 +30,15 @@ namespace clang::mrdocs {
/* Forward declarations
*/
#define INFO(Type) struct Type##Info;
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>

/** Info variant discriminator
*/
enum class InfoKind
{
None = 0,
#define INFO(Type) Type,
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>
};

/** Return the name of the InfoKind as a string.
Expand All @@ -65,7 +65,7 @@ countInfoKind()
{
std::underlying_type_t<InfoKind> count = 0;
#define INFO(Type) count++;
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>
return count;
}

Expand Down Expand Up @@ -149,7 +149,7 @@ struct MRDOCS_VISIBLE Info
#define INFO(Type) constexpr bool is##Type() const noexcept { \
return Kind == InfoKind::Type; \
}
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>

constexpr Info const& asInfo() const noexcept
{
Expand All @@ -167,29 +167,29 @@ struct MRDOCS_VISIBLE Info
return reinterpret_cast<Type##Info const&>(*this); \
MRDOCS_UNREACHABLE(); \
}
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>

#define INFO(Type) \
constexpr Type##Info & as##Type() noexcept { \
if (Kind == InfoKind::Type) \
return reinterpret_cast<Type##Info&>(*this); \
MRDOCS_UNREACHABLE(); \
}
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>

#define INFO(Type) \
constexpr Type##Info const* as##Type##Ptr() const noexcept { \
if (Kind == InfoKind::Type) { return reinterpret_cast<Type##Info const*>(this); } \
return nullptr; \
}
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>

#define INFO(Type) \
constexpr Type##Info * as##Type##Ptr() noexcept { \
if (Kind == InfoKind::Type) { return reinterpret_cast<Type##Info *>(this); } \
return nullptr; \
}
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>

auto operator<=>(Info const&) const = default;
};
Expand All @@ -214,7 +214,7 @@ struct InfoCommonBase : Info

#define INFO(Kind) \
static constexpr bool is##Kind() noexcept { return K == InfoKind::Kind; }
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>

auto operator<=>(InfoCommonBase const&) const = default;

Expand Down Expand Up @@ -255,7 +255,7 @@ visit(
#define INFO(Type) \
case InfoKind::Type: \
return visitor.template visit<Type##Info>();
#include <mrdocs/Metadata/InfoNodesPascal.inc>
#include <mrdocs/Metadata/Info/InfoNodes.inc>
default:
MRDOCS_UNREACHABLE();
}
Expand Down
30 changes: 30 additions & 0 deletions include/mrdocs/Metadata/Info/InfoNodes.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// Copyright (c) 2025 Alan de Freitas (alandefreitas@gmail.com)
//
// Official repository: https://github.com/cppalliance/mrdocs
//

#ifndef INFO
#define INFO(PascalName)
#endif

INFO(Namespace)
INFO(Record)
INFO(Function)
INFO(Overloads)
INFO(Enum)
INFO(EnumConstant)
INFO(Typedef)
INFO(Variable)
INFO(Friend)
INFO(Guide)
INFO(NamespaceAlias)
INFO(Using)
INFO(Concept)

#undef INFO

2 changes: 1 addition & 1 deletion include/mrdocs/Metadata/Javadoc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define MRDOCS_API_METADATA_JAVADOC_HPP

#include <mrdocs/Platform.hpp>
#include <mrdocs/Metadata/Symbols.hpp>
#include <mrdocs/Metadata/SymbolID.hpp>
#include <mrdocs/Support/Visitor.hpp>
#include <mrdocs/Support/Concepts.hpp>
#include <mrdocs/ADT/Polymorphic.hpp>
Expand Down Expand Up @@ -892,7 +892,7 @@
}

Brief&
operator=(Brief const& other) = default;

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Apple-Clang

Build Warning - clang++ - [-Wdeprecated-copy]

clang++ - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Apple-Clang

Build Warning - clang++ - [-Wdeprecated-copy]

clang++ - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Apple-Clang

Build Warning - clang++ - [-Wdeprecated-copy]

clang++ - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Apple-Clang

Build Warning - clang++ - [-Wdeprecated-copy]

clang++ - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Apple-Clang

Build Warning - clang++ - [-Wdeprecated-copy]

clang++ - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Clang 18: C++20

Build Warning - clang++-18 - [-Wdeprecated-copy]

clang++-18 - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Clang 18: C++20

Build Warning - clang++-18 - [-Wdeprecated-copy]

clang++-18 - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Clang 18: C++20

Build Warning - clang++-18 - [-Wdeprecated-copy]

clang++-18 - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Clang 18: C++20

Build Warning - clang++-18 - [-Wdeprecated-copy]

clang++-18 - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Check warning on line 895 in include/mrdocs/Metadata/Javadoc.hpp

View workflow job for this annotation

GitHub Actions / Clang 18: C++20

Build Warning - clang++-18 - [-Wdeprecated-copy]

clang++-18 - definition of implicit copy constructor for 'Brief' is deprecated because it has a user-declared copy assignment operator ([-Wdeprecated-copy])

Brief&
operator=(std::string_view const text) override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Official repository: https://github.com/cppalliance/mrdocs
//

#ifndef MRDOCS_API_METADATA_SYMBOLS_HPP
#define MRDOCS_API_METADATA_SYMBOLS_HPP
#ifndef MRDOCS_API_METADATA_SYMBOLID_HPP
#define MRDOCS_API_METADATA_SYMBOLID_HPP

#include <mrdocs/Platform.hpp>
#include <mrdocs/ADT/Optional.hpp>
Expand Down
6 changes: 4 additions & 2 deletions include/mrdocs/Metadata/Type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
#include <mrdocs/Dom.hpp>
#include <mrdocs/Metadata/Expression.hpp>
#include <mrdocs/Metadata/Specifiers.hpp>
#include <mrdocs/Metadata/Symbols.hpp>
#include <mrdocs/MetadataFwd.hpp>
#include <mrdocs/Metadata/SymbolID.hpp>
#include <mrdocs/Platform.hpp>
#include <mrdocs/Support/TypeTraits.hpp>

namespace clang::mrdocs {

struct NameInfo;
struct TypeInfo;

std::strong_ordering
operator<=>(Polymorphic<NameInfo> const& lhs, Polymorphic<NameInfo> const& rhs);

Expand Down
Loading
Loading