Skip to content

Commit

Permalink
Hide deprecated utils from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjseitz authored and jdorn-gt committed Aug 23, 2024
1 parent f30709e commit 1e35eea
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/cpp/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2050,15 +2050,15 @@ ENABLE_PREPROCESSING = YES
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

MACRO_EXPANSION = NO
MACRO_EXPANSION = YES

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

EXPAND_ONLY_PREDEF = NO
EXPAND_ONLY_PREDEF = YES

# If the SEARCH_INCLUDES tag is set to YES, the include files in the
# INCLUDE_PATH will be searched if a #include is found.
Expand Down Expand Up @@ -2090,7 +2090,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED =
PREDEFINED = GTIRB_DOXYGEN=1 GTIRB_DEPRECATED_UTILS

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
13 changes: 13 additions & 0 deletions include/gtirb/Allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,25 @@
#include <utility>
#include <vector>

// Hide the GTIRB_DEPRECATED_UTILS macro from docs
#ifndef GTIRB_DOXYGEN
#ifndef GTIRB_WRAP_UTILS_IN_NAMESPACE
#define GTIRB_DEPRECATED_UTILS \
[[deprecated("Define GTIRB_WRAP_UTILS_IN_NAMESPACE and access via the " \
"gtirb namespace to suppress this error.")]]
#else
#define GTIRB_DEPRECATED_UTILS
#endif
#endif

namespace gtirb {

// We want clients to use the names in the gtirb namespace, so we exclude
// the allocator namespace when generating documentation.
#ifndef GTIRB_DOXYGEN
namespace allocator {
#endif

/// Returns the next power of two (in 64-bits) that is strictly greater than A.
/// Returns zero on overflow.
///
Expand Down Expand Up @@ -347,7 +356,11 @@ template <typename T> class GTIRB_DEPRECATED_UTILS SpecificBumpPtrAllocator {
}
}
};

// Exclude allocator namespace from generated documentation.
#ifndef GTIRB_DOXYGEN
} // namespace allocator
#endif

#ifdef GTIRB_WRAP_UTILS_IN_NAMESPACE

Expand Down
13 changes: 13 additions & 0 deletions include/gtirb/Casting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,25 @@
#include <cassert>
#include <type_traits>

// Hide the GTIRB_DEPRECATED_UTILS macro from docs
#ifndef GTIRB_DOXYGEN
#ifndef GTIRB_WRAP_UTILS_IN_NAMESPACE
#define GTIRB_DEPRECATED_UTILS \
[[deprecated("Define GTIRB_WRAP_UTILS_IN_NAMESPACE and access via the " \
"gtirb namespace to suppress this error.")]]
#else
#define GTIRB_DEPRECATED_UTILS
#endif
#endif

namespace gtirb {

// We want clients to use the names in the gtirb namespace, so we exclude
// the allocator namespace when generating documentation.
#ifndef GTIRB_DOXYGEN
namespace casting {
#endif

/// \file Casting.hpp
/// \ingroup casting
/// \brief The various casting and type checking operations that apply
Expand Down Expand Up @@ -537,7 +546,11 @@ GTIRB_DEPRECATED_UTILS [[nodiscard]] inline typename cast_retty<X, Y*>::ret_type
dyn_cast_or_null(Y* Val) {
return (Val && isa<X>(Val)) ? cast<X>(Val) : nullptr;
}

// Exclude allocator namespace from generated documentation.
#ifndef GTIRB_DOXYGEN
} // namespace casting
#endif

#ifdef GTIRB_WRAP_UTILS_IN_NAMESPACE

Expand Down

0 comments on commit 1e35eea

Please sign in to comment.