summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp')
-rw-r--r--llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
index 385cd1bd5ca..59c9a0c990f 100644
--- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -132,6 +132,12 @@ DummySymbolMappings("dummy-extern",
cl::ZeroOrMore,
cl::Hidden);
+static cl::opt<bool>
+PrintAllocationRequests("print-alloc-requests",
+ cl::desc("Print allocation requests made to the memory "
+ "manager by RuntimeDyld"),
+ cl::Hidden);
+
/* *** */
// A trivial memory manager that doesn't do anything fancy, just uses the
@@ -211,6 +217,10 @@ uint8_t *TrivialMemoryManager::allocateCodeSection(uintptr_t Size,
unsigned Alignment,
unsigned SectionID,
StringRef SectionName) {
+ if (PrintAllocationRequests)
+ outs() << "allocateCodeSection(Size = " << Size << ", Alignment = "
+ << Alignment << ", SectionName = " << SectionName << ")\n";
+
if (UsePreallocation)
return allocateFromSlab(Size, Alignment, true /* isCode */);
@@ -227,6 +237,10 @@ uint8_t *TrivialMemoryManager::allocateDataSection(uintptr_t Size,
unsigned SectionID,
StringRef SectionName,
bool IsReadOnly) {
+ if (PrintAllocationRequests)
+ outs() << "allocateDataSection(Size = " << Size << ", Alignment = "
+ << Alignment << ", SectionName = " << SectionName << ")\n";
+
if (UsePreallocation)
return allocateFromSlab(Size, Alignment, false /* isCode */);
OpenPOWER on IntegriCloud