Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
DynamicAPInt.cpp
Go to the documentation of this file.
1//===- DynamicAPInt.cpp - DynamicAPInt Implementation -----------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8#include "llvm/ADT/DynamicAPInt.h"
9#include "llvm/ADT/Hashing.h"
10#include "llvm/Support/Debug.h"
11#include "llvm/Support/raw_ostream.h"
12
13using namespacellvm;
14
15hash_codellvm::hash_value(constDynamicAPInt &X) {
16if (X.isSmall())
17returnllvm::hash_value(X.getSmall());
18return detail::hash_value(X.getLarge());
19}
20
21voidDynamicAPInt::static_assert_layout() {
22constexprsize_t ValLargeOffset =
23offsetof(DynamicAPInt,ValLarge.Val.BitWidth);
24constexprsize_t ValSmallOffset =offsetof(DynamicAPInt,ValSmall);
25constexprsize_t ValSmallSize =sizeof(ValSmall);
26static_assert(ValLargeOffset >= ValSmallOffset + ValSmallSize);
27}
28
29raw_ostream &DynamicAPInt::print(raw_ostream &OS) const{
30if (isSmall())
31returnOS <<ValSmall;
32returnOS <<ValLarge;
33}
34
35voidDynamicAPInt::dump() const{print(dbgs()); }
offsetof
#define offsetof(TYPE, MEMBER)
Definition:AMDHSAKernelDescriptor.h:30
Debug.h
DynamicAPInt.h
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
Hashing.h
OS
raw_pwrite_stream & OS
Definition:SampleProfWriter.cpp:51
llvm::DynamicAPInt
This class provides support for dynamic arbitrary-precision arithmetic.
Definition:DynamicAPInt.h:46
llvm::DynamicAPInt::print
raw_ostream & print(raw_ostream &OS) const
Definition:DynamicAPInt.cpp:29
llvm::DynamicAPInt::ValLarge
detail::SlowDynamicAPInt ValLarge
Definition:DynamicAPInt.h:49
llvm::DynamicAPInt::static_assert_layout
void static_assert_layout()
Definition:DynamicAPInt.cpp:21
llvm::DynamicAPInt::dump
LLVM_DUMP_METHOD void dump() const
Definition:DynamicAPInt.cpp:35
llvm::DynamicAPInt::ValSmall
int64_t ValSmall
Definition:DynamicAPInt.h:48
llvm::hash_code
An opaque object representing a hash code.
Definition:Hashing.h:75
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:raw_ostream.h:52
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::hash_value
hash_code hash_value(const FixedPointSemantics &Val)
Definition:APFixedPoint.h:136
llvm::dbgs
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition:Debug.cpp:163
raw_ostream.h

Generated on Fri Jul 18 2025 11:49:56 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp