diff --git a/include/revng-c/DataLayoutAnalysis/DLATypeSystem.h b/include/revng-c/DataLayoutAnalysis/DLATypeSystem.h index eef09ba1d..181adf09b 100644 --- a/include/revng-c/DataLayoutAnalysis/DLATypeSystem.h +++ b/include/revng-c/DataLayoutAnalysis/DLATypeSystem.h @@ -138,7 +138,7 @@ public: } }; -///\brief This class handles equivalence classes between indexes of vectors +/// This class handles equivalence classes between indexes of vectors class VectEqClasses : public llvm::IntEqClasses { private: // ID of the first removed ID @@ -146,41 +146,41 @@ private: unsigned NElems = 0; private: - ///\brief Used internally, operator[] is removed for this class + /// Used internally, operator[] is removed for this class unsigned lookupEqClass(unsigned ID) const { return llvm::IntEqClasses::operator[](ID); } public: - ///\brief Add 1 element with its own equivalence class + /// Add 1 element with its own equivalence class unsigned growBy1(); - ///\brief Remove the whole equivalence class of \a ID + /// Remove the whole equivalence class of \a ID void remove(const unsigned ID); - ///\brief Check if the element has been removed + /// Check if the element has been removed bool isRemoved(const unsigned ID) const; - ///\brief Get the total number of elements added + /// Get the total number of elements added unsigned getNumElements() const { return NElems; } public: - ///\brief You can't access the Eq Classes directly, some might be deleted + /// You can't access the Eq Classes directly, some might be deleted unsigned operator[](unsigned) const = delete; - ///\brief Get the Equivalence class ID of an element (must be compressed) + /// Get the Equivalence class ID of an element (must be compressed) ///\return empty if the element is out-of-bounds or has been removed std::optional getEqClassID(const unsigned ID) const; - ///\brief Get all the elements that are in the same equivalence class of \a ID + /// Get all the elements that are in the same equivalence class of \a ID ///\note Expensive: performs a linear scan of all the elements std::vector computeEqClass(const unsigned ID) const; - ///\brief Check if \a ID1 and \a ID2 have the same equivalence class + /// Check if \a ID1 and \a ID2 have the same equivalence class bool haveSameEqClass(unsigned ID1, unsigned ID2) const; }; -///\brief This class is used to print debug information about the TypeSystem +/// This class is used to print debug information about the TypeSystem /// /// Override this to obtain implementation-specific debug prints. struct TSDebugPrinter { diff --git a/include/revng-c/DataLayoutAnalysis/SCEVBaseAddressExplorer.h b/include/revng-c/DataLayoutAnalysis/SCEVBaseAddressExplorer.h index fda0112bc..9a026b696 100644 --- a/include/revng-c/DataLayoutAnalysis/SCEVBaseAddressExplorer.h +++ b/include/revng-c/DataLayoutAnalysis/SCEVBaseAddressExplorer.h @@ -18,7 +18,7 @@ namespace dla { struct LayoutTypeSystemNode; } // end namespace dla -/// \brief Class useful to explore an llvm::SCEV expression to find its base +/// Class useful to explore an llvm::SCEV expression to find its base /// addresses. class SCEVBaseAddressExplorer { public: @@ -31,7 +31,7 @@ public: SCEVBaseAddressExplorer() = default; ~SCEVBaseAddressExplorer() = default; - /// \brief Returns a set containing the SCEVs of \Root 's base addresses. + /// Returns a set containing the SCEVs of \Root 's base addresses. // // The function works exploring the AST of the SCEV, going from the \Root // towards its operands. diff --git a/include/revng-c/HeadersGeneration/HelpersToHeader.h b/include/revng-c/HeadersGeneration/HelpersToHeader.h index 39b1b7699..6fb42e3cd 100644 --- a/include/revng-c/HeadersGeneration/HelpersToHeader.h +++ b/include/revng-c/HeadersGeneration/HelpersToHeader.h @@ -11,7 +11,7 @@ class Module; } // end namespace llvm -/// \brief Generate a C header containing the declaration of each non-isolated +/// Generate a C header containing the declaration of each non-isolated /// function in a given LLVM IR module, i.e. QEMU helpers and revng helpers, /// whose prototype is not in the model. For helpers that return a struct, a /// new struct type will be defined and serialized on-the-fly. diff --git a/include/revng-c/HeadersGeneration/HelpersToHeaderPass.h b/include/revng-c/HeadersGeneration/HelpersToHeaderPass.h index b08f5aed0..7fdacebf6 100644 --- a/include/revng-c/HeadersGeneration/HelpersToHeaderPass.h +++ b/include/revng-c/HeadersGeneration/HelpersToHeaderPass.h @@ -6,7 +6,7 @@ #include "llvm/Pass.h" -/// \brief This pass collects all the calls to QEMU helpers and +/// This pass collects all the calls to QEMU helpers and /// generates a C declaration for each helper. class HelpersToHeaderPass : public llvm::ModulePass { public: diff --git a/include/revng-c/HeadersGeneration/ModelToHeader.h b/include/revng-c/HeadersGeneration/ModelToHeader.h index d016f8d25..c74c012f1 100644 --- a/include/revng-c/HeadersGeneration/ModelToHeader.h +++ b/include/revng-c/HeadersGeneration/ModelToHeader.h @@ -16,7 +16,7 @@ class Binary; } // end namespace model -/// \brief Generate a C header containing a serialization of the type system, +/// Generate a C header containing a serialization of the type system, /// i.e. function prototypes, structs, unions, typedefs, and anything that /// resides in the model. bool dumpModelToHeader(const model::Binary &Model, llvm::raw_ostream &Header); diff --git a/include/revng-c/Liveness/LivenessAnalysis.h b/include/revng-c/Liveness/LivenessAnalysis.h index 619534e32..e818c3116 100644 --- a/include/revng-c/Liveness/LivenessAnalysis.h +++ b/include/revng-c/Liveness/LivenessAnalysis.h @@ -76,7 +76,7 @@ public: return LiveSet::bottom(); } - /// \brief Gets the final results of the analysis + /// Gets the final results of the analysis /// /// returns a LivenessMap, mapping each BasicBlock to its LiveOut set, /// representing all the Instructions that are live at the end. @@ -85,7 +85,7 @@ public: /// Instruction is always live. const LivenessMap &getLiveOut() const { return State; } - /// \brief Extracts the final results of the analysis. + /// Extracts the final results of the analysis. /// /// Returns a LivenessMap, mapping each BasicBlock to its LiveOut set, /// representing all the Instructions that are live at the end. diff --git a/include/revng-c/MarkForSerialization/MarkAnalysis.h b/include/revng-c/MarkForSerialization/MarkAnalysis.h index 164ccbccb..af7ccd618 100644 --- a/include/revng-c/MarkForSerialization/MarkAnalysis.h +++ b/include/revng-c/MarkForSerialization/MarkAnalysis.h @@ -4,7 +4,7 @@ // Copyright (c) rev.ng Srls. See LICENSE.md for details. // -/// \brief Analysis that marks instructions to be serialized in C +/// Analysis that marks instructions to be serialized in C #include diff --git a/include/revng-c/MarkForSerialization/MarkForSerializationFlags.h b/include/revng-c/MarkForSerialization/MarkForSerializationFlags.h index 2abea0560..3fe0b6012 100644 --- a/include/revng-c/MarkForSerialization/MarkForSerializationFlags.h +++ b/include/revng-c/MarkForSerialization/MarkForSerializationFlags.h @@ -10,7 +10,7 @@ class Instruction; } // namespace llvm -/// \brief bitmask that represents reasons why an Instruction muse be serialized +/// bitmask that represents reasons why an Instruction muse be serialized enum SerializationReason { None = 0, AlwaysSerialize = 1 << 0, @@ -40,7 +40,7 @@ inline SerializationReason operator~(SerializationReason a) { return static_cast(~static_cast(a)); } -/// \brief Wrapper class for SerializationReason +/// Wrapper class for SerializationReason class SerializationFlags { public: SerializationFlags() = default; @@ -59,14 +59,14 @@ public: SerializationReason value() const { return Flags; } - /// \brief Returns true if the Instruction associated with \F must be + /// Returns true if the Instruction associated with \F must be /// serialized in C. static bool mustBeSerialized(const SerializationFlags &F) { // If any of the bits is set, it must be serialized. return F.Flags != None; } - /// \brief Returns true if the Instruction associated with \F needs a VarDecl + /// Returns true if the Instruction associated with \F needs a VarDecl /// in C. static bool needsVarDecl(const SerializationFlags &F) { @@ -84,14 +84,14 @@ public: return true; } - /// \brief Returns true if the Instruction associated with \F is affected by + /// Returns true if the Instruction associated with \F is affected by /// side effects. static bool hasSideEffects(const SerializationFlags &F) { // HasSideEffects, and HasInterferingSideEffects imply side effects. return F.Flags & (HasSideEffects | HasInterferingSideEffects); } - /// \brief Returns true if the Instruction associated with \F needs many + /// Returns true if the Instruction associated with \F needs many /// statements in C. // // A notable example is InsertValue. diff --git a/include/revng-c/MarkForSerialization/MarkForSerializationPass.h b/include/revng-c/MarkForSerialization/MarkForSerializationPass.h index 556e8983a..14c5b7ff6 100644 --- a/include/revng-c/MarkForSerialization/MarkForSerializationPass.h +++ b/include/revng-c/MarkForSerialization/MarkForSerializationPass.h @@ -4,7 +4,7 @@ // Copyright (c) rev.ng Srls. See LICENSE.md for details. // -/// \brief Pass that identifies which Instructions must be serialized +/// Pass that identifies which Instructions must be serialized #include #include diff --git a/include/revng-c/RestructureCFGPass/ASTTree.h b/include/revng-c/RestructureCFGPass/ASTTree.h index dc35ef395..3148c93ea 100644 --- a/include/revng-c/RestructureCFGPass/ASTTree.h +++ b/include/revng-c/RestructureCFGPass/ASTTree.h @@ -97,15 +97,15 @@ public: ASTNode *copyASTNodesFrom(ASTTree &OldAST); - /// \brief Dump a GraphViz file on a file using an absolute path + /// Dump a GraphViz file on a file using an absolute path void dumpASTOnFile(const std::string &FileName) const; - /// \brief Dump a GraphViz file on a file using an absolute path + /// Dump a GraphViz file on a file using an absolute path void dumpASTOnFile(const char *FName) const { return dumpASTOnFile(std::string(FName)); } - /// \brief Dump a GraphViz file on a file representing this function + /// Dump a GraphViz file on a file representing this function void dumpASTOnFile(const std::string &FolderName, const std::string &FunctionName, const std::string &FileName) const; diff --git a/include/revng-c/RestructureCFGPass/BasicBlockNode.h b/include/revng-c/RestructureCFGPass/BasicBlockNode.h index 8170145bf..49b33d737 100644 --- a/include/revng-c/RestructureCFGPass/BasicBlockNode.h +++ b/include/revng-c/RestructureCFGPass/BasicBlockNode.h @@ -20,7 +20,7 @@ template class RegionCFG; -/// \brief Graph Node, representing a basic block +/// Graph Node, representing a basic block template class BasicBlockNode { protected: @@ -144,17 +144,17 @@ public: BBN.NodeType, BBN.StateVariableValue) {} - /// \brief Constructor for nodes pointing to LLVM IR BasicBlock + /// Constructor for nodes pointing to LLVM IR BasicBlock explicit BasicBlockNode(RegionCFGT *Parent, NodeT OriginalNode, llvm::StringRef Name = "") : BasicBlockNode(Parent, OriginalNode, nullptr, Name, Type::Code) {} - /// \brief Constructor for nodes representing collapsed subgraphs + /// Constructor for nodes representing collapsed subgraphs explicit BasicBlockNode(RegionCFGT *Parent, RegionCFGT *Collapsed) : BasicBlockNode(Parent, nullptr, Collapsed, "collapsed", Type::Collapsed) {} - /// \brief Constructor for empty dummy nodes and for entry/exit dispatcher + /// Constructor for empty dummy nodes and for entry/exit dispatcher explicit BasicBlockNode(RegionCFG *Parent, llvm::StringRef Name, Type T) : @@ -163,7 +163,7 @@ public: or T == Type::Dispatcher or T == Type::Tile); } - /// \brief Constructor for dummy nodes that handle the state variable + /// Constructor for dummy nodes that handle the state variable explicit BasicBlockNode(RegionCFGT *Parent, llvm::StringRef Name, Type T, @@ -322,7 +322,7 @@ public: bool isEquivalentTo(BasicBlockNode *) const; - /// \brief Obtain a estimate of the weight of a BasicBlockNode in terms of + /// Obtain a estimate of the weight of a BasicBlockNode in terms of /// original instructions. size_t getWeight() const; diff --git a/include/revng-c/RestructureCFGPass/MetaRegion.h b/include/revng-c/RestructureCFGPass/MetaRegion.h index d13a4eb62..10bb1d47f 100644 --- a/include/revng-c/RestructureCFGPass/MetaRegion.h +++ b/include/revng-c/RestructureCFGPass/MetaRegion.h @@ -17,7 +17,7 @@ template class BasicBlockNode; -/// \brief The MetaRegion class, a wrapper for a set of nodes. +/// The MetaRegion class, a wrapper for a set of nodes. template class MetaRegion { diff --git a/include/revng-c/RestructureCFGPass/RegionCFGTree.h b/include/revng-c/RestructureCFGPass/RegionCFGTree.h index 8cf5d3189..20f0fce0c 100644 --- a/include/revng-c/RestructureCFGPass/RegionCFGTree.h +++ b/include/revng-c/RestructureCFGPass/RegionCFGTree.h @@ -41,7 +41,7 @@ inline bool isASwitch(BasicBlockNode *Node) { return false; } -/// \brief The RegionCFG, a container for BasicBlockNodes +/// The RegionCFG, a container for BasicBlockNodes template class RegionCFG { @@ -329,19 +329,19 @@ public: std::vector &getNodes() { return BlockNodes; } public: - /// \brief Dump a GraphViz representing this function on any stream + /// Dump a GraphViz representing this function on any stream template void dumpDot(StreamT &) const; - /// \brief Dump a GraphViz file on a file using an absolute path + /// Dump a GraphViz file on a file using an absolute path void dumpCFGOnFile(const std::string &FileName) const; - /// \brief Dump a GraphViz file on a file using an absolute path + /// Dump a GraphViz file on a file using an absolute path void dumpCFGOnFile(const char *FName) const { return dumpCFGOnFile(std::string(FName)); } - /// \brief Dump a GraphViz file on a file representing this function + /// Dump a GraphViz file on a file representing this function void dumpCFGOnFile(const std::string &FunctionName, const std::string &FolderName, const std::string &FileName) const; @@ -354,10 +354,10 @@ public: BBNodeT *cloneUntilExit(BBNodeT *Node, BBNodeT *Sink); - /// \brief Apply the untangle preprocessing pass. + /// Apply the untangle preprocessing pass. void untangle(); - /// \brief Apply comb to the region. + /// Apply comb to the region. void inflate(); void removeNotReachables(); diff --git a/include/revng-c/RestructureCFGPass/RegionCFGTreeImpl.h b/include/revng-c/RestructureCFGPass/RegionCFGTreeImpl.h index 88976bde0..22ccba6a5 100644 --- a/include/revng-c/RestructureCFGPass/RegionCFGTreeImpl.h +++ b/include/revng-c/RestructureCFGPass/RegionCFGTreeImpl.h @@ -231,7 +231,7 @@ RegionCFG::streamNode(StreamT &S, const BasicBlockNodeT *BB) const { S << "];\n"; } -/// \brief Dump a GraphViz file on stdout representing this function +/// Dump a GraphViz file on stdout representing this function template template inline void RegionCFG::dumpDot(StreamT &S) const { diff --git a/include/revng-c/Support/ModelHelpers.h b/include/revng-c/Support/ModelHelpers.h index 364c6fc66..d2f1b07e3 100644 --- a/include/revng-c/Support/ModelHelpers.h +++ b/include/revng-c/Support/ModelHelpers.h @@ -4,16 +4,16 @@ #include "revng/Model/Type.h" #include "revng/Model/VerifyHelper.h" -/// \brief Strip off all the possible layers of constness and typedefs from QT +/// Strip off all the possible layers of constness and typedefs from QT extern model::QualifiedType peelConstAndTypedefs(const model::QualifiedType &QT, model::VerifyHelper &VH); -/// \brief Strip off all the possible layers of constness and typedefs from QT +/// Strip off all the possible layers of constness and typedefs from QT inline model::QualifiedType peelConstAndTypedefs(const model::QualifiedType &QT) { model::VerifyHelper VH; return peelConstAndTypedefs(QT, VH); } -/// \brief Create an empty model::StructType of size Size in Binary +/// Create an empty model::StructType of size Size in Binary extern model::TypePath createEmptyStruct(model::Binary &Binary, uint64_t Size); diff --git a/include/revng-c/ThreadSafeClangTooling/ThreadSafeClangTooling.h b/include/revng-c/ThreadSafeClangTooling/ThreadSafeClangTooling.h index c13833012..ef0c7a604 100644 --- a/include/revng-c/ThreadSafeClangTooling/ThreadSafeClangTooling.h +++ b/include/revng-c/ThreadSafeClangTooling/ThreadSafeClangTooling.h @@ -14,20 +14,20 @@ namespace revng { namespace c { -/// \brief Default arguments for clang tools used by revng-c +/// Default arguments for clang tools used by revng-c extern const std::vector ClangToolDefaultArgs; } // namespace c } // namespace revng -/// \brief Mutex for concurrently running clang::tooling +/// Mutex for concurrently running clang::tooling extern std::mutex ClangToolingMutex; -/// \brief Thread-safely run ToolAction on Code, with revng-c default arguments +/// Thread-safely run ToolAction on Code, with revng-c default arguments bool runThreadSafeClangTool(std::unique_ptr ToolAction, const std::string &Code); -/// \brief Thread-safely run ToolAction on Code, passing Args as cmdline options +/// Thread-safely run ToolAction on Code, passing Args as cmdline options bool runThreadSafeClangTool(std::unique_ptr ToolAction, const std::string &Code, const std::vector &Args); diff --git a/include/revng-c/TypeNames/LLVMTypeNames.h b/include/revng-c/TypeNames/LLVMTypeNames.h index 8fa3d6d1a..e5093b1f3 100644 --- a/include/revng-c/TypeNames/LLVMTypeNames.h +++ b/include/revng-c/TypeNames/LLVMTypeNames.h @@ -20,13 +20,13 @@ constexpr const char *const StructFieldPrefix = "field_"; using TypeString = llvm::SmallString<32>; -/// \brief Print the C name of an LLVM Scalar type. +/// Print the C name of an LLVM Scalar type. /// \note Pointer types use the \a BaseType provided if it's not empty, /// otherwise they are converted as `void *` extern TypeString getScalarCType(const llvm::Type *LLVMType, llvm::StringRef BaseType = ""); -/// \brief Get the name of the type returned by an llvm::Function. +/// Get the name of the type returned by an llvm::Function. /// \note Do not use this for isolated functions - use the Model prototype /// instead extern TypeString getReturnType(const llvm::Function *Func); @@ -36,5 +36,5 @@ struct FieldInfo { TypeString FieldTypeName; }; -/// \brief Return the name and type of the \a Index -th field of a struct type. +/// Return the name and type of the \a Index -th field of a struct type. extern FieldInfo getFieldName(const llvm::StructType *StructTy, size_t Index); diff --git a/include/revng-c/TypeNames/ModelTypeNames.h b/include/revng-c/TypeNames/ModelTypeNames.h index 483edc68f..81fa45461 100644 --- a/include/revng-c/TypeNames/ModelTypeNames.h +++ b/include/revng-c/TypeNames/ModelTypeNames.h @@ -28,38 +28,38 @@ constexpr const char *const ArrayWrapperFieldName = "the_array"; using TypeString = llvm::SmallString<32>; -/// \brief Return an escaped name for the type +/// Return an escaped name for the type /// \note If T is a function type, the appropriate function typename will be /// returned extern TypeString getTypeName(const model::Type &T); -/// \brief Print a string containing the C Type name of \a QT and a +/// Print a string containing the C Type name of \a QT and a /// (possibly empty) \a InstanceName . extern TypeString getNamedCInstance(const model::QualifiedType &QT, llvm::StringRef InstanceName); -/// \brief Return the name of the array wrapper that wraps \a QT (QT must be +/// Return the name of the array wrapper that wraps \a QT (QT must be /// an array). extern TypeString getArrayWrapper(const model::QualifiedType &QT); -/// \brief Return the name of the type returned by \a F +/// Return the name of the type returned by \a F /// \note If F returns more than one value, the name of the wrapping struct /// will be returned. extern TypeString getReturnTypeName(const model::RawFunctionType &F); -/// \brief Return the name of the array wrapper that wraps \a QT (QT must be +/// Return the name of the array wrapper that wraps \a QT (QT must be /// an array). /// \note If F returns an array, the name of the wrapping struct will be /// returned. extern TypeString getReturnTypeName(const model::CABIFunctionType &F); -/// \brief Return the name of the \a Index -th field of the struct returned +/// Return the name of the \a Index -th field of the struct returned /// by \a F. /// \note F must be returning more than one value, otherwise /// there is no wrapping struct. extern TypeString getReturnField(const model::RawFunctionType &F, size_t Index); -/// \brief Print the function prototype (without any trailing ';') of \a FT +/// Print the function prototype (without any trailing ';') of \a FT /// using \a FunctionName as the function's name. If the return value /// or any of the arguments needs a wrapper, print it with the /// corresponding wrapper type. The definition of such wrappers diff --git a/include/revng-c/ValueManipulationAnalysis/TypeColors.h b/include/revng-c/ValueManipulationAnalysis/TypeColors.h index 9435acab3..65655f4e8 100644 --- a/include/revng-c/ValueManipulationAnalysis/TypeColors.h +++ b/include/revng-c/ValueManipulationAnalysis/TypeColors.h @@ -15,7 +15,7 @@ namespace vma { -/// \brief Index of each color in the bitset +/// Index of each color in the bitset enum ColorIndex : uint8_t { POINTERNESS_INDEX, UNSIGNEDNESS_INDEX, @@ -26,7 +26,7 @@ enum ColorIndex : uint8_t { MAX_COLORS }; -/// \brief Useful constants representing one, none and all colors +/// Useful constants representing one, none and all colors enum BaseColor : unsigned { NO_COLOR = 0, POINTERNESS = (1 << POINTERNESS_INDEX), @@ -38,10 +38,10 @@ enum BaseColor : unsigned { ALL_COLORS = (1 << MAX_COLORS) - 1 }; -/// \brief Name of each color, used for printing +/// Name of each color, used for printing const llvm::StringRef TypeColorName[] = { "P", "U", "B", "S", "F", "N" }; -/// \brief Set of colors, stored as a bitset +/// Set of colors, stored as a bitset struct ColorSet { using BitsetT = std::bitset; BitsetT Bits; @@ -58,18 +58,18 @@ struct ColorSet { ColorSet(const BitsetT &B) : Bits(B) {} ColorSet(BitsetT &&B) : Bits(B) {} - /// \brief Check if this ColorSet contains all colors of the argument + /// Check if this ColorSet contains all colors of the argument bool contains(const ColorSet &Other) const { return (Bits | Other.Bits) == Bits; } - /// \brief Add all colors of the argument to this ColorSet + /// Add all colors of the argument to this ColorSet void addColor(const ColorSet &Other) { Bits |= Other.Bits; } - /// \brief Count how many valid type candidates are contained in this ColorSet + /// Count how many valid type candidates are contained in this ColorSet size_t countValid() const { return (Bits & BitsetT(~NUMBERNESS)).count(); } - /// \brief Print the name of the colors contained in this ColorSet + /// Print the name of the colors contained in this ColorSet void print(llvm::raw_ostream &Out) const debug_function { if (Bits == ALL_COLORS) { Out << "all"; @@ -81,7 +81,7 @@ struct ColorSet { Out << TypeColorName[I]; } - /// \brief Index of the next set bit, starting from \a StartIndex (excluded) + /// Index of the next set bit, starting from \a StartIndex (excluded) /// \param Idx Where to start from (if == -1 start from the first) /// \return MAX_COLORS if there's no set bit after this index ColorIndex nextSetBit(int StartIndex) const { @@ -96,7 +96,7 @@ struct ColorSet { return MAX_COLORS; } - /// \brief Index of the first set bit + /// Index of the first set bit /// \return MAX_COLORS if there's no set bit ColorIndex firstSetBit() const { return nextSetBit(/*StartIndex*/ -1); } diff --git a/include/revng-c/ValueManipulationAnalysis/ValueManipulationAnalysis.h b/include/revng-c/ValueManipulationAnalysis/ValueManipulationAnalysis.h index a7854025c..5758e75de 100644 --- a/include/revng-c/ValueManipulationAnalysis/ValueManipulationAnalysis.h +++ b/include/revng-c/ValueManipulationAnalysis/ValueManipulationAnalysis.h @@ -10,7 +10,7 @@ #include "revng-c/ValueManipulationAnalysis/TypeColors.h" -/// \brief Assign a type color for each Use and Value of a function +/// Assign a type color for each Use and Value of a function class ValueManipulationAnalysis : public llvm::FunctionPass { public: using ColorMapT = std::map; @@ -23,7 +23,7 @@ public: bool runOnFunction(llvm::Function &F) override; void getAnalysisUsage(llvm::AnalysisUsage &AU) const override; - ///\brief ColorMap getter + /// ColorMap getter ///\return A map between `llvm::Value*`s and their type color const ColorMapT &getColorMap() const { return ColorMap; } diff --git a/lib/BeautifyGHAST/BeautifyGHAST.cpp b/lib/BeautifyGHAST/BeautifyGHAST.cpp index 7c7839b87..241ce1a8a 100644 --- a/lib/BeautifyGHAST/BeautifyGHAST.cpp +++ b/lib/BeautifyGHAST/BeautifyGHAST.cpp @@ -1,5 +1,5 @@ /// \file CDecompilerBeautify.cpp -/// \brief Bautify passes on the final AST +/// Bautify passes on the final AST /// // diff --git a/lib/DataLayoutAnalysis/Backend/DLAMakeLayouts.h b/lib/DataLayoutAnalysis/Backend/DLAMakeLayouts.h index 523522062..4c932dcbf 100644 --- a/lib/DataLayoutAnalysis/Backend/DLAMakeLayouts.h +++ b/lib/DataLayoutAnalysis/Backend/DLAMakeLayouts.h @@ -11,7 +11,7 @@ namespace dla { /// Final step, which flattens out the types into memory layouts using LayoutPtrVector = std::vector; -///\brief Generate Layout objects from a DLATypeSystem +/// Generate Layout objects from a DLATypeSystem /// /// Some nodes of a DLATypeSystem graph can generate a Layout, that is added to /// \a Layouts. @@ -25,7 +25,7 @@ using LayoutPtrVector = std::vector; ///\return a vector of Layouts ordered using TS equivalence classes LayoutPtrVector makeLayouts(const LayoutTypeSystem &TS, LayoutVector &Layouts); -///\brief Create a map between LayoutTypePtrs and Layouts +/// Create a map between LayoutTypePtrs and Layouts ///\param Values the list of LayoutTypePtrs ///\param OrderedLayouts the list of Layouts ///\param EqClasses equivalence classes between indexes of \a Values and diff --git a/lib/DataLayoutAnalysis/Backend/DLAMakeModelTypes.h b/lib/DataLayoutAnalysis/Backend/DLAMakeModelTypes.h index 77c824d8c..1642a10af 100644 --- a/lib/DataLayoutAnalysis/Backend/DLAMakeModelTypes.h +++ b/lib/DataLayoutAnalysis/Backend/DLAMakeModelTypes.h @@ -13,15 +13,15 @@ using TypeMapT = std::map; namespace dla { -///\brief Generate model types from a LayoutTypeSystem graph. +/// Generate model types from a LayoutTypeSystem graph. ///\return A vector of model Types where each position corresponds to the /// equivalence class of the LayoutTypeSystemNode that generated the type. TypeMapT makeModelTypes(const LayoutTypeSystem &TS, const LayoutTypePtrVect &Values, TupleTree &Model); -///\brief Attach model types to function arguments and return values. -///\brief Whether there was anything to update in the model. +/// Attach model types to function arguments and return values. +/// Whether there was anything to update in the model. bool updateFuncSignatures(const llvm::Module &M, TupleTree &Model, const TypeMapT &TypeMap); diff --git a/lib/DataLayoutAnalysis/Backend/DLAUpdateFuncPrototypes.cpp b/lib/DataLayoutAnalysis/Backend/DLAUpdateFuncPrototypes.cpp index 317bbe7e2..e8876fa20 100644 --- a/lib/DataLayoutAnalysis/Backend/DLAUpdateFuncPrototypes.cpp +++ b/lib/DataLayoutAnalysis/Backend/DLAUpdateFuncPrototypes.cpp @@ -47,7 +47,7 @@ using model::PrimitiveTypeKind::PointerOrNumber; using model::QualifierKind::Pointer; // TODO: implement a better way to merge qualified types -///\brief Check if a type can be narrowed down to finer types. +/// Check if a type can be narrowed down to finer types. static bool canBeNarrowedDown(QualifiedType T) { return T.isPrimitive(PointerOrNumber) or T.isPrimitive(Generic); } @@ -59,7 +59,7 @@ static const llvm::Value *toLLVMValue(const llvm::Use &A) { return A.get(); } -///\brief If the DLA recovered a more precise type than the already existing one +/// If the DLA recovered a more precise type than the already existing one /// for any of the arguments of a RawFunctionType, update the model accordingly. template static bool updateRawFuncArgs(model::Binary &Model, @@ -306,7 +306,7 @@ static bool updateFuncStackFrame(model::Function &ModelFunc, return Updated; } -///\brief If the DLA recovered a more precise type than the already existing one +/// If the DLA recovered a more precise type than the already existing one /// for the return type of a RawFunctionType, update the model accordingly. static bool updateRawFuncRetValue(model::Binary &Model, RawFunctionType *ModelPrototype, @@ -366,7 +366,7 @@ static bool updateRawFuncRetValue(model::Binary &Model, return Updated; } -///\brief Update the prototype of a function with the types recovered by DLA. +/// Update the prototype of a function with the types recovered by DLA. template static bool updateFuncPrototype(model::Binary &Model, model::Type *Prototype, diff --git a/lib/DataLayoutAnalysis/DLAModelFuncHelpers.h b/lib/DataLayoutAnalysis/DLAModelFuncHelpers.h index d3f2c1a40..44cf9ac9c 100644 --- a/lib/DataLayoutAnalysis/DLAModelFuncHelpers.h +++ b/lib/DataLayoutAnalysis/DLAModelFuncHelpers.h @@ -17,14 +17,14 @@ namespace dla { -///\brief Get the metaaddres of an isolated function +/// Get the metaaddres of an isolated function ///\return an invalid MetaAddress if the function is not an isolated one MetaAddress getMetaAddress(const llvm::Function *F); -///\brief Get the metaadress of the CallEdge associated to a given CallInst +/// Get the metaadress of the CallEdge associated to a given CallInst ///\return an invalid MetaAddress if no CallEdge is associated to \a C MetaAddress getMetaAddress(const llvm::CallInst *C); -///\brief If \a C is an IndirectCall, get the corresponding Prototype from the +/// If \a C is an IndirectCall, get the corresponding Prototype from the /// Model, otherwise return a nullptr. model::Type * getIndirectCallPrototype(const llvm::CallInst *C, const model::Binary &Model); @@ -51,7 +51,7 @@ inline unsigned long arg_size(const llvm::CallInst *C) { return llvm::size(C->arg_operands()); } -///\brief Wrapper around a variant between Function and CallInst +/// Wrapper around a variant between Function and CallInst class FuncOrCallInst { private: std::variant Val; @@ -72,7 +72,7 @@ public: const llvm::Value *getVal() const; const llvm::Type *getRetType() const; - ///\brief Get the \a Idx-th argument + /// Get the \a Idx-th argument const llvm::Value *getArg(unsigned Idx) const; unsigned long arg_size() const; }; diff --git a/lib/DataLayoutAnalysis/Frontend/DLACreateInterProceduralTypes.cpp b/lib/DataLayoutAnalysis/Frontend/DLACreateInterProceduralTypes.cpp index d6d727fd4..69c488a56 100644 --- a/lib/DataLayoutAnalysis/Frontend/DLACreateInterProceduralTypes.cpp +++ b/lib/DataLayoutAnalysis/Frontend/DLACreateInterProceduralTypes.cpp @@ -24,7 +24,7 @@ using namespace llvm; using TSBuilder = DLATypeSystemLLVMBuilder; -///\brief Given an llvm Function, return its prototype in the model. +/// Given an llvm Function, return its prototype in the model. static const model::Type * getPrototype(const llvm::Function &F, const model::Binary &Model) { auto MetaAddr = getMetaAddress(&F); diff --git a/lib/DataLayoutAnalysis/Frontend/DLATypeSystemBuilder.h b/lib/DataLayoutAnalysis/Frontend/DLATypeSystemBuilder.h index 98dc3f3f1..2f6a1a3f4 100644 --- a/lib/DataLayoutAnalysis/Frontend/DLATypeSystemBuilder.h +++ b/lib/DataLayoutAnalysis/Frontend/DLATypeSystemBuilder.h @@ -15,7 +15,7 @@ namespace dla { -///\brief This class is used to print LLVM information when debugging the TS +/// This class is used to print LLVM information when debugging the TS /// /// Since nodes in the TypeSystem graph only have IDs, which are grouped into /// equivalence classes, if we want to track each ID back to the original LLVM @@ -27,7 +27,7 @@ protected: const LayoutTypePtrVect &Values; public: - ///\brief Build the Debug printer + /// Build the Debug printer /// ///\param M The LLVM module from which the TS graph was built ///\param Values Ordered vector, Values are indexed with the ID of the @@ -38,32 +38,32 @@ public: LLVMTSDebugPrinter() = delete; public: - ///\brief Print the `llvm::Value`s collapsed inside \a N + /// Print the `llvm::Value`s collapsed inside \a N void printNodeContent(const LayoutTypeSystem &TS, const LayoutTypeSystemNode *N, llvm::raw_fd_ostream &DotFile) const override; }; -///\brief This class builds a DLA type system from an LLVM module +/// This class builds a DLA type system from an LLVM module class DLATypeSystemLLVMBuilder { public: using VisitedMapT = std::map; using PrototypesMapT = std::map; private: - ///\brief Separate class that add `Instance` edges + /// Separate class that add `Instance` edges class InstanceLinkAdder; - ///\brief The TypeSystem to build + /// The TypeSystem to build LayoutTypeSystem &TS; - ///\brief Ordered vector, each element is indexed with the ID of the + /// Ordered vector, each element is indexed with the ID of the /// corresponding Node LayoutTypePtrVect Values; - ///\brief Reverse map between `llvm::Value`s and Nodes + /// Reverse map between `llvm::Value`s and Nodes VisitedMapT VisitedValues; - ///\brief Associate each indirect call's prototype in the model with the + /// Associate each indirect call's prototype in the model with the /// first `llvm::CallInst` found with that prototype, PrototypesMapT VisitedPrototypes; @@ -94,13 +94,13 @@ private: llvm::ModulePass *MP, const model::Binary &Model); - ///\brief Collect LayoutTypePtrs and place them in the right position + /// Collect LayoutTypePtrs and place them in the right position void createValuesList(); public: LayoutTypePtrVect &getValues() { return Values; } - ///\brief Print a `.csv` with the mapping between nodes and `llvm::Value`s + /// Print a `.csv` with the mapping between nodes and `llvm::Value`s /// /// The mapping is reconstructed on-the-fly, therefore is expensive. The /// generated .csv uses _semicolons_ as separators. @@ -109,7 +109,7 @@ public: public: DLATypeSystemLLVMBuilder(LayoutTypeSystem &TS) : TS(TS){}; - ///\brief Create a DLATypeSystem graph for a given LLVM module + /// Create a DLATypeSystem graph for a given LLVM module /// /// LayoutTypePtrs represent elements of the LLVM IR that are thought to be /// possible pointers. The builder's job is to: @@ -121,7 +121,7 @@ public: llvm::ModulePass *MP, const model::Binary &Model); - ///\brief Given a Call instruction and its containing function, check if it + /// Given a Call instruction and its containing function, check if it /// shares the model prototype with another function and. If it does, connect /// return values and arguments with equality links. bool connectToFuncWithSamePrototype(const llvm::Function &F, diff --git a/lib/DataLayoutAnalysis/Middleend/DLADeduplicateUnionFields.cpp b/lib/DataLayoutAnalysis/Middleend/DLADeduplicateUnionFields.cpp index 3445a3a88..3ebf6f98e 100644 --- a/lib/DataLayoutAnalysis/Middleend/DLADeduplicateUnionFields.cpp +++ b/lib/DataLayoutAnalysis/Middleend/DLADeduplicateUnionFields.cpp @@ -34,7 +34,7 @@ static Logger<> CmpLog("dla-duf-comparisons"); namespace dla { -///\brief Strong ordering for nodes: order by size, then by number of successors +/// Strong ordering for nodes: order by size, then by number of successors static order cmpNodes(const LTSN *A, const LTSN *B) { if (A == B) return order::equal; @@ -65,7 +65,7 @@ static order cmpNodes(const LTSN *A, const LTSN *B) { return order::equal; } -///\brief Strong ordering for edges: order by kind, then by offset expression +/// Strong ordering for edges: order by kind, then by offset expression static order cmpEdgeTags(const Tag *A, const Tag *B) { if (A == B) return order::equal; @@ -119,7 +119,7 @@ static order cmpEdgeTags(const Tag *A, const Tag *B) { return order::equal; } -///\brief Strong ordering for links: compare edge tags and destination node +/// Strong ordering for links: compare edge tags and destination node static order cmpLinks(const Link &A, const Link &B) { const order EdgeOrder = cmpEdgeTags(A.second, B.second); if (EdgeOrder != order::equal) @@ -138,11 +138,11 @@ static order cmpLinks(const Link &A, const Link &B) { return order::equal; } -///\brief Compare two subtrees, saving the visited nodes onto two stacks +/// Compare two subtrees, saving the visited nodes onto two stacks static std::tuple exploreAndCompare(const Link &Child1, const Link &Child2); -///\brief Recursively define an ordering between children of a node +/// Recursively define an ordering between children of a node static bool linkOrderLess(const Link &A, const Link &B) { if (A == B) return false; @@ -231,7 +231,7 @@ exploreAndCompare(const Link &Child1, const Link &Child2) { return { order::equal, VisitStack1, VisitStack2 }; } -///\brief Check if two subtrees are equivalent, saving the visited nodes in the +/// Check if two subtrees are equivalent, saving the visited nodes in the /// order in which they were compared. static std::tuple areEquivSubtrees(const Link &Child1, const Link &Child2) { @@ -241,7 +241,7 @@ areEquivSubtrees(const Link &Child1, const Link &Child2) { return { AreSubtreesEqual, Visited1, Visited2 }; } -///\brief Visit the two subtrees of \a Child1 and \a Child2. If they are +/// Visit the two subtrees of \a Child1 and \a Child2. If they are /// equivalent, merge each node with the one it has been compared to. /// ///\return true if the two nodes were merged, and merged subtree @@ -332,7 +332,7 @@ mergeIfTopologicallyEq(LayoutTypeSystem &TS, return { true, Subtree1, ErasedNodes }; } -///\brief Remove conflicting edges and collapse single children after merging. +/// Remove conflicting edges and collapse single children after merging. static bool postProcessMerge(LayoutTypeSystem &TS, const EdgeList &MergedSubtree) { bool Modified = false; diff --git a/lib/Decompiler/ASTBuildAnalysis.h b/lib/Decompiler/ASTBuildAnalysis.h index ded70f932..c721efda2 100644 --- a/lib/Decompiler/ASTBuildAnalysis.h +++ b/lib/Decompiler/ASTBuildAnalysis.h @@ -1,6 +1,6 @@ #pragma once -/// \brief DataFlow analysis to build the AST for a Function +/// DataFlow analysis to build the AST for a Function // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/lib/FilterForDecompilation/FilterForDecompilationPass.cpp b/lib/FilterForDecompilation/FilterForDecompilationPass.cpp index e53bc33d8..75c33c411 100644 --- a/lib/FilterForDecompilation/FilterForDecompilationPass.cpp +++ b/lib/FilterForDecompilation/FilterForDecompilationPass.cpp @@ -18,7 +18,7 @@ void FFDFP::getAnalysisUsage(llvm::AnalysisUsage &AU) const { AU.addRequired(); } -/// \brief Drop the body of all non-lifted functions, and add `optnone` and +/// Drop the body of all non-lifted functions, and add `optnone` and /// `noinline` attributes so that they can be eliminated by DCE. static bool filterFunction(llvm::Function &F) { auto FTags = FunctionTags::TagsSet::from(&F); diff --git a/lib/HeadersGeneration/HelpersToHeader.cpp b/lib/HeadersGeneration/HelpersToHeader.cpp index b44ffdc6b..80992e77b 100644 --- a/lib/HeadersGeneration/HelpersToHeader.cpp +++ b/lib/HeadersGeneration/HelpersToHeader.cpp @@ -25,7 +25,7 @@ using llvm::dyn_cast; static Logger<> Log{ "helpers-to-header" }; -/// \brief Print the declaration a C struct corresponding to an LLVM struct +/// Print the declaration a C struct corresponding to an LLVM struct /// type. static void printDefinition(const llvm::StructType *S, const llvm::StringRef StructName, @@ -39,7 +39,7 @@ static void printDefinition(const llvm::StructType *S, Header << "} " << StructName << ";\n"; } -/// \brief Print the prototype of a helper . +/// Print the prototype of a helper . static void printHelperPrototype(const llvm::Function *Func, llvm::raw_ostream &Header) { Header << getReturnType(Func) << " " diff --git a/lib/HeadersGeneration/ModelToHeader.cpp b/lib/HeadersGeneration/ModelToHeader.cpp index 49b5aae50..cf2122f3c 100644 --- a/lib/HeadersGeneration/ModelToHeader.cpp +++ b/lib/HeadersGeneration/ModelToHeader.cpp @@ -180,7 +180,7 @@ printDeclaration(const model::TypedefType &TD, llvm::raw_ostream &Header) { << ";\n"; } -/// \brief Generate the definition of a new struct type that wraps all the +/// Generate the definition of a new struct type that wraps all the /// return values of \a F. The name of the struct type is provided by the /// caller. static void generateReturnValueWrapper(const model::RawFunctionType &F, @@ -200,7 +200,7 @@ static void generateReturnValueWrapper(const model::RawFunctionType &F, Header << "} " << getReturnTypeName(F) << ";\n "; } -/// \brief If the function has more than one return value, generate a wrapper +/// If the function has more than one return value, generate a wrapper /// struct that contains them. static void printRawFunctionWrappers(const model::RawFunctionType *F, llvm::raw_ostream &Header) { @@ -211,7 +211,7 @@ static void printRawFunctionWrappers(const model::RawFunctionType *F, revng_assert(Arg.Type.isScalar()); } -/// \brief Print a typedef for a RawFunctionType, that can be used when you have +/// Print a typedef for a RawFunctionType, that can be used when you have /// a variable that is a pointer to a function. static void printDeclaration(const model::RawFunctionType &F, llvm::raw_ostream &Header) { @@ -245,7 +245,7 @@ public: using QualifiedTypeNameMap = std::map; -/// \brief Generate the definition of a new struct type that wraps \a ArrayType. +/// Generate the definition of a new struct type that wraps \a ArrayType. /// This is used to wrap array arguments or array return values of /// CABIFunctionTypes. static void generateArrayWrapper(const model::QualifiedType &ArrayType, @@ -265,7 +265,7 @@ static void generateArrayWrapper(const model::QualifiedType &ArrayType, Header << "} " << WrapperName << ";\n "; } -/// \brief If the return value or any of the arguments is an array, generate +/// If the return value or any of the arguments is an array, generate /// a wrapper struct for each of them, if it's not already in the cache. static void printCABIFunctionWrappers(const model::CABIFunctionType *F, llvm::raw_ostream &Header, @@ -278,7 +278,7 @@ static void printCABIFunctionWrappers(const model::CABIFunctionType *F, generateArrayWrapper(Arg.Type, Header, NamesCache); } -/// \brief Print a typedef for a CABIFunctionType, that can be used when you +/// Print a typedef for a CABIFunctionType, that can be used when you /// have a variable that is a pointer to a function. static void printDeclaration(const model::CABIFunctionType &F, llvm::raw_ostream &Header, diff --git a/lib/IRCanonicalization/AddIRSerializationMarkerPass.cpp b/lib/IRCanonicalization/AddIRSerializationMarkerPass.cpp index ba042f493..26cd1183f 100644 --- a/lib/IRCanonicalization/AddIRSerializationMarkerPass.cpp +++ b/lib/IRCanonicalization/AddIRSerializationMarkerPass.cpp @@ -2,7 +2,7 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -/// \brief Pass that wraps Instructions in LLVM IR that must be serialized in +/// Pass that wraps Instructions in LLVM IR that must be serialized in /// special marker calls. #include "llvm/IR/BasicBlock.h" diff --git a/lib/MarkForSerialization/MarkForSerializationPass.cpp b/lib/MarkForSerialization/MarkForSerializationPass.cpp index 17a337c2f..f2c23306b 100644 --- a/lib/MarkForSerialization/MarkForSerializationPass.cpp +++ b/lib/MarkForSerialization/MarkForSerializationPass.cpp @@ -2,7 +2,7 @@ // Copyright rev.ng Srls. See LICENSE.md for details. // -/// \brief Dataflow analysis to identify which Instructions must be serialized +/// Dataflow analysis to identify which Instructions must be serialized #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Instruction.h" diff --git a/lib/RestructureCFGPass/ASTNode.cpp b/lib/RestructureCFGPass/ASTNode.cpp index be4f2ad18..861606a6d 100644 --- a/lib/RestructureCFGPass/ASTNode.cpp +++ b/lib/RestructureCFGPass/ASTNode.cpp @@ -1,5 +1,4 @@ /// \file ASTNode.cpp -/// \brief // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/lib/RestructureCFGPass/ASTTree.cpp b/lib/RestructureCFGPass/ASTTree.cpp index 948c4eb3e..39aa459de 100644 --- a/lib/RestructureCFGPass/ASTTree.cpp +++ b/lib/RestructureCFGPass/ASTTree.cpp @@ -1,5 +1,4 @@ /// \file ASTTree.cpp -/// \brief // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/lib/RestructureCFGPass/BasicBlockNode.cpp b/lib/RestructureCFGPass/BasicBlockNode.cpp index 4ae7bc284..73cbe1ef1 100644 --- a/lib/RestructureCFGPass/BasicBlockNode.cpp +++ b/lib/RestructureCFGPass/BasicBlockNode.cpp @@ -1,5 +1,5 @@ /// \file BasicBlockNode.cpp -/// \brief FunctionPass that applies the comb to the RegionCFG of a function +/// FunctionPass that applies the comb to the RegionCFG of a function // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/lib/RestructureCFGPass/MetaRegion.cpp b/lib/RestructureCFGPass/MetaRegion.cpp index 6706012b9..85543a1f8 100644 --- a/lib/RestructureCFGPass/MetaRegion.cpp +++ b/lib/RestructureCFGPass/MetaRegion.cpp @@ -1,5 +1,5 @@ /// \file Metaregion.cpp -/// \brief FunctionPass that applies the comb to the RegionCFG of a function +/// FunctionPass that applies the comb to the RegionCFG of a function // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/lib/RestructureCFGPass/RegionCFGTree.cpp b/lib/RestructureCFGPass/RegionCFGTree.cpp index 6c49e8a0b..837466f4a 100644 --- a/lib/RestructureCFGPass/RegionCFGTree.cpp +++ b/lib/RestructureCFGPass/RegionCFGTree.cpp @@ -1,5 +1,5 @@ /// \file RegionCFGTree.cpp -/// \brief FunctionPass that applies the comb to the RegionCFG of a function +/// FunctionPass that applies the comb to the RegionCFG of a function // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/lib/RestructureCFGPass/RestructureCFG.cpp b/lib/RestructureCFGPass/RestructureCFG.cpp index a7103708c..013408909 100644 --- a/lib/RestructureCFGPass/RestructureCFG.cpp +++ b/lib/RestructureCFGPass/RestructureCFG.cpp @@ -1,5 +1,5 @@ /// \file Restructure.cpp -/// \brief FunctionPass that applies the comb to the RegionCFG of a function +/// FunctionPass that applies the comb to the RegionCFG of a function // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/lib/TargetFunctionOption/TargetFunctionOption.cpp b/lib/TargetFunctionOption/TargetFunctionOption.cpp index d139e7b96..1dfd5bf52 100644 --- a/lib/TargetFunctionOption/TargetFunctionOption.cpp +++ b/lib/TargetFunctionOption/TargetFunctionOption.cpp @@ -1,5 +1,5 @@ /// \file TargetFunction.cpp -/// \brief File which defines an option later used by the `CDecompilerPass` and +/// File which defines an option later used by the `CDecompilerPass` and /// by the `RestructureCFGPass` // diff --git a/lib/ValueManipulationAnalysis/ContractedGraph.cpp b/lib/ValueManipulationAnalysis/ContractedGraph.cpp index 632b86bf2..d00d5b4ca 100644 --- a/lib/ValueManipulationAnalysis/ContractedGraph.cpp +++ b/lib/ValueManipulationAnalysis/ContractedGraph.cpp @@ -194,7 +194,7 @@ void ContractedGraph::check() { } } -///\brief Insert a TypeFlowNode in the right ContractedNode +/// Insert a TypeFlowNode in the right ContractedNode /// /// If the TypeFlowNode is a "border" node (i.e. it's decided or it doesn't /// have the right color) it will be inserted in the corresponding "special" diff --git a/lib/ValueManipulationAnalysis/ContractedGraph.h b/lib/ValueManipulationAnalysis/ContractedGraph.h index 9ce8dab4d..73bddb24f 100644 --- a/lib/ValueManipulationAnalysis/ContractedGraph.h +++ b/lib/ValueManipulationAnalysis/ContractedGraph.h @@ -12,50 +12,50 @@ namespace vma { -///\brief Super-node that contains TypeFlowGraph nodes +/// Super-node that contains TypeFlowGraph nodes struct ContractedNode { - ///\brief The initial content of the node + /// The initial content of the node llvm::SmallSetVector InitialNodes; - ///\brief Additional nodes that have been collapsed inside this super-node + /// Additional nodes that have been collapsed inside this super-node llvm::SmallSetVector AdditionalNodes; - ///\brief Reset the content to the initialization value + /// Reset the content to the initialization value void reset() { AdditionalNodes.clear(); } - ///\brief Count the number of TypeFlowNodes collapsed inside this super-node + /// Count the number of TypeFlowNodes collapsed inside this super-node unsigned totalSize() { return InitialNodes.size() + AdditionalNodes.size(); } - ///\brief Check if a TypeFlowNode is part of this super node + /// Check if a TypeFlowNode is part of this super node bool contains(TypeFlowNode *TFN) const { return InitialNodes.count(TFN) or AdditionalNodes.count(TFN); } }; -///\brief Graph of super-nodes built upon the TypeFlowGraph +/// Graph of super-nodes built upon the TypeFlowGraph struct ContractedGraph { using EdgeT = std::pair; using EdgeContainerT = llvm::SmallVector; using NodeContainerT = llvm::SmallVector, 8>; using ReverseMapT = llvm::SmallDenseMap; - ///\brief Color that is being decided by contracting this graph + /// Color that is being decided by contracting this graph const ColorSet Color; - ///\brief Container of the ContractedNodes, owned by the graph + /// Container of the ContractedNodes, owned by the graph NodeContainerT Nodes; - ///\brief Number of unique TypeFlowNodes inside all the ContractedNodes + /// Number of unique TypeFlowNodes inside all the ContractedNodes size_t NTypeFlowNodes = 0; - ///\brief Set of TypeFlowNodes that will eventually be assigned to Color + /// Set of TypeFlowNodes that will eventually be assigned to Color ContractedNode *NodesToColor; - ///\brief Set of TypeFlowNodes from which Color will be eventually removed + /// Set of TypeFlowNodes from which Color will be eventually removed ContractedNode *NodesToUncolor; - ///\brief Maps each TypeFlowNode to the ContractedNode it is currently in + /// Maps each TypeFlowNode to the ContractedNode it is currently in ReverseMapT ReverseMap; - ///\brief List of edges of the TypeFlowGraph that we want to contract + /// List of edges of the TypeFlowGraph that we want to contract EdgeContainerT EdgeList; - ///\brief Edges that have been already collapsed are moved after this index + /// Edges that have been already collapsed are moved after this index unsigned NActiveEdges = 0; ContractedGraph() = delete; @@ -65,10 +65,10 @@ struct ContractedGraph { ContractedGraph &operator=(const ContractedGraph &N) = delete; ContractedGraph &operator=(ContractedGraph &&N) = delete; - ///\brief Add a new ContractedNode with an (optional) initial content + /// Add a new ContractedNode with an (optional) initial content ContractedNode *addNode(std::optional InitialContent); - ///\brief Returns a reference to the corresponding entry in the ReverseMap + /// Returns a reference to the corresponding entry in the ReverseMap ContractedNode *&getMapEntry(TypeFlowNode *TFGNode) { const auto &MapIt = ReverseMap.find(TFGNode); @@ -76,7 +76,7 @@ struct ContractedGraph { return MapIt->second; } - ///\brief Contract the edge at \a EdgeIndex + /// Contract the edge at \a EdgeIndex /// /// One of the two nodes of the edge is collapsed into the other, transferring /// all its content and incoming/outgoing edge to the node it is collapsed @@ -87,15 +87,15 @@ struct ContractedGraph { /// Note that \a EdgeIndex must be less that \a NActiveEdges, meaning that the /// collapsed edge must be active. void contract(size_t EdgeIndex); - ///\brief Reset each Node and the ReverseMap to the original state + /// Reset each Node and the ReverseMap to the original state void reset(); - ///\brief Check the consistency of the Graph + /// Check the consistency of the Graph ///\note Expensive Check void check(); }; -/// \brief Return a ContractedGraph built starting from an \a Entry Node +/// Return a ContractedGraph built starting from an \a Entry Node /// /// This function identifies a connected component of undecided nodes /// that all have Color as a candidate. The ContractedGraph shall contain a diff --git a/lib/ValueManipulationAnalysis/Mincut.cpp b/lib/ValueManipulationAnalysis/Mincut.cpp index 449ae9847..fc66c2903 100644 --- a/lib/ValueManipulationAnalysis/Mincut.cpp +++ b/lib/ValueManipulationAnalysis/Mincut.cpp @@ -157,7 +157,7 @@ void vma::karger(ContractedGraph &G, } } -///\brief Generate the solution in which all nodes of \a G are colored +/// Generate the solution in which all nodes of \a G are colored static void generateColorAllSolution(ContractedGraph &G) { for (auto &CN : G.Nodes) { if (CN.get() == G.NodesToColor or CN.get() == G.NodesToUncolor) @@ -172,7 +172,7 @@ static void generateColorAllSolution(ContractedGraph &G) { } } -///\brief Generate the solution in which all nodes of \a G are uncolored +/// Generate the solution in which all nodes of \a G are uncolored static void moveAllColoredToUncolored(ContractedGraph &G) { std::swap(G.NodesToUncolor->AdditionalNodes, G.NodesToColor->AdditionalNodes); for (TypeFlowNode *TFGNode : G.NodesToUncolor->AdditionalNodes) { @@ -182,7 +182,7 @@ static void moveAllColoredToUncolored(ContractedGraph &G) { } } -///\brief Generate the two simplest cuts (color all and uncolor all) +/// Generate the two simplest cuts (color all and uncolor all) static void generateNaiveSolutions(ContractedGraph &G, unsigned &BestCost, ContractedNode &BestNodesToColor, diff --git a/lib/ValueManipulationAnalysis/Mincut.h b/lib/ValueManipulationAnalysis/Mincut.h index 9431433bc..4470ebfe2 100644 --- a/lib/ValueManipulationAnalysis/Mincut.h +++ b/lib/ValueManipulationAnalysis/Mincut.h @@ -9,7 +9,7 @@ namespace vma { -/// \brief Contract the graph until you end with only two nodes +/// Contract the graph until you end with only two nodes /// /// This implementation guarantees that NodesToColor and NodesToUncolor are /// never merged, therefore they will be the only two nodes remaining at the @@ -23,7 +23,7 @@ void karger(ContractedGraph &G, ContractedNode &BestNodesToColor, ContractedNode &BestNodesToUncolor); -/// \brief Assign undecided nodes applying Karger one color at a time +/// Assign undecided nodes applying Karger one color at a time /// /// This function reasons one color at a time. It creates a ContractedGraph for /// each connected component of undecided nodes that have a given color among diff --git a/lib/ValueManipulationAnalysis/TypeFlowGraph.cpp b/lib/ValueManipulationAnalysis/TypeFlowGraph.cpp index 46cef864a..2e4403962 100644 --- a/lib/ValueManipulationAnalysis/TypeFlowGraph.cpp +++ b/lib/ValueManipulationAnalysis/TypeFlowGraph.cpp @@ -69,7 +69,7 @@ void TypeFlowGraph::view() { // --------------- TypeFlowGraph manipulation -///\brief Check if two nodes are already connected before adding the successor +/// Check if two nodes are already connected before adding the successor static bool addSuccessorIfAbsent(TypeFlowNode *N1, TypeFlowNode *N2, const EdgeLabel &E) { if (llvm::is_contained(N1->successors(), N2)) @@ -79,7 +79,7 @@ addSuccessorIfAbsent(TypeFlowNode *N1, TypeFlowNode *N2, const EdgeLabel &E) { return true; } -/// \brief Add edge (possibly both ways) between two nodes, based on the content +/// Add edge (possibly both ways) between two nodes, based on the content static bool connect(TypeFlowNode *N1, TypeFlowNode *N2) { // Value -> Value: no connection @@ -398,7 +398,7 @@ unsigned vma::countCasts(const TypeFlowGraph &TG) { return Cost; } -/// \brief If the majority of the neighbors agree on a color, return it +/// If the majority of the neighbors agree on a color, return it /// /// Under certain conditions, we can color a node only looking at its decided /// neighbors, i.e. those neighbors that are colored with exactly one color. @@ -413,7 +413,7 @@ static llvm::Optional majorityVote(const TypeFlowNode *Node) { // Don't try to assign a color to an already decided or uncolored node revng_assert(Node->isUndecided()); - ///\brief Holds a counter for a given color + /// Holds a counter for a given color struct ColorFrequency { ColorSet Color; unsigned Frequency; diff --git a/lib/ValueManipulationAnalysis/TypeFlowGraph.h b/lib/ValueManipulationAnalysis/TypeFlowGraph.h index 083cd04c4..f624e0ac4 100644 --- a/lib/ValueManipulationAnalysis/TypeFlowGraph.h +++ b/lib/ValueManipulationAnalysis/TypeFlowGraph.h @@ -21,7 +21,7 @@ namespace vma { // --------------- TypeFlowGraph -/// \brief Graph representing how type information flows between values and uses +/// Graph representing how type information flows between values and uses /// /// Nodes represent `llvm::Value`s and `llvm::Use`s and their candidate types, /// edges represent how type information is propagated. @@ -35,16 +35,16 @@ struct TypeFlowGraph : public GenericGraph { TypeFlowNode *addNodeContaining(const UseOrValue &); TypeFlowNode *getNodeContaining(const UseOrValue &) const; - /// \brief Print the graph on a `.dot` file + /// Print the graph on a `.dot` file /// \param Title title of the graph /// \param FileName if not specified, the default is `/tmp/` void dump(const llvm::Twine &Title = "", std::string FileName = "") debug_function; - /// \brief Dump a dot representation of the graph to the given stream + /// Dump a dot representation of the graph to the given stream void print(llvm::raw_ostream &OS) debug_function; - /// \brief Show the graph in a window, to be used inside a debugger + /// Show the graph in a window, to be used inside a debugger void view() debug_function; const llvm::Function *Func; @@ -53,27 +53,27 @@ struct TypeFlowGraph : public GenericGraph { // --------------- TypeFlowGraph manipulation -/// \brief Add to \a TG the `llvm::Use`s and `llvm::Value`s inside \a F +/// Add to \a TG the `llvm::Use`s and `llvm::Value`s inside \a F TypeFlowGraph makeTypeFlowGraphFromFunction(const llvm::Function *F); -/// \brief Propagate colors from colored nodes trough colored edges +/// Propagate colors from colored nodes trough colored edges void propagateColors(TypeFlowGraph &TG); -/// \brief Propagate a single color +/// Propagate a single color template void propagateColor(TypeFlowGraph &TG); -/// \brief Propagate Numberness and Pointerness with special rules +/// Propagate Numberness and Pointerness with special rules /// \return true if the TypeFlowGraph was modified bool propagateNumberness(TypeFlowGraph &TG); -///\brief Make the graph undirected by adding all reciprocal edges +/// Make the graph undirected by adding all reciprocal edges void makeBidirectional(TypeFlowGraph &TG); -/// \brief Count the number of edges connecting nodes with disjoint candidates +/// Count the number of edges connecting nodes with disjoint candidates unsigned countCasts(const TypeFlowGraph &TG); -/// \brief Recursively assign grey nodes based on the color of their neighbors +/// Recursively assign grey nodes based on the color of their neighbors /// /// See also TypeFlowNode::majorityVote() /// \return True if at least one node was modified @@ -81,17 +81,17 @@ bool applyMajorityVoting(TypeFlowGraph &TG); // --------------- Filtered Graphs implementation -/// \brief Select only edge that contain a given color +/// Select only edge that contain a given color template inline bool hasColor(llvm::GraphTraits::EdgeRef &Edge) { return Edge.Colors.contains(FilterColor); } -/// \brief Filtered Graph with only edges of a given color +/// Filtered Graph with only edges of a given color template using EdgeFilteredTG = EdgeFilteredGraph>; -/// \brief Select only undecided nodes +/// Select only undecided nodes inline bool bothHaveManyCandidates(const llvm::GraphTraits::NodeRef &Src, const llvm::GraphTraits::NodeRef &Tgt) { @@ -99,7 +99,7 @@ bothHaveManyCandidates(const llvm::GraphTraits::NodeRef &Src, return Src->isUndecided() and Tgt->isUndecided(); } -/// \brief Filtered Graph with only undecided nodes +/// Filtered Graph with only undecided nodes using NodeFilteredTG = NodePairFilteredGraph; diff --git a/lib/ValueManipulationAnalysis/TypeFlowNode.h b/lib/ValueManipulationAnalysis/TypeFlowNode.h index 2c7af8580..3813860b0 100644 --- a/lib/ValueManipulationAnalysis/TypeFlowNode.h +++ b/lib/ValueManipulationAnalysis/TypeFlowNode.h @@ -20,7 +20,7 @@ namespace vma { // --------------- Node content -/// \brief The atomic element to which we want to attach type information +/// The atomic element to which we want to attach type information using UseOrValue = std::variant; inline bool isValue(const UseOrValue &Content) { @@ -41,12 +41,12 @@ inline const llvm::Use *getUse(const UseOrValue &Content) { return std::get(Content); }; -///\brief Check if the variant is holding an Instruction's output Value +/// Check if the variant is holding an Instruction's output Value inline bool isInst(const UseOrValue &Content) { return isValue(Content) && isa(getValue(Content)); } -///\brief Get the index of an operand inside its Instruction +/// Get the index of an operand inside its Instruction inline unsigned getOpNo(const UseOrValue &Content) { revng_assert(isUse(Content)); return getUse(Content)->getOperandNo(); @@ -54,7 +54,7 @@ inline unsigned getOpNo(const UseOrValue &Content) { // --------------- Node Color initialization -///\brief Represents the initial color of a node and the ones it can accept +/// Represents the initial color of a node and the ones it can accept struct NodeColorProperty { const ColorSet InitialColor = NO_COLOR; const ColorSet AcceptedColors = NO_COLOR; @@ -63,12 +63,12 @@ struct NodeColorProperty { InitialColor(Initial), AcceptedColors(Accepted) {} }; -/// \brief Return the type colors associated to a given Use or Value +/// Return the type colors associated to a given Use or Value NodeColorProperty nodeColors(const UseOrValue &NC); // --------------- TypeFlowGraph Node -/// \brief Label of a TypeFlowGraph edge +/// Label of a TypeFlowGraph edge /// /// Indicates which colors can be propagated from the source node to the target /// node of an edge on the TypeFlowGraph. @@ -80,14 +80,14 @@ struct EdgeLabel { EdgeLabel(unsigned U) : Colors(U) {} }; -/// \brief Node data containing colors for an `llvm::Use` or `llvm::Value` +/// Node data containing colors for an `llvm::Use` or `llvm::Value` class TypeFlowNodeData { public: - ///\brief LLVM Use or Value to which the type information is attached + /// LLVM Use or Value to which the type information is attached const UseOrValue Content; - ///\brief Candidate types for this node + /// Candidate types for this node ColorSet Candidates; - ///\brief Types which this node can be infected with + /// Types which this node can be infected with const ColorSet Accepted; public: @@ -108,21 +108,21 @@ public: const llvm::Use *getUse() const { return vma::getUse(Content); } const llvm::Value *getValue() const { return vma::getValue(Content); } - /// \brief Has no candidate color + /// Has no candidate color bool isUncolored() const { return Candidates.countValid() == 0; } - /// \brief Has exactly one candidate color + /// Has exactly one candidate color bool isDecided() const { return Candidates.countValid() == 1; } - /// \brief Has more than one candidate color + /// Has more than one candidate color bool isUndecided() const { return Candidates.countValid() > 1; } - /// \brief Print a textual representation of the node's content + /// Print a textual representation of the node's content void print(llvm::raw_ostream &Out) const debug_function; - /// \brief Print the content of the node to a string + /// Print the content of the node to a string std::string toString() const debug_function; }; -/// \brief Add GenericGraph's BidirectionalNode interface +/// Add GenericGraph's BidirectionalNode interface using TypeFlowNode = BidirectionalNode; } // namespace vma diff --git a/tests/Unit/CombingPass.cpp b/tests/Unit/CombingPass.cpp index c31b5738f..ad46a1a28 100644 --- a/tests/Unit/CombingPass.cpp +++ b/tests/Unit/CombingPass.cpp @@ -1,5 +1,5 @@ /// \file CombingPass.cpp -/// \brief Tests for CombingPass +/// Tests for CombingPass // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/tests/Unit/DLAStepManager.cpp b/tests/Unit/DLAStepManager.cpp index 7fb5f4e47..274eec81e 100644 --- a/tests/Unit/DLAStepManager.cpp +++ b/tests/Unit/DLAStepManager.cpp @@ -1,5 +1,5 @@ /// \file DLAStepManager.cpp -/// \brief Tests for dla::StepManager +/// Tests for dla::StepManager // // Copyright (c) rev.ng Srls. See LICENSE.md for details. diff --git a/tests/Unit/MarkForSerializationTest.cpp b/tests/Unit/MarkForSerializationTest.cpp index e4a94726b..8b581c238 100644 --- a/tests/Unit/MarkForSerializationTest.cpp +++ b/tests/Unit/MarkForSerializationTest.cpp @@ -1,5 +1,5 @@ /// \file MarkForSerializationTest.cpp -/// \brief Test for MarkForSerialization +/// Test for MarkForSerialization // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/tests/Unit/Reachability/ReachabilityPass.cpp b/tests/Unit/Reachability/ReachabilityPass.cpp index bfa14ed42..d47ac63df 100644 --- a/tests/Unit/Reachability/ReachabilityPass.cpp +++ b/tests/Unit/Reachability/ReachabilityPass.cpp @@ -1,5 +1,5 @@ /// \file ReachabilityPass.cpp -/// \brief FunctionPass that computes the reachability for the nodes of a given +/// FunctionPass that computes the reachability for the nodes of a given /// Function // diff --git a/tests/Unit/ReachabilityPass.cpp b/tests/Unit/ReachabilityPass.cpp index 0a3c99152..121b71501 100644 --- a/tests/Unit/ReachabilityPass.cpp +++ b/tests/Unit/ReachabilityPass.cpp @@ -1,5 +1,5 @@ /// \file ReachabilityPass.cpp -/// \brief Tests for ReachabilityPass +/// Tests for ReachabilityPass // // Copyright rev.ng Srls. See LICENSE.md for details. diff --git a/tests/Unit/ValueManipulationAnalysis.cpp b/tests/Unit/ValueManipulationAnalysis.cpp index 4ca22d298..5eaec0068 100644 --- a/tests/Unit/ValueManipulationAnalysis.cpp +++ b/tests/Unit/ValueManipulationAnalysis.cpp @@ -1,5 +1,5 @@ /// \file ValueManipulationAnalysis.cpp -/// \brief Test the ValueManipulationAnalysis analysis +/// Test the ValueManipulationAnalysis analysis // // Copyright rev.ng Srls. See LICENSE.md for details. @@ -50,7 +50,7 @@ struct ExpectedShape { Types(T), Colors(C), NCasts(NCasts), NUndecided(NUndecided) {} }; -///\brief Keep a count of how many nodes are colored with each color +/// Keep a count of how many nodes are colored with each color static ColorCounter countColors(const TypeFlowGraph &TG) { ColorCounter CC = { 0 }; @@ -61,7 +61,7 @@ static ColorCounter countColors(const TypeFlowGraph &TG) { return CC; } -///\brief Keep a count of how many nodes of each type there are in \a TG +/// Keep a count of how many nodes of each type there are in \a TG static TypeCounter countTypes(const TypeFlowGraph &TG) { TypeCounter TC = { 0 }; @@ -77,7 +77,7 @@ static TypeCounter countTypes(const TypeFlowGraph &TG) { return TC; } -/// \brief Check that the TG nodes have the expected types and colors +/// Check that the TG nodes have the expected types and colors static void checkShape(const TypeFlowGraph &TG, const ExpectedShape &Expected) { const TypeCounter &ExpectedTypes = Expected.Types; const ColorCounter &ExpectedColors = Expected.Colors; @@ -112,7 +112,7 @@ static void checkShape(const TypeFlowGraph &TG, const ExpectedShape &Expected) { revng_check(NUndecided == Expected.NUndecided); } -/// \brief Check that the information in the graph are consistent +/// Check that the information in the graph are consistent static void checkTGCorrectness(TypeFlowGraph &TG) { // Check consistency between the graph and the reverse map for (TypeFlowNode *N : TG.nodes()) { @@ -148,7 +148,7 @@ static void checkTGCorrectness(TypeFlowGraph &TG) { } } -///\brief Check that a TypeFlowGraph is initialized correctly from a function +/// Check that a TypeFlowGraph is initialized correctly from a function static void checkInit(const char *Body, const ExpectedShape ExpectedInit, const ExpectedShape ExpectedAfterProp,