1 //===- Types.cpp - Helper for the selection of C++ data types. ------------===//
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 //===----------------------------------------------------------------------===//
11 // For LLVM_ATTRIBUTE_UNUSED
12 #include "llvm/Support/Compiler.h"
19 llvm::getMinimalTypeForRange(uint64_t Range
,
20 unsigned MaxSize LLVM_ATTRIBUTE_UNUSED
) {
21 // TODO: The original callers only used 32 and 64 so these are the only
22 // values permitted. Rather than widen the supported values we should
23 // allow 64 for the callers that currently use 32 and remove the
24 // argument altogether.
25 assert((MaxSize
== 32 || MaxSize
== 64) && "Unexpected size");
26 assert(MaxSize
<= 64 && "Unexpected size");
27 assert(((MaxSize
> 32) ? Range
<= 0xFFFFFFFFFFFFFFFFULL
28 : Range
<= 0xFFFFFFFFULL
) &&
31 if (Range
> 0xFFFFFFFFULL
)