From 81e149aab9b3676b16728e883e2f21ee938cff93 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 12 May 2023 18:33:26 -0700 Subject: [PATCH] Replace None with std::nullopt in comments (NFC) This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 --- clang-tools-extra/pseudo/include/clang-pseudo/DirectiveTree.h | 2 +- llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h | 2 +- llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h | 2 +- llvm/include/llvm/Transforms/IPO/Attributor.h | 4 ++-- polly/include/polly/Support/ScopHelper.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clang-tools-extra/pseudo/include/clang-pseudo/DirectiveTree.h b/clang-tools-extra/pseudo/include/clang-pseudo/DirectiveTree.h index aeca616414c2..2b6cb6329791 100644 --- a/clang-tools-extra/pseudo/include/clang-pseudo/DirectiveTree.h +++ b/clang-tools-extra/pseudo/include/clang-pseudo/DirectiveTree.h @@ -80,7 +80,7 @@ struct DirectiveTree { /// The directive terminating the conditional, should be #endif. Directive End; /// The index of the conditional branch we chose as active. - /// None indicates no branch was taken (e.g. #if 0 ... #endif). + /// std::nullopt indicates no branch was taken (e.g. #if 0 ... #endif). /// The initial tree from `parse()` has no branches marked as taken. /// See `chooseConditionalBranches()`. std::optional Taken; diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h index b221f9cc9279..8b5497f4eeb9 100644 --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h @@ -19,7 +19,7 @@ class raw_ostream; /// Typically used in DW_AT_location attributes to describe the location of /// objects. struct DWARFLocationExpression { - /// The address range in which this expression is valid. None denotes a + /// The address range in which this expression is valid. std::nullopt denotes a /// default entry which is valid in addresses not covered by other location /// expressions, or everywhere if there are no other expressions. std::optional Range; diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h index f094c02e86f3..63cf5290b0c3 100644 --- a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h +++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h @@ -172,7 +172,7 @@ public: bool LocalAddress); /// If there is a section at the given local address, return its load - /// address, otherwise return none. + /// address, otherwise return std::nullopt. std::optional getSectionLoadAddress(void *LocalAddress) const; private: diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h index d4a2ed001700..482e0868e7e7 100644 --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -5554,8 +5554,8 @@ struct AAPointerInfo : public AbstractAttribute { /// The instruction responsible for the access. Instruction *RemoteI; - /// The value written, if any. `llvm::none` means "not known yet", `nullptr` - /// cannot be determined. + /// The value written, if any. `std::nullopt` means "not known yet", + /// `nullptr` cannot be determined. std::optional Content; /// Set of potential ranges accessed from the base pointer. diff --git a/polly/include/polly/Support/ScopHelper.h b/polly/include/polly/Support/ScopHelper.h index 5001d121fa77..17480c5381c5 100644 --- a/polly/include/polly/Support/ScopHelper.h +++ b/polly/include/polly/Support/ScopHelper.h @@ -522,7 +522,7 @@ bool hasDebugCall(ScopStmt *Stmt); /// !{ !"Name" } /// /// Then `nullptr` is set to mark the property is existing, but does not carry -/// any value. If the property does not exist, `None` is returned. +/// any value. If the property does not exist, `std::nullopt` is returned. std::optional findMetadataOperand(llvm::MDNode *LoopMD, llvm::StringRef Name);