Align function bodies correctly.
authorChris Lattner <sabre@nondot.org>
Wed, 3 May 2006 01:03:20 +0000 (01:03 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 3 May 2006 01:03:20 +0000 (01:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28073 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JITEmitter.cpp

index 6e4ace9bf4d38968dae814d49bf97c0cea5b02b9..bdc5f791e09dc5540f5262df2fbc1b2ed959dbd8 100644 (file)
@@ -107,9 +107,7 @@ unsigned char *JITMemoryManager::allocateStub(unsigned StubSize) {
 }
 
 unsigned char *JITMemoryManager::startFunctionBody() {
-  // Round up to an even multiple of 8 bytes, this should eventually be target
-  // specific.
-  return (unsigned char*)(((intptr_t)CurFunctionPtr + 7) & ~7);
+  return CurFunctionPtr;
 }
 
 void JITMemoryManager::endFunctionBody(unsigned char *FunctionEnd) {
@@ -447,7 +445,7 @@ void JITEmitter::startFunction(MachineFunction &F) {
   initJumpTableInfo(F.getJumpTableInfo());
 
   // About to start emitting the machine code for the function.
-  // FIXME: align it?
+  emitAlignment(std::max(F.getFunction()->getAlignment(), 8U));
   TheJIT->updateGlobalMapping(F.getFunction(), CurBufferPtr);
 }