1 //===------ Primitives.h - Types for the constexpr VM -----------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Utilities and helper functions for all primitive types:
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_AST_INTERP_PRIMITIVES_H
17 #define LLVM_CLANG_AST_INTERP_PRIMITIVES_H
19 #include "clang/AST/ComparisonCategories.h"
24 /// Helper to compare two comparable types.
25 template <typename T
> ComparisonCategoryResult
Compare(const T
&X
, const T
&Y
) {
27 return ComparisonCategoryResult::Less
;
29 return ComparisonCategoryResult::Greater
;
30 return ComparisonCategoryResult::Equal
;