[PATCH] D68398: [Alignment][NFC] Value::getPointerAlignment returns MaybeAlign
Clement Courbet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 15 06:42:12 PDT 2019
courbet accepted this revision.
courbet added inline comments.
This revision is now accepted and ready to land.
================
Comment at: llvm/lib/Analysis/Loads.cpp:35
+ if (!Ty->isSized())
+ return llvm::None;
+ return Align(DL.getABITypeAlignment(Ty));
----------------
just `None`.
================
Comment at: llvm/lib/IR/Value.cpp:687
}
- const unsigned Align = GO->getAlignment();
- if (!Align) {
+ const MaybeAlign Alignment = MaybeAlign(GO->getAlignment());
+ if (!Alignment) {
----------------
remove one `MaybeAlign`
================
Comment at: llvm/lib/IR/Value.cpp:713
} else if (const AllocaInst *AI = dyn_cast<AllocaInst>(this)) {
- const unsigned Align = AI->getAlignment();
- if (!Align) {
+ const MaybeAlign Alignment = MaybeAlign(AI->getAlignment());
+ if (!Alignment) {
----------------
ditto
================
Comment at: llvm/lib/IR/Value.cpp:721
} else if (const auto *Call = dyn_cast<CallBase>(this)) {
- const unsigned Align = Call->getRetAlignment();
- if (!Align && Call->getCalledFunction())
- return Call->getCalledFunction()->getAttributes().getRetAlignment();
- return Align;
+ const MaybeAlign Alignment = MaybeAlign(Call->getRetAlignment());
+ if (!Alignment && Call->getCalledFunction())
----------------
ditto
================
Comment at: llvm/lib/IR/Value.cpp:732
}
- return 0;
+ return llvm::None;
}
----------------
just `None`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68398/new/
https://reviews.llvm.org/D68398
More information about the llvm-commits
mailing list