From 04578fcfa5db449006766391f0f397069d14598b Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Wed, 11 Feb 2015 09:13:09 +0000 Subject: DataLayout: Report when the preferred alignment is less than the ABI llvm-svn: 228819 --- llvm/lib/IR/DataLayout.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/IR/DataLayout.cpp') diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index cde393777a6..0dcc8427dcd 100644 --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -312,6 +312,9 @@ void DataLayout::parseSpecifier(StringRef Desc) { PrefAlign = inBytes(getInt(Tok)); } + if (ABIAlign > PrefAlign) + report_fatal_error( + "Preferred alignment cannot be less than the ABI alignment"); setAlignment(AlignType, ABIAlign, PrefAlign, Size); break; -- cgit v1.2.3