1 //===------------- MemoryFlags.cpp - Memory allocation flags --------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "llvm/ExecutionEngine/JITLink/MemoryFlags.h"
11 
12 #define DEBUG_TYPE "jitlink"
13 
14 namespace llvm {
15 namespace jitlink {
16 
operator <<(raw_ostream & OS,MemProt MP)17 raw_ostream &operator<<(raw_ostream &OS, MemProt MP) {
18   return OS << (((MP & MemProt::Read) != MemProt::None) ? 'R' : '-')
19             << (((MP & MemProt::Write) != MemProt::None) ? 'W' : '-')
20             << (((MP & MemProt::Exec) != MemProt::None) ? 'X' : '-');
21 }
22 
operator <<(raw_ostream & OS,MemDeallocPolicy MDP)23 raw_ostream &operator<<(raw_ostream &OS, MemDeallocPolicy MDP) {
24   return OS << (MDP == MemDeallocPolicy::Standard ? "standard" : "finalize");
25 }
26 
operator <<(raw_ostream & OS,AllocGroup AG)27 raw_ostream &operator<<(raw_ostream &OS, AllocGroup AG) {
28   return OS << '(' << AG.getMemProt() << ", " << AG.getMemDeallocPolicy()
29             << ')';
30 }
31 
32 } // end namespace jitlink
33 } // end namespace llvm
34