diff options
author | Fangrui Song <i@maskray.me> | 2022-12-05 04:13:11 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-05 04:13:11 +0000 |
commit | 89fae41ef142892d8d6c20ead28465a34e12172b (patch) | |
tree | 95d80b9764e5d1d25bf8485a8426e6a409930b50 /llvm/lib/IR/BasicBlock.cpp | |
parent | 768cae4a5ab3a564b25ed36c379423f71b42d9d0 (diff) | |
download | llvm-89fae41ef142892d8d6c20ead28465a34e12172b.zip llvm-89fae41ef142892d8d6c20ead28465a34e12172b.tar.gz llvm-89fae41ef142892d8d6c20ead28465a34e12172b.tar.bz2 |
[IR] llvm::Optional => std::optional
Many llvm/IR/* files have been migrated by other contributors.
This migrates most remaining files.
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index 7a30005..f2ecd6e 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/lib/IR/BasicBlock.cpp @@ -519,14 +519,14 @@ const LandingPadInst *BasicBlock::getLandingPadInst() const { return dyn_cast<LandingPadInst>(getFirstNonPHI()); } -Optional<uint64_t> BasicBlock::getIrrLoopHeaderWeight() const { +std::optional<uint64_t> BasicBlock::getIrrLoopHeaderWeight() const { const Instruction *TI = getTerminator(); if (MDNode *MDIrrLoopHeader = TI->getMetadata(LLVMContext::MD_irr_loop)) { MDString *MDName = cast<MDString>(MDIrrLoopHeader->getOperand(0)); if (MDName->getString().equals("loop_header_weight")) { auto *CI = mdconst::extract<ConstantInt>(MDIrrLoopHeader->getOperand(1)); - return Optional<uint64_t>(CI->getValue().getZExtValue()); + return std::optional<uint64_t>(CI->getValue().getZExtValue()); } } return std::nullopt; |