diff options
author | Owen Anderson <resistor@mac.com> | 2015-03-02 09:34:59 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2015-03-02 09:34:59 +0000 |
commit | ab1c7a77d27d5482f2159bc26297d875db13b936 (patch) | |
tree | f5e91b0f8347dee376b16aed282d3a16210ae279 /llvm/lib/IR/DataLayout.cpp | |
parent | 040f2f890e95d777e19cb11f090095c86c8d2034 (diff) | |
download | bcm5719-llvm-ab1c7a77d27d5482f2159bc26297d875db13b936.tar.gz bcm5719-llvm-ab1c7a77d27d5482f2159bc26297d875db13b936.zip |
Teach DataLayout that ABI alignments for non-aggregate types must be non-zero.
This manifested as assertions and/or crashes in later phases of optimization,
depending on the build configuration.
llvm-svn: 230939
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r-- | llvm/lib/IR/DataLayout.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index 4eb6d78d381..b6eaf6f2d99 100644 --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -312,6 +312,9 @@ void DataLayout::parseSpecifier(StringRef Desc) { "Missing alignment specification in datalayout string"); Split = split(Rest, ':'); unsigned ABIAlign = inBytes(getInt(Tok)); + if (AlignType != AGGREGATE_ALIGN && !ABIAlign) + report_fatal_error( + "ABI alignment specification must be >0 for non-aggregate types"); // Preferred alignment. unsigned PrefAlign = ABIAlign; |