Lang Hames 962a2479b5 Re-apply e50aea58d59, "Major JITLinkMemoryManager refactor". with fixes.
Adds explicit narrowing casts to JITLinkMemoryManager.cpp.

Honors -slab-address option in llvm-jitlink.cpp, which was accidentally
dropped in the refactor.

This effectively reverts commit 6641d29b70993bce6dbd7e0e0f1040753d38842f.
2021-10-11 21:39:00 -07:00

34 lines
1.1 KiB
C++

//===------------- MemoryFlags.cpp - Memory allocation flags --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/ExecutionEngine/JITLink/MemoryFlags.h"
#define DEBUG_TYPE "jitlink"
namespace llvm {
namespace jitlink {
raw_ostream &operator<<(raw_ostream &OS, MemProt MP) {
return OS << (((MP & MemProt::Read) != MemProt::None) ? 'R' : '-')
<< (((MP & MemProt::Write) != MemProt::None) ? 'W' : '-')
<< (((MP & MemProt::Exec) != MemProt::None) ? 'X' : '-');
}
raw_ostream &operator<<(raw_ostream &OS, MemDeallocPolicy MDP) {
return OS << (MDP == MemDeallocPolicy::Standard ? "standard" : "finalize");
}
raw_ostream &operator<<(raw_ostream &OS, AllocGroup AG) {
return OS << '(' << AG.getMemProt() << ", " << AG.getMemDeallocPolicy()
<< ')';
}
} // end namespace jitlink
} // end namespace llvm