[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / lib / ExecutionEngine / JITLink / MemoryFlags.cpp
blobb73a310b2910dd1afbc98848102e836a4d161cc1
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 //===----------------------------------------------------------------------===//
10 #include "llvm/ExecutionEngine/JITLink/MemoryFlags.h"
12 #define DEBUG_TYPE "jitlink"
14 namespace llvm {
15 namespace jitlink {
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' : '-');
23 raw_ostream &operator<<(raw_ostream &OS, MemDeallocPolicy MDP) {
24 return OS << (MDP == MemDeallocPolicy::Standard ? "standard" : "finalize");
27 raw_ostream &operator<<(raw_ostream &OS, AllocGroup AG) {
28 return OS << '(' << AG.getMemProt() << ", " << AG.getMemDeallocPolicy()
29 << ')';
32 } // end namespace jitlink
33 } // end namespace llvm