<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Fix landed in r191806.<div><br></div><div>-Filip</div><div><br></div><div><br><div><div>On Oct 1, 2013, at 6:32 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Tue, Oct 1, 2013 at 6:30 PM, Filip Pizlo <<a href="mailto:fpizlo@apple.com">fpizlo@apple.com</a>> wrote:<br><blockquote type="cite">Yup, working on a fix.  The main delay is that I'm building lldb for the<br>first time, ever; the fix itself is trivial.<br><br></blockquote><br>Yep. :)<br><br><blockquote type="cite">Is it better in situations like this to roll out and then reland once a fix<br>is in place?  Or is hurrying with a fix, like I'm doing, an acceptable<br>approach?<br><br></blockquote><br>A hurry up fix is fine, if it's going to be more than 20-30 minutes<br>you'd probably want to revert to make sure that the bot doesn't start<br>failing magically in the mean time. Revert and reapply is cheap as far<br>as the version control system is concerned, but if it takes just as<br>long to do that as to fix what broke...<br><br>Thanks!<br><br>-eric<br><br><blockquote type="cite">-Filip<br><br><br>On Oct 1, 2013, at 6:27 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br><br>FWIW this appears to have broken lldb.<br><br><a href="http://lab.llvm.org:8011/builders/lldb-x86_64-debian-clang/builds/7750">http://lab.llvm.org:8011/builders/lldb-x86_64-debian-clang/builds/7750</a><br><br>-eric<br><br>On Tue, Oct 1, 2013 at 5:59 PM, Filip Pizlo <fpizlo@apple.com> wrote:<br><br>Author: fpizlo<br>Date: Tue Oct  1 19:59:25 2013<br>New Revision: 191804<br><br>URL: http://llvm.org/viewvc/llvm-project?rev=191804&view=rev<br>Log:<br>This threads SectionName through the allocateCodeSection/allocateDataSection<br>APIs, both in C++ and C land.<br>It's useful for the memory managers that are allocating a section to know<br>what the name of the section is.<br>At a minimum, this is useful for low-level debugging - it's customary for<br>JITs to be able to tell you what<br>memory they allocated, and as part of any such dump, they should be able to<br>tell you some meta-data about<br>what each allocation is for.  This allows clients that supply their own<br>memory managers to do this.<br>Additionally, we also envision the SectionName being useful for passing<br>meta-data from within LLVM to an LLVM<br>client.<br><br>This changes both the C and C++ APIs, and all of the clients of those APIs<br>within LLVM.  I'm assuming that<br>it's safe to change the C++ API because that API is allowed to change.  I'm<br>assuming that it's safe to change<br>the C API because we haven't shipped the API in a release yet (LLVM 3.3<br>doesn't include the MCJIT memory<br>management C API).<br><br><br>Modified:<br>  llvm/trunk/include/llvm-c/ExecutionEngine.h<br>  llvm/trunk/include/llvm/ExecutionEngine/RTDyldMemoryManager.h<br>  llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h<br>  llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp<br>  llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp<br>  llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h<br>  llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp<br>  llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp<br>  llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp<br>  llvm/trunk/tools/lli/RecordingMemoryManager.cpp<br>  llvm/trunk/tools/lli/RecordingMemoryManager.h<br>  llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp<br>  llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp<br>  llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp<br>  llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp<br>  llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp<br><br>Modified: llvm/trunk/include/llvm-c/ExecutionEngine.h<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/ExecutionEngine.h?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/include/llvm-c/ExecutionEngine.h (original)<br>+++ llvm/trunk/include/llvm-c/ExecutionEngine.h Tue Oct  1 19:59:25 2013<br>@@ -171,13 +171,14 @@ void *LLVMGetPointerToGlobal(LLVMExecuti<br><br>/*===-- Operations on memory managers<br>-------------------------------------===*/<br><br>-typedef uint8_t *(*LLVMMemoryManagerAllocateCodeSectionCallback)(void<br>*Opaque,<br>-                                                   uintptr_t Size, unsigned<br>Alignment,<br>-                                                   unsigned SectionID);<br>-typedef uint8_t *(*LLVMMemoryManagerAllocateDataSectionCallback)(void<br>*Opaque,<br>-                                                   uintptr_t Size, unsigned<br>Alignment,<br>-                                                   unsigned SectionID,<br>LLVMBool IsReadOnly);<br>-typedef LLVMBool (*LLVMMemoryManagerFinalizeMemoryCallback)(void *Opaque,<br>char **ErrMsg);<br>+typedef uint8_t *(*LLVMMemoryManagerAllocateCodeSectionCallback)(<br>+  void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+  const char *SectionName);<br>+typedef uint8_t *(*LLVMMemoryManagerAllocateDataSectionCallback)(<br>+  void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+  const char *SectionName, LLVMBool IsReadOnly);<br>+typedef LLVMBool (*LLVMMemoryManagerFinalizeMemoryCallback)(<br>+  void *Opaque, char **ErrMsg);<br>typedef void (*LLVMMemoryManagerDestroyCallback)(void *Opaque);<br><br>/**<br><br>Modified: llvm/trunk/include/llvm/ExecutionEngine/RTDyldMemoryManager.h<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/RTDyldMemoryManager.h?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/include/llvm/ExecutionEngine/RTDyldMemoryManager.h (original)<br>+++ llvm/trunk/include/llvm/ExecutionEngine/RTDyldMemoryManager.h Tue Oct  1<br>19:59:25 2013<br>@@ -38,14 +38,16 @@ public:<br> /// executable code. The SectionID is a unique identifier assigned by the<br>JIT<br> /// engine, and optionally recorded by the memory manager to access a<br>loaded<br> /// section.<br>-  virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID) = 0;<br>-<br>+  virtual uint8_t *allocateCodeSection(<br>+    uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+    StringRef SectionName) = 0;<br>+<br> /// Allocate a memory block of (at least) the given size suitable for<br>data.<br> /// The SectionID is a unique identifier assigned by the JIT engine, and<br> /// optionally recorded by the memory manager to access a loaded section.<br>-  virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID, bool IsReadOnly)<br>= 0;<br>+  virtual uint8_t *allocateDataSection(<br>+    uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+    StringRef SectionName, bool IsReadOnly) = 0;<br><br> /// Register the EH frames with the runtime so that c++ exceptions work.<br> virtual void registerEHFrames(StringRef SectionData);<br><br>Modified: llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h<br>(original)<br>+++ llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h Tue Oct<br>1 19:59:25 2013<br>@@ -49,7 +49,8 @@ public:<br> /// The value of \p Alignment must be a power of two.  If \p Alignment is<br>zero<br> /// a default alignment of 16 will be used.<br> virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID);<br>+                                       unsigned SectionID,<br>+                                       StringRef SectionName);<br><br> /// \brief Allocates a memory block of (at least) the given size suitable<br>for<br> /// executable code.<br>@@ -58,6 +59,7 @@ public:<br> /// a default alignment of 16 will be used.<br> virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,<br>                                      unsigned SectionID,<br>+                                       StringRef SectionName,<br>                                      bool isReadOnly);<br><br> /// \brief Update section-specific memory permissions and other<br>attributes.<br><br>Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp (original)<br>+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp Tue Oct  1<br>19:59:25 2013<br>@@ -351,12 +351,13 @@ public:<br>                            void *Opaque);<br> virtual ~SimpleBindingMemoryManager();<br><br>-  virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID);<br>-<br>-  virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID,<br>-                                       bool isReadOnly);<br>+  virtual uint8_t *allocateCodeSection(<br>+    uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+    StringRef SectionName);<br>+<br>+  virtual uint8_t *allocateDataSection(<br>+    uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+    StringRef SectionName, bool isReadOnly);<br><br> virtual bool finalizeMemory(std::string *ErrMsg);<br><br>@@ -384,13 +385,17 @@ SimpleBindingMemoryManager::~SimpleBindi<br>}<br><br>uint8_t *SimpleBindingMemoryManager::allocateCodeSection(<br>-  uintptr_t Size, unsigned Alignment, unsigned SectionID) {<br>-  return Functions.AllocateCodeSection(Opaque, Size, Alignment, SectionID);<br>+  uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+  StringRef SectionName) {<br>+  return Functions.AllocateCodeSection(Opaque, Size, Alignment, SectionID,<br>+                                       SectionName.str().c_str());<br>}<br><br>uint8_t *SimpleBindingMemoryManager::allocateDataSection(<br>-  uintptr_t Size, unsigned Alignment, unsigned SectionID, bool isReadOnly)<br>{<br>+  uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+  StringRef SectionName, bool isReadOnly) {<br> return Functions.AllocateDataSection(Opaque, Size, Alignment, SectionID,<br>+                                       SectionName.str().c_str(),<br>                                      isReadOnly);<br>}<br><br><br>Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp (original)<br>+++ llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Tue Oct  1<br>19:59:25 2013<br>@@ -464,7 +464,7 @@ namespace {<br><br>   /// allocateCodeSection - Allocate memory for a code section.<br>   uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,<br>-                                 unsigned SectionID) {<br>+                                 unsigned SectionID, StringRef SectionName)<br>{<br>     // Grow the required block size to account for the block header<br>     Size += sizeof(*CurBlock);<br><br>@@ -510,7 +510,8 @@ namespace {<br><br>   /// allocateDataSection - Allocate memory for a data section.<br>   uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,<br>-                                 unsigned SectionID, bool IsReadOnly) {<br>+                                 unsigned SectionID, StringRef SectionName,<br>+                                 bool IsReadOnly) {<br>     return (uint8_t*)DataAllocator.Allocate(Size, Alignment);<br>   }<br><br><br>Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h (original)<br>+++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h Tue Oct  1 19:59:25 2013<br>@@ -35,14 +35,15 @@ public:<br><br> // Functions deferred to client memory manager<br> virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID) {<br>-    return ClientMM->allocateCodeSection(Size, Alignment, SectionID);<br>+                                       unsigned SectionID, StringRef<br>SectionName) {<br>+    return ClientMM->allocateCodeSection(Size, Alignment, SectionID,<br>SectionName);<br> }<br><br> virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID, bool IsReadOnly)<br>{<br>+                                       unsigned SectionID, StringRef<br>SectionName,<br>+                                       bool IsReadOnly) {<br>   return ClientMM->allocateDataSection(Size, Alignment,<br>-                                         SectionID, IsReadOnly);<br>+                                         SectionID, SectionName,<br>IsReadOnly);<br> }<br><br> virtual void registerEHFrames(StringRef SectionData) {<br><br>Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp (original)<br>+++ llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp Tue Oct  1<br>19:59:25 2013<br>@@ -19,9 +19,10 @@<br>namespace llvm {<br><br>uint8_t *SectionMemoryManager::allocateDataSection(uintptr_t Size,<br>-                                                    unsigned Alignment,<br>-                                                    unsigned SectionID,<br>-                                                    bool IsReadOnly) {<br>+                                                   unsigned Alignment,<br>+                                                   unsigned SectionID,<br>+                                                   StringRef SectionName,<br>+                                                   bool IsReadOnly) {<br> if (IsReadOnly)<br>   return allocateSection(RODataMem, Size, Alignment);<br> return allocateSection(RWDataMem, Size, Alignment);<br>@@ -29,7 +30,8 @@ uint8_t *SectionMemoryManager::allocateD<br><br>uint8_t *SectionMemoryManager::allocateCodeSection(uintptr_t Size,<br>                                                  unsigned Alignment,<br>-                                                   unsigned SectionID) {<br>+                                                   unsigned SectionID,<br>+                                                   StringRef SectionName) {<br> return allocateSection(CodeMem, Size, Alignment);<br>}<br><br><br>Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp (original)<br>+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp Tue Oct  1<br>19:59:25 2013<br>@@ -182,8 +182,8 @@ void RuntimeDyldImpl::emitCommonSymbols(<br>                                       SymbolTableMap &SymbolTable) {<br> // Allocate memory for the section<br> unsigned SectionID = Sections.size();<br>-  uint8_t *Addr = MemMgr->allocateDataSection(TotalSize, sizeof(void*),<br>-                                              SectionID, false);<br>+  uint8_t *Addr = MemMgr->allocateDataSection(<br>+    TotalSize, sizeof(void*), SectionID, StringRef(), false);<br> if (!Addr)<br>   report_fatal_error("Unable to allocate memory for common symbols!");<br> uint64_t Offset = 0;<br>@@ -278,8 +278,9 @@ unsigned RuntimeDyldImpl::emitSection(Ob<br> if (IsRequired) {<br>   Allocate = DataSize + StubBufSize;<br>   Addr = IsCode<br>-      ? MemMgr->allocateCodeSection(Allocate, Alignment, SectionID)<br>-      : MemMgr->allocateDataSection(Allocate, Alignment, SectionID,<br>IsReadOnly);<br>+      ? MemMgr->allocateCodeSection(Allocate, Alignment, SectionID, Name)<br>+      : MemMgr->allocateDataSection(Allocate, Alignment, SectionID, Name,<br>+                                    IsReadOnly);<br>   if (!Addr)<br>     report_fatal_error("Unable to allocate section memory!");<br><br><br>Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)<br>+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Tue Oct  1<br>19:59:25 2013<br>@@ -1337,8 +1337,8 @@ void RuntimeDyldELF::finalizeLoad() {<br>   // Allocate memory for the section<br>   unsigned SectionID = Sections.size();<br>   size_t TotalSize = numGOTEntries * getGOTEntrySize();<br>-    uint8_t *Addr = MemMgr->allocateDataSection(TotalSize,<br>getGOTEntrySize(),<br>-                                                SectionID, false);<br>+    uint8_t *Addr = MemMgr->allocateDataSection(<br>+      TotalSize, getGOTEntrySize(), SectionID, ".got", false);<br>   if (!Addr)<br>     report_fatal_error("Unable to allocate memory for GOT!");<br>   Sections.push_back(SectionEntry(".got", Addr, TotalSize, 0));<br><br>Modified: llvm/trunk/tools/lli/RecordingMemoryManager.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/RecordingMemoryManager.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/tools/lli/RecordingMemoryManager.cpp (original)<br>+++ llvm/trunk/tools/lli/RecordingMemoryManager.cpp Tue Oct  1 19:59:25 2013<br>@@ -27,7 +27,8 @@ RecordingMemoryManager::~RecordingMemory<br>}<br><br>uint8_t *RecordingMemoryManager::<br>-allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID)<br>{<br>+allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+                    StringRef SectionName) {<br> // The recording memory manager is just a local copy of the remote target.<br> // The alignment requirement is just stored here for later use. Regular<br> // heap storage is sufficient here, but we're using mapped memory to work<br>@@ -39,7 +40,8 @@ allocateCodeSection(uintptr_t Size, unsi<br><br>uint8_t *RecordingMemoryManager::<br>allocateDataSection(uintptr_t Size, unsigned Alignment,<br>-                    unsigned SectionID, bool IsReadOnly) {<br>+                    unsigned SectionID, StringRef SectionName,<br>+                    bool IsReadOnly) {<br> // The recording memory manager is just a local copy of the remote target.<br> // The alignment requirement is just stored here for later use. Regular<br> // heap storage is sufficient here, but we're using mapped memory to work<br><br>Modified: llvm/trunk/tools/lli/RecordingMemoryManager.h<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/RecordingMemoryManager.h?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/tools/lli/RecordingMemoryManager.h (original)<br>+++ llvm/trunk/tools/lli/RecordingMemoryManager.h Tue Oct  1 19:59:25 2013<br>@@ -50,10 +50,11 @@ public:<br> const_code_iterator   code_end() const { return AllocatedCodeMem.end(); }<br><br> uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID);<br>+                               unsigned SectionID, StringRef SectionName);<br><br> uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID, bool<br>IsReadOnly);<br>+                               unsigned SectionID, StringRef SectionName,<br>+                               bool IsReadOnly);<br><br> void *getPointerToNamedFunction(const std::string &Name,<br>                                 bool AbortOnFailure = true);<br><br>Modified: llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp (original)<br>+++ llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp Tue Oct  1 19:59:25 2013<br>@@ -60,9 +60,10 @@ public:<br> SmallVector<sys::MemoryBlock, 16> DataMemory;<br><br> uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,<br>-                               unsigned SectionID);<br>+                               unsigned SectionID, StringRef SectionName);<br> uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,<br>-                               unsigned SectionID, bool IsReadOnly);<br>+                               unsigned SectionID, StringRef SectionName,<br>+                               bool IsReadOnly);<br><br> virtual void *getPointerToNamedFunction(const std::string &Name,<br>                                         bool AbortOnFailure = true) {<br>@@ -80,7 +81,8 @@ public:<br><br>uint8_t *TrivialMemoryManager::allocateCodeSection(uintptr_t Size,<br>                                                  unsigned Alignment,<br>-                                                   unsigned SectionID) {<br>+                                                   unsigned SectionID,<br>+                                                   StringRef SectionName) {<br> sys::MemoryBlock MB = sys::Memory::AllocateRWX(Size, 0, 0);<br> FunctionMemory.push_back(MB);<br> return (uint8_t*)MB.base();<br>@@ -89,6 +91,7 @@ uint8_t *TrivialMemoryManager::allocateC<br>uint8_t *TrivialMemoryManager::allocateDataSection(uintptr_t Size,<br>                                                  unsigned Alignment,<br>                                                  unsigned SectionID,<br>+                                                   StringRef SectionName,<br>                                                  bool IsReadOnly) {<br> sys::MemoryBlock MB = sys::Memory::AllocateRWX(Size, 0, 0);<br> DataMemory.push_back(MB);<br><br>Modified: llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp<br>(original)<br>+++ llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp Tue<br>Oct  1 19:59:25 2013<br>@@ -281,11 +281,11 @@ TEST(JITMemoryManagerTest, TestManyStubs<br>TEST(JITMemoryManagerTest, AllocateSection) {<br> OwningPtr<JITMemoryManager> MemMgr(<br>     JITMemoryManager::CreateDefaultMemManager());<br>-  uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1);<br>-  uint8_t *data1 = MemMgr->allocateDataSection(256, 16, 2, true);<br>-  uint8_t *code2 = MemMgr->allocateCodeSection(257, 32, 3);<br>-  uint8_t *data2 = MemMgr->allocateDataSection(256, 64, 4, false);<br>-  uint8_t *code3 = MemMgr->allocateCodeSection(258, 64, 5);<br>+  uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1, StringRef());<br>+  uint8_t *data1 = MemMgr->allocateDataSection(256, 16, 2, StringRef(),<br>true);<br>+  uint8_t *code2 = MemMgr->allocateCodeSection(257, 32, 3, StringRef());<br>+  uint8_t *data2 = MemMgr->allocateDataSection(256, 64, 4, StringRef(),<br>false);<br>+  uint8_t *code3 = MemMgr->allocateCodeSection(258, 64, 5, StringRef());<br><br> EXPECT_NE((uint8_t*)0, code1);<br> EXPECT_NE((uint8_t*)0, code2);<br><br>Modified: llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp (original)<br>+++ llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp Tue Oct  1 19:59:25<br>2013<br>@@ -135,13 +135,17 @@ public:<br>     EndFunctionBodyCall(F, FunctionStart, FunctionEnd));<br>   Base->endFunctionBody(F, FunctionStart, FunctionEnd);<br> }<br>-  virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID, bool IsReadOnly)<br>{<br>-    return Base->allocateDataSection(Size, Alignment, SectionID,<br>IsReadOnly);<br>+  virtual uint8_t *allocateDataSection(<br>+    uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+    StringRef SectionName, bool IsReadOnly) {<br>+    return Base->allocateDataSection(<br>+      Size, Alignment, SectionID, SectionName, IsReadOnly);<br> }<br>-  virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,<br>-                                       unsigned SectionID) {<br>-    return Base->allocateCodeSection(Size, Alignment, SectionID);<br>+  virtual uint8_t *allocateCodeSection(<br>+    uintptr_t Size, unsigned Alignment, unsigned SectionID,<br>+    StringRef SectionName) {<br>+    return Base->allocateCodeSection(<br>+      Size, Alignment, SectionID, SectionName);<br> }<br> virtual bool finalizeMemory(std::string *ErrMsg) { return false; }<br> virtual uint8_t *allocateSpace(intptr_t Size, unsigned Alignment) {<br><br>Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp (original)<br>+++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp Tue Oct  1<br>19:59:25 2013<br>@@ -28,18 +28,20 @@ static bool didCallAllocateCodeSection;<br><br>static uint8_t *roundTripAllocateCodeSection(void *object, uintptr_t size,<br>                                            unsigned alignment,<br>-                                             unsigned sectionID) {<br>+                                             unsigned sectionID,<br>+                                             const char *sectionName) {<br> didCallAllocateCodeSection = true;<br> return static_cast<SectionMemoryManager*>(object)->allocateCodeSection(<br>-    size, alignment, sectionID);<br>+    size, alignment, sectionID, sectionName);<br>}<br><br>static uint8_t *roundTripAllocateDataSection(void *object, uintptr_t size,<br>                                            unsigned alignment,<br>                                            unsigned sectionID,<br>+                                             const char *sectionName,<br>                                            LLVMBool isReadOnly) {<br> return static_cast<SectionMemoryManager*>(object)->allocateDataSection(<br>-    size, alignment, sectionID, isReadOnly);<br>+    size, alignment, sectionID, sectionName, isReadOnly);<br>}<br><br>static LLVMBool roundTripFinalizeMemory(void *object, char **errMsg) {<br><br>Modified:<br>llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp?rev=191804&r1=191803&r2=191804&view=diff<br>==============================================================================<br>--- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp<br>(original)<br>+++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp<br>Tue Oct  1 19:59:25 2013<br>@@ -19,10 +19,10 @@ namespace {<br>TEST(MCJITMemoryManagerTest, BasicAllocations) {<br> OwningPtr<SectionMemoryManager> MemMgr(new SectionMemoryManager());<br><br>-  uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1);<br>-  uint8_t *data1 = MemMgr->allocateDataSection(256, 0, 2, true);<br>-  uint8_t *code2 = MemMgr->allocateCodeSection(256, 0, 3);<br>-  uint8_t *data2 = MemMgr->allocateDataSection(256, 0, 4, false);<br>+  uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1, "");<br>+  uint8_t *data1 = MemMgr->allocateDataSection(256, 0, 2, "", true);<br>+  uint8_t *code2 = MemMgr->allocateCodeSection(256, 0, 3, "");<br>+  uint8_t *data2 = MemMgr->allocateDataSection(256, 0, 4, "", false);<br><br> EXPECT_NE((uint8_t*)0, code1);<br> EXPECT_NE((uint8_t*)0, code2);<br>@@ -52,10 +52,10 @@ TEST(MCJITMemoryManagerTest, BasicAlloca<br>TEST(MCJITMemoryManagerTest, LargeAllocations) {<br> OwningPtr<SectionMemoryManager> MemMgr(new SectionMemoryManager());<br><br>-  uint8_t *code1 = MemMgr->allocateCodeSection(0x100000, 0, 1);<br>-  uint8_t *data1 = MemMgr->allocateDataSection(0x100000, 0, 2, true);<br>-  uint8_t *code2 = MemMgr->allocateCodeSection(0x100000, 0, 3);<br>-  uint8_t *data2 = MemMgr->allocateDataSection(0x100000, 0, 4, false);<br>+  uint8_t *code1 = MemMgr->allocateCodeSection(0x100000, 0, 1, "");<br>+  uint8_t *data1 = MemMgr->allocateDataSection(0x100000, 0, 2, "", true);<br>+  uint8_t *code2 = MemMgr->allocateCodeSection(0x100000, 0, 3, "");<br>+  uint8_t *data2 = MemMgr->allocateDataSection(0x100000, 0, 4, "", false);<br><br> EXPECT_NE((uint8_t*)0, code1);<br> EXPECT_NE((uint8_t*)0, code2);<br>@@ -91,8 +91,8 @@ TEST(MCJITMemoryManagerTest, ManyAllocat<br> for (unsigned i = 0; i < 10000; ++i) {<br>   const bool isReadOnly = i % 2 == 0;<br><br>-    code[i] = MemMgr->allocateCodeSection(32, 0, 1);<br>-    data[i] = MemMgr->allocateDataSection(32, 0, 2, isReadOnly);<br>+    code[i] = MemMgr->allocateCodeSection(32, 0, 1, "");<br>+    data[i] = MemMgr->allocateDataSection(32, 0, 2, "", isReadOnly);<br><br>   for (unsigned j = 0; j < 32; j++) {<br>     code[i][j] = 1 + (i % 254);<br>@@ -130,8 +130,8 @@ TEST(MCJITMemoryManagerTest, ManyVariedA<br>   bool isReadOnly = i % 3 == 0;<br>   unsigned Align = 8 << (i % 4);<br><br>-    code[i] = MemMgr->allocateCodeSection(CodeSize, Align, i);<br>-    data[i] = MemMgr->allocateDataSection(DataSize, Align, i + 10000,<br>+    code[i] = MemMgr->allocateCodeSection(CodeSize, Align, i, "");<br>+    data[i] = MemMgr->allocateDataSection(DataSize, Align, i + 10000, "",<br>                                         isReadOnly);<br><br>   for (unsigned j = 0; j < CodeSize; j++) {<br><br><br>_______________________________________________<br>llvm-commits mailing list<br>llvm-commits@cs.uiuc.edu<br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</blockquote></div></blockquote></div><br></div></body></html>