From: Chris Lattner Date: Wed, 3 May 2006 01:03:20 +0000 (+0000) Subject: Align function bodies correctly. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0eb4d6b52e1b5db9a4c86e5a954356ae3507a287;p=oota-llvm.git Align function bodies correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28073 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index 6e4ace9bf4d..bdc5f791e09 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -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); }