[CodeGen] Provide an appropriate alignment for dynamic allocas
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 27 Oct 2016 17:18:24 +0000 (17:18 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 27 Oct 2016 17:18:24 +0000 (17:18 +0000)
commit1878da43ea929093e9b843f375fe106b9323d4f5
tree0d90ef67d8b7422ea98f07391b2db290057fee89
parent07c915e1d59f981b6fc2e7f7529ca6d4f57018cb
[CodeGen] Provide an appropriate alignment for dynamic allocas

GCC documents __builtin_alloca as aligning the storage to at least
__BIGGEST_ALIGNMENT__.

MSVC documents essentially the same for the x64 ABI:
https://msdn.microsoft.com/en-us/library/x9sx5da1.aspx

The 32-bit ABI follows the same rule: it emits a call to _alloca_probe_16

Differential Revision: https://reviews.llvm.org/D24378

llvm-svn: 285316
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/builtins-ms.c