llvm/clang/lib/AST/ComparisonCategories.cpp

//===- ComparisonCategories.cpp - Three Way Comparison Data -----*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//  This file defines the Comparison Category enum and data types, which
//  store the types and expressions needed to support operator<=>
//
//===----------------------------------------------------------------------===//

#include "clang/AST/ComparisonCategories.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/Type.h"
#include "llvm/ADT/SmallVector.h"
#include <optional>

usingnamespaceclang;

std::optional<ComparisonCategoryType>
clang::getComparisonCategoryForBuiltinCmp(QualType T) {}

bool ComparisonCategoryInfo::ValueInfo::hasValidIntValue() const {}

/// Attempt to determine the integer value used to represent the comparison
/// category result by evaluating the initializer for the specified VarDecl as
/// a constant expression and retrieving the value of the class's first
/// (and only) field.
///
/// Note: The STL types are expected to have the form:
///    struct X { T value; };
/// where T is an integral or enumeration type.
llvm::APSInt ComparisonCategoryInfo::ValueInfo::getIntValue() const {}

ComparisonCategoryInfo::ValueInfo *ComparisonCategoryInfo::lookupValueInfo(
    ComparisonCategoryResult ValueKind) const {}

static const NamespaceDecl *lookupStdNamespace(const ASTContext &Ctx,
                                               NamespaceDecl *&StdNS) {}

static const CXXRecordDecl *lookupCXXRecordDecl(const ASTContext &Ctx,
                                                const NamespaceDecl *StdNS,
                                                ComparisonCategoryType Kind) {}

const ComparisonCategoryInfo *
ComparisonCategories::lookupInfo(ComparisonCategoryType Kind) const {}

const ComparisonCategoryInfo *
ComparisonCategories::lookupInfoForType(QualType Ty) const {}

const ComparisonCategoryInfo &ComparisonCategories::getInfoForType(QualType Ty) const {}

QualType ComparisonCategoryInfo::getType() const {}

StringRef ComparisonCategories::getCategoryString(ComparisonCategoryType Kind) {}

StringRef ComparisonCategories::getResultString(ComparisonCategoryResult Kind) {}

std::vector<ComparisonCategoryResult>
ComparisonCategories::getPossibleResultsForType(ComparisonCategoryType Type) {}