Skip to content

Commit

Permalink
Replace None with std::nullopt in comments (NFC)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kazutakahirata committed May 13, 2023
1 parent db39d47 commit 81e149a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned> Taken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<DWARFAddressRange> Range;
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class RuntimeDyldChecker {
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<uint64_t> getSectionLoadAddress(void *LocalAddress) const;

private:
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Transforms/IPO/Attributor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Value *> Content;

/// Set of potential ranges accessed from the base pointer.
Expand Down
2 changes: 1 addition & 1 deletion polly/include/polly/Support/ScopHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<llvm::Metadata *> findMetadataOperand(llvm::MDNode *LoopMD,
llvm::StringRef Name);

Expand Down

0 comments on commit 81e149a

Please sign in to comment.