MemoryFlags.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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. #include "llvm/ExecutionEngine/JITLink/MemoryFlags.h"
  10. #define DEBUG_TYPE "jitlink"
  11. namespace llvm {
  12. namespace jitlink {
  13. raw_ostream &operator<<(raw_ostream &OS, MemProt MP) {
  14. return OS << (((MP & MemProt::Read) != MemProt::None) ? 'R' : '-')
  15. << (((MP & MemProt::Write) != MemProt::None) ? 'W' : '-')
  16. << (((MP & MemProt::Exec) != MemProt::None) ? 'X' : '-');
  17. }
  18. raw_ostream &operator<<(raw_ostream &OS, MemDeallocPolicy MDP) {
  19. return OS << (MDP == MemDeallocPolicy::Standard ? "standard" : "finalize");
  20. }
  21. raw_ostream &operator<<(raw_ostream &OS, AllocGroup AG) {
  22. return OS << '(' << AG.getMemProt() << ", " << AG.getMemDeallocPolicy()
  23. << ')';
  24. }
  25. } // end namespace jitlink
  26. } // end namespace llvm