LLVM 18.0.0git
Memory.cpp
Go to the documentation of this file.
1//===- Memory.cpp - Memory Handling Support ---------------------*- 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//
9// This file defines some helpful functions for allocating memory and dealing
10// with memory mapped files
11//
12//===----------------------------------------------------------------------===//
13
14#include "llvm/Support/Memory.h"
15#include "llvm/Config/llvm-config.h"
16
17#ifndef NDEBUG
19#endif // ifndef NDEBUG
20
21// Include the platform-specific parts of this class.
22#ifdef LLVM_ON_UNIX
23#include "Unix/Memory.inc"
24#endif
25#ifdef _WIN32
26#include "Windows/Memory.inc"
27#endif
28
29#ifndef NDEBUG
30
31namespace llvm {
32namespace sys {
33
36 "Unrecognized flags");
37
38 return OS << (PF & Memory::MF_READ ? 'R' : '-')
39 << (PF & Memory::MF_WRITE ? 'W' : '-')
40 << (PF & Memory::MF_EXEC ? 'X' : '-');
41}
42
44 return OS << "[ " << MB.base() << " .. "
45 << (void *)((char *)MB.base() + MB.allocatedSize()) << " ] ("
46 << MB.allocatedSize() << " bytes)";
47}
48
49} // end namespace sys
50} // end namespace llvm
51
52#endif // ifndef NDEBUG
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This class encapsulates the notion of a memory block which has an address and a size.
Definition: Memory.h:31
void * base() const
Definition: Memory.h:36
size_t allocatedSize() const
The size as it was allocated.
Definition: Memory.h:39
raw_ostream & operator<<(raw_ostream &OS, const Memory::ProtectionFlags &PF)
Debugging output for Memory::ProtectionFlags.
Definition: Memory.cpp:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18