Skip to content

Commit

Permalink
[docs] Fix doxygen comments wrongly attached to the llvm namespace
Browse files Browse the repository at this point in the history
Looking at the Doxygen-generated documentation for the llvm namespace
currently shows all sorts of random comments from different parts of the
codebase. These are mostly caused by:

- File doc comments that aren't marked with \file, so they're attached to
  the next declaration, which is usually "namespace llvm {".
- Class doc comments placed before the namespace rather than before the
  class.
- Code comments before the namespace that (in my opinion) shouldn't be
  extracted by doxygen at all.

This commit fixes these comments. The generated doxygen documentation now
has proper docs for several classes and files, and the docs for the llvm
and llvm::detail namespaces are now empty.

Reviewed By: thakis, mizvekov

Differential Revision: https://reviews.llvm.org/D96736
  • Loading branch information
nicolas17 authored and mizvekov committed Apr 6, 2021
1 parent 52cc9df commit a1aada7
Show file tree
Hide file tree
Showing 32 changed files with 87 additions and 79 deletions.
16 changes: 8 additions & 8 deletions llvm/include/llvm/ADT/STLExtras.h
Expand Up @@ -79,13 +79,6 @@ template <typename T> struct make_const_ref {
typename std::add_const<T>::type>::type;
};

/// Utilities for detecting if a given trait holds for some set of arguments
/// 'Args'. For example, the given trait could be used to detect if a given type
/// has a copy assignment operator:
/// template<class T>
/// using has_copy_assign_t = decltype(std::declval<T&>()
/// = std::declval<const T&>());
/// bool fooHasCopyAssign = is_detected<has_copy_assign_t, FooClass>::value;
namespace detail {
template <typename...> using void_t = void;
template <class, template <class...> class Op, class... Args> struct detector {
Expand All @@ -97,16 +90,23 @@ struct detector<void_t<Op<Args...>>, Op, Args...> {
};
} // end namespace detail

/// Detects if a given trait holds for some set of arguments 'Args'.
/// For example, the given trait could be used to detect if a given type
/// has a copy assignment operator:
/// template<class T>
/// using has_copy_assign_t = decltype(std::declval<T&>()
/// = std::declval<const T&>());
/// bool fooHasCopyAssign = is_detected<has_copy_assign_t, FooClass>::value;
template <template <class...> class Op, class... Args>
using is_detected = typename detail::detector<void, Op, Args...>::value_t;

/// Check if a Callable type can be invoked with the given set of arg types.
namespace detail {
template <typename Callable, typename... Args>
using is_invocable =
decltype(std::declval<Callable &>()(std::declval<Args>()...));
} // namespace detail

/// Check if a Callable type can be invoked with the given set of arg types.
template <typename Callable, typename... Args>
using is_invocable = is_detected<detail::is_invocable, Callable, Args...>;

Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Analysis/ValueLattice.h
Expand Up @@ -17,13 +17,13 @@
// ValueLatticeElement
//===----------------------------------------------------------------------===//

namespace llvm {

/// This class represents lattice values for constants.
///
/// FIXME: This is basically just for bringup, this can be made a lot more rich
/// in the future.
///

namespace llvm {
class ValueLatticeElement {
enum ValueLatticeElementTy {
/// This Value has no known value yet. As a result, this implies the
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/BinaryFormat/MsgPackDocument.h
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file declares a class that exposes a simple in-memory representation
/// of a document of MsgPack objects, that can be read from MsgPack, written to
/// MsgPack, and inspected and modified in memory. This is intended to be a
Expand Down
7 changes: 4 additions & 3 deletions llvm/include/llvm/CodeGen/AccelTable.h
Expand Up @@ -5,9 +5,9 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file contains support for writing accelerator tables.
//
/// \file
/// This file contains support for writing accelerator tables.
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_ACCELTABLE_H
Expand All @@ -30,6 +30,7 @@
#include <cstdint>
#include <vector>

/// \file
/// The DWARF and Apple accelerator tables are an indirect hash table optimized
/// for null lookup rather than access to known data. The Apple accelerator
/// tables are a precursor of the newer DWARF v5 accelerator tables. Both
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
Expand Up @@ -5,9 +5,9 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Provides analysis for continuously CSEing during GISel passes.
//
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_GLOBALISEL_CSEINFO_H
#define LLVM_CODEGEN_GLOBALISEL_CSEINFO_H
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/Combiner.h
Expand Up @@ -5,10 +5,10 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// This contains common code to drive combines. Combiner Passes will need to
/// setup a CombinerInfo and call combineMachineFunction.
//
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_GLOBALISEL_COMBINER_H
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Expand Up @@ -5,13 +5,13 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------------------------------------------------------===//
//
/// \file
/// This contains common combine transformations that may be used in a combine
/// pass,or by the target elsewhere.
/// Targets can pick individual opcode transformations from the helper or use
/// tryCombine which invokes all transformations. All of the transformations
/// return true if the MachineInstruction changed and false otherwise.
//
///
//===--------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_GLOBALISEL_COMBINERHELPER_H
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Interface for Targets to specify which operations are combined how and when.
///
//===----------------------------------------------------------------------===//
Expand Down
5 changes: 3 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
Expand Up @@ -5,11 +5,12 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// This contains common code to allow clients to notify changes to machine
/// instr.
//
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_GLOBALISEL_GISELCHANGEOBSERVER_H
#define LLVM_CODEGEN_GLOBALISEL_GISELCHANGEOBSERVER_H

Expand Down
5 changes: 3 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h
Expand Up @@ -5,11 +5,12 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Provides analysis for querying information about KnownBits during GISel
/// passes.
//
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_GLOBALISEL_GISELKNOWNBITS_H
#define LLVM_CODEGEN_GLOBALISEL_GISELKNOWNBITS_H

Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
Expand Up @@ -5,10 +5,10 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Interface for Targets to specify which operations they can successfully
/// select and how the others should be expanded most efficiently.
//
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_GLOBALISEL_LEGALIZERINFO_H
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h
Expand Up @@ -5,9 +5,9 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Tracks DebugLocs between checkpoints and verifies that they are transferred.
//
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_GLOBALISEL_LOSTDEBUGLOCOBSERVER_H
#define LLVM_CODEGEN_GLOBALISEL_LOSTDEBUGLOCOBSERVER_H
Expand Down
5 changes: 3 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
Expand Up @@ -5,10 +5,11 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Contains matchers for matching SSA Machine Instructions.
//
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_GLOBALISEL_MIPATTERNMATCH_H
#define LLVM_CODEGEN_GLOBALISEL_MIPATTERNMATCH_H

Expand Down
5 changes: 3 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
Expand Up @@ -6,9 +6,10 @@
//
//===----------------------------------------------------------------------===//
//
/// \file This file describes the interface of the MachineFunctionPass
/// \file
/// This file describes the interface of the MachineFunctionPass
/// responsible for assigning the generic virtual registers to register bank.

///
/// By default, the reg bank selector relies on local decisions to
/// assign the register bank. In other words, it looks at one instruction
/// at a time to decide where the operand of that instruction should live.
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/LowLevelType.h
Expand Up @@ -5,12 +5,12 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Implement a low-level type suitable for MachineInstr level instruction
/// selection.
///
/// This provides the CodeGen aspects of LowLevelType, such as Type conversion.
//
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_LOWLEVELTYPE_H
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/Passes.h
Expand Up @@ -32,7 +32,7 @@ class raw_ostream;

} // End llvm namespace

/// List of target independent CodeGen pass IDs.
// List of target independent CodeGen pass IDs.
namespace llvm {
FunctionPass *createAtomicExpandPass();

Expand Down Expand Up @@ -86,7 +86,7 @@ namespace llvm {
/// MachineDominators - This pass is a machine dominators analysis pass.
extern char &MachineDominatorsID;

/// MachineDominanaceFrontier - This pass is a machine dominators analysis pass.
/// MachineDominanaceFrontier - This pass is a machine dominators analysis.
extern char &MachineDominanceFrontierID;

/// MachineRegionInfo - This pass computes SESE regions for machine functions.
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/TargetPassConfig.h
Expand Up @@ -5,9 +5,9 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Target-Independent Code Generator Pass Configuration Options pass.
//
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_TARGETPASSCONFIG_H
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// \file
/// \file
/// Contains the Analyses and Result Interpretation to select likely functions
/// to Speculatively compile before they are called. [Purely Experimentation]
//===----------------------------------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/GlobalIFunc.h
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
///
/// \brief
/// \file
/// This file contains the declaration of the GlobalIFunc class, which
/// represents a single indirect function in the IR. Indirect function uses
/// ELF symbol type extension to mark that the address of a declaration should
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/PassManagerImpl.h
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Provides implementations for PassManager and AnalysisManager template
/// methods. These classes should be explicitly instantiated for any IR unit,
/// and files doing the explicit instantiation should include this header.
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/PassManagerInternal.h
Expand Up @@ -28,7 +28,7 @@ template <typename IRUnitT> class AllAnalysesOn;
template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager;
class PreservedAnalyses;

/// Implementation details of the pass manager interfaces.
// Implementation details of the pass manager interfaces.
namespace detail {

/// Template for the abstract base class used to dispatch
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/InterfaceStub/ELFObjHandler.h
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===-----------------------------------------------------------------------===/
///
/// \file
/// This supports reading and writing of elf dynamic shared objects.
///
//===-----------------------------------------------------------------------===/
Expand Down
23 changes: 13 additions & 10 deletions llvm/include/llvm/Support/BinaryStreamArray.h
Expand Up @@ -5,6 +5,19 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Lightweight arrays that are backed by an arbitrary BinaryStream. This file
/// provides two different array implementations.
///
/// VarStreamArray - Arrays of variable length records. The user specifies
/// an Extractor type that can extract a record from a given offset and
/// return the number of bytes consumed by the record.
///
/// FixedStreamArray - Arrays of fixed length records. This is similar in
/// spirit to ArrayRef<T>, but since it is backed by a BinaryStream, the
/// elements of the array need not be laid out in contiguous memory.
///

#ifndef LLVM_SUPPORT_BINARYSTREAMARRAY_H
#define LLVM_SUPPORT_BINARYSTREAMARRAY_H
Expand All @@ -17,16 +30,6 @@
#include <cassert>
#include <cstdint>

/// Lightweight arrays that are backed by an arbitrary BinaryStream. This file
/// provides two different array implementations.
///
/// VarStreamArray - Arrays of variable length records. The user specifies
/// an Extractor type that can extract a record from a given offset and
/// return the number of bytes consumed by the record.
///
/// FixedStreamArray - Arrays of fixed length records. This is similar in
/// spirit to ArrayRef<T>, but since it is backed by a BinaryStream, the
/// elements of the array need not be laid out in contiguous memory.
namespace llvm {

/// VarStreamArrayExtractor is intended to be specialized to provide customized
Expand Down
26 changes: 13 additions & 13 deletions llvm/include/llvm/Support/Chrono.h
Expand Up @@ -72,9 +72,21 @@ struct format_provider<sys::TimePoint<>> {
StringRef Style);
};

namespace detail {
template <typename Period> struct unit { static const char value[]; };
template <typename Period> const char unit<Period>::value[] = "";

template <> struct unit<std::ratio<3600>> { static const char value[]; };
template <> struct unit<std::ratio<60>> { static const char value[]; };
template <> struct unit<std::ratio<1>> { static const char value[]; };
template <> struct unit<std::milli> { static const char value[]; };
template <> struct unit<std::micro> { static const char value[]; };
template <> struct unit<std::nano> { static const char value[]; };
} // namespace detail

/// Implementation of format_provider<T> for duration types.
///
/// The options string of a duration type has the grammar:
/// The options string of a duration type has the grammar:
///
/// duration_options ::= [unit][show_unit [number_options]]
/// unit ::= `h`|`m`|`s`|`ms|`us`|`ns`
Expand All @@ -96,18 +108,6 @@ struct format_provider<sys::TimePoint<>> {
/// it is still possible to format it, provided you explicitly request a
/// display unit or you request that the unit is not displayed.

namespace detail {
template <typename Period> struct unit { static const char value[]; };
template <typename Period> const char unit<Period>::value[] = "";

template <> struct unit<std::ratio<3600>> { static const char value[]; };
template <> struct unit<std::ratio<60>> { static const char value[]; };
template <> struct unit<std::ratio<1>> { static const char value[]; };
template <> struct unit<std::milli> { static const char value[]; };
template <> struct unit<std::micro> { static const char value[]; };
template <> struct unit<std::nano> { static const char value[]; };
} // namespace detail

template <typename Rep, typename Period>
struct format_provider<std::chrono::duration<Rep, Period>> {
private:
Expand Down

0 comments on commit a1aada7

Please sign in to comment.