Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:43

0001 //===-- LVSort.h ------------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file defines the sort algorithms.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSORT_H
0014 #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSORT_H
0015 
0016 namespace llvm {
0017 namespace logicalview {
0018 
0019 class LVObject;
0020 
0021 // Object Sorting Mode.
0022 enum class LVSortMode {
0023   None = 0, // No given sort.
0024   Kind,     // Sort by kind.
0025   Line,     // Sort by line.
0026   Name,     // Sort by name.
0027   Offset    // Sort by offset.
0028 };
0029 
0030 // Type of function to be called when sorting an object.
0031 using LVSortValue = int;
0032 using LVSortFunction = LVSortValue (*)(const LVObject *LHS,
0033                                        const LVObject *RHS);
0034 
0035 // Get the comparator function, based on the command line options.
0036 LVSortFunction getSortFunction();
0037 
0038 // Comparator functions that can be used for sorting.
0039 LVSortValue compareKind(const LVObject *LHS, const LVObject *RHS);
0040 LVSortValue compareLine(const LVObject *LHS, const LVObject *RHS);
0041 LVSortValue compareName(const LVObject *LHS, const LVObject *RHS);
0042 LVSortValue compareOffset(const LVObject *LHS, const LVObject *RHS);
0043 LVSortValue compareRange(const LVObject *LHS, const LVObject *RHS);
0044 LVSortValue sortByKind(const LVObject *LHS, const LVObject *RHS);
0045 LVSortValue sortByLine(const LVObject *LHS, const LVObject *RHS);
0046 LVSortValue sortByName(const LVObject *LHS, const LVObject *RHS);
0047 
0048 } // end namespace logicalview
0049 } // end namespace llvm
0050 
0051 #endif // LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSORT_H