[Stack Alignment] emit warning instead of a hard error

Per discussion in rdar://13127907, we should emit a hard error only if
people write code where the requested alignment is larger than achievable
and assumes the low bits are zeros. A warning should be good enough when
we are not sure if the source code assumes the low bits are zeros.

rdar://13127907


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174336 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manman Ren
2013-02-04 23:45:08 +00:00
parent f9271ea159
commit 91b978e157
2 changed files with 5 additions and 5 deletions

View File

@ -479,11 +479,11 @@ static inline unsigned clampStackAlignment(bool ShouldClamp, unsigned PrefAlign,
if (!ShouldClamp || PrefAlign <= StackAlign)
return PrefAlign;
if (Alloca && MinAlign > StackAlign)
Alloca->getParent()->getContext().emitError(Alloca,
"Requested Minimal Alignment exceeds the Stack Alignment!");
Alloca->getParent()->getContext().emitWarning(Alloca,
"Requested alignment exceeds the stack alignment!");
else
assert(MinAlign <= StackAlign &&
"Requested Minimal Alignment exceeds the Stack Alignment!");
"Requested alignment exceeds the stack alignment!");
return StackAlign;
}