<p dir="ltr"><br>
On Jul 2, 2013 11:57 PM, "Demikhovsky, Elena" <<a href="mailto:elena.demikhovsky@intel.com">elena.demikhovsky@intel.com</a>> wrote:<br>
><br>
> Hi David,<br>
><br>
> I'll set<br>
> svn:eol-style LF<br>
><br>
> it should resolve the problem of line endings.</p>
<p dir="ltr">Thanks. I know a few people have had trouble with this in the past. There might be a 'native' option or something too.</p>
<p dir="ltr">> As far as Clang compilation, I work on Windows. Can you suggest me something?</p>
<p dir="ltr">Ah. If you're developing on windows you might be out of luck for now. Just keep an eye on the buildbots when you commit (they don't break on warnings, but they do report them)</p>
<p dir="ltr">><br>
> Thank you for fixing the issues.</p>
<p dir="ltr">Sure thing</p>
<p dir="ltr">><br>
> -  Elena<br>
><br>
><br>
> -----Original Message-----<br>
> From: David Blaikie [mailto:<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>]<br>
> Sent: Tuesday, July 02, 2013 19:51<br>
> To: Demikhovsky, Elena<br>
> Cc: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> Subject: Re: [llvm] r185421 - Fixed alignment of code sections in the JIT mode. Added a test to the JITMemoryManager.<br>
><br>
> On Tue, Jul 2, 2013 at 5:24 AM, Elena Demikhovsky <<a href="mailto:elena.demikhovsky@intel.com">elena.demikhovsky@intel.com</a>> wrote:<br>
> > Author: delena<br>
> > Date: Tue Jul  2 07:24:22 2013<br>
> > New Revision: 185421<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=185421&view=rev">http://llvm.org/viewvc/llvm-project?rev=185421&view=rev</a><br>
> > Log:<br>
> > Fixed alignment of code sections in the JIT mode. Added a test to the JITMemoryManager.<br>
> ><br>
> > Modified:<br>
> >     llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp<br>
> >     llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp<br>
> ><br>
> > Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT</a><br>
> > /JITMemoryManager.cpp?rev=185421&r1=185420&r2=185421&view=diff<br>
> > ======================================================================<br>
> > ========<br>
> > --- llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp (original)<br>
> > +++ llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Tue Jul  2<br>
> > +++ 07:24:22 2013<br>
> > @@ -468,7 +468,11 @@ namespace {<br>
> >        // Grow the required block size to account for the block header<br>
> >        Size += sizeof(*CurBlock);<br>
> ><br>
> > -      // FIXME: Alignement handling.<br>
> > +      // Alignment handling.<br>
> > +      if (!Alignment)<br>
> > +        Alignment = 16;<br>
> > +      Size += Alignment - 1;<br>
> > +<br>
> >        FreeRangeHeader* candidateBlock = FreeMemoryList;<br>
> >        FreeRangeHeader* head = FreeMemoryList;<br>
> >        FreeRangeHeader* iter = head->Next; @@ -500,7 +504,8 @@<br>
> > namespace {<br>
> >        FreeMemoryList = candidateBlock->AllocateBlock();<br>
> >        // Release the memory at the end of this block that isn't needed.<br>
> >        FreeMemoryList = CurBlock->TrimAllocationToSize(FreeMemoryList, Size);<br>
> > -      return (uint8_t *)(CurBlock + 1);<br>
> > +      uintptr_t unalignedAddr = (uintptr_t)CurBlock + sizeof(*CurBlock);<br>
> > +      return (uint8_t*)RoundUpToAlignment((uint64_t)unalignedAddr,<br>
> > + Alignment);<br>
> >      }<br>
> ><br>
> >      /// allocateDataSection - Allocate memory for a data section.<br>
> ><br>
> > Modified:<br>
> > llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngi">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngi</a><br>
> > ne/JIT/JITMemoryManagerTest.cpp?rev=185421&r1=185420&r2=185421&view=di<br>
> > ff<br>
> > ======================================================================<br>
> > ========<br>
> > --- llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp<br>
> > (original)<br>
> > +++ llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp<br>
> > +++ Tue Jul  2 07:24:22 2013<br>
> > @@ -277,4 +277,27 @@ TEST(JITMemoryManagerTest, TestManyStubs<br>
> >    EXPECT_EQ(3U, MemMgr->GetNumStubSlabs());  }<br>
> ><br>
> > +// Check section allocation and alignment TEST(JITMemoryManagerTest,<br>
> > +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>
> > +<br>
> > +  EXPECT_NE((uint8_t*)0, code1);<br>
> > +  EXPECT_NE((uint8_t*)0, code2);<br>
> > +  EXPECT_NE((uint8_t*)0, data1);<br>
> > +  EXPECT_NE((uint8_t*)0, data2);<br>
> > +<br>
> > +  // Check alignment<br>
> > +  EXPECT_EQ((uint64_t)code1 & 0xf, 0);<br>
> > +  EXPECT_EQ((uint64_t)code2 & 0x1f, 0);<br>
> > +  EXPECT_EQ((uint64_t)code3 & 0x3f, 0);<br>
> > +  EXPECT_EQ((uint64_t)data1 & 0xf, 0);<br>
> > +  EXPECT_EQ((uint64_t)data2 & 0x3f, 0);<br>
><br>
> These EXPECTs caused -Werror build breaks with Clang due to -Wsign-compare. I've fixed them (& removed several windows-style line breaks introduced by this commit) in r185443. It's helpful to build with Clang and -Werror before committing as other people do in an effort to keep the build warning-clean. Also please check your svn configuration to ensure it doesn't commit windows-style line endings in the future.<br>

><br>
> - David<br>
><br>
> > +}<br>
> > +<br>
> >  }<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > llvm-commits mailing list<br>
> > <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
> ---------------------------------------------------------------------<br>
> Intel Israel (74) Limited<br>
><br>
> This e-mail and any attachments may contain confidential material for<br>
> the sole use of the intended recipient(s). Any review or distribution<br>
> by others is strictly prohibited. If you are not the intended<br>
> recipient, please contact the sender and delete all copies.<br>
><br>
</p>