aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-11-20 00:24:40 -0800
committerKazu Hirata <kazu@google.com>2022-11-20 00:24:40 -0800
commit1fa870b1bd6c0041d06c31c4d3c830713d0a2a3f (patch)
treea8563d5204142332f770dc9c8d5ead133ef04712 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent92bccf5d3d2122d57f12dc07d4781e90edefd7ef (diff)
downloadllvm-1fa870b1bd6c0041d06c31c4d3c830713d0a2a3f.zip
llvm-1fa870b1bd6c0041d06c31c4d3c830713d0a2a3f.tar.gz
llvm-1fa870b1bd6c0041d06c31c4d3c830713d0a2a3f.tar.bz2
Use None consistently (NFC)
This patch replaces NoneType() and NoneType::None with None in preparation for migration from llvm::Optional to std::optional. In the std::optional world, we are not guranteed to be able to default-construct std::nullopt_t or peek what's inside it, so neither NoneType() nor NoneType::None has a corresponding expression in the std::optional world. Once we consistently use None, we should even be able to replace the contents of llvm/include/llvm/ADT/None.h with something like: using NoneType = std::nullopt_t; inline constexpr std::nullopt_t None = std::nullopt; to ease the migration from llvm::Optional to std::optional. Differential Revision: https://reviews.llvm.org/D138376
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index 05969e4..2a16203 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -428,8 +428,7 @@ static bool removeRedundantDbgInstrsUsingForwardScan(BasicBlock *BB) {
VariableMap;
for (auto &I : *BB) {
if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(&I)) {
- DebugVariable Key(DVI->getVariable(),
- NoneType(),
+ DebugVariable Key(DVI->getVariable(), None,
DVI->getDebugLoc()->getInlinedAt());
auto VMI = VariableMap.find(Key);
auto *DAI = dyn_cast<DbgAssignIntrinsic>(DVI);
@@ -490,7 +489,7 @@ static bool remomveUndefDbgAssignsFromEntryBlock(BasicBlock *BB) {
DenseSet<DebugVariable> SeenDefForAggregate;
// Returns the DebugVariable for DVI with no fragment info.
auto GetAggregateVariable = [](DbgValueInst *DVI) {
- return DebugVariable(DVI->getVariable(), NoneType(),
+ return DebugVariable(DVI->getVariable(), None,
DVI->getDebugLoc()->getInlinedAt());
};