diff options
author | Eli Friedman <efriedma@quicinc.com> | 2020-05-14 14:48:10 -0700 |
---|---|---|
committer | Eli Friedman <efriedma@quicinc.com> | 2020-05-15 12:26:58 -0700 |
commit | 11aa3707e30fe2dae214e1299b951fe908def14c (patch) | |
tree | 879120ef8345106c82f0b14b2ddfc03e2aaeeb5f /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 18a855da431e74499695ce43a8db23a1755ba632 (diff) | |
download | llvm-11aa3707e30fe2dae214e1299b951fe908def14c.zip llvm-11aa3707e30fe2dae214e1299b951fe908def14c.tar.gz llvm-11aa3707e30fe2dae214e1299b951fe908def14c.tar.bz2 |
StoreInst should store Align, not MaybeAlign
This is D77454, except for stores. All the infrastructure work was done
for loads, so the remaining changes necessary are relatively small.
Differential Revision: https://reviews.llvm.org/D79968
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index c3c4996..64427b7 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -4922,7 +4922,9 @@ Error BitcodeReader::parseFunctionBody(Function *F) { MaybeAlign Align; if (Error Err = parseAlignmentValue(Record[OpNum], Align)) return Err; - I = new StoreInst(Val, Ptr, Record[OpNum + 1], Align); + if (!Align) + Align = TheModule->getDataLayout().getABITypeAlign(Val->getType()); + I = new StoreInst(Val, Ptr, Record[OpNum + 1], *Align); InstructionList.push_back(I); break; } @@ -4955,7 +4957,9 @@ Error BitcodeReader::parseFunctionBody(Function *F) { MaybeAlign Align; if (Error Err = parseAlignmentValue(Record[OpNum], Align)) return Err; - I = new StoreInst(Val, Ptr, Record[OpNum + 1], Align, Ordering, SSID); + if (!Align) + return error("Alignment missing from atomic store"); + I = new StoreInst(Val, Ptr, Record[OpNum + 1], *Align, Ordering, SSID); InstructionList.push_back(I); break; } |