/// A string containing JUST the breakpoint description.
/// \return
/// If \p input was not a valid breakpoint ID string, returns
- /// \b llvm::None. Otherwise returns a BreakpointID with members filled
+ /// \b std::nullopt. Otherwise returns a BreakpointID with members filled
/// out accordingly.
static llvm::Optional<BreakpointID>
ParseCanonicalReference(llvm::StringRef input);
/// number of bytes that can be placed into \a dst.
///
/// \param[in] timeout
- /// A timeout value or llvm::None for no timeout.
+ /// A timeout value or std::nullopt for no timeout.
///
/// \return
/// The number of bytes actually read.
/// Constructor.
///
/// Takes a \a file_spec with a \a line number and a \a column number. If
- /// \a column is null or not provided, it is set to llvm::None.
+ /// \a column is null or not provided, it is set to std::nullopt.
///
/// \param[in] file_spec
/// The full or partial path to a file.
/// number of bytes that can be placed into \a dst.
///
/// \param[in] timeout
- /// A timeout value or llvm::None for no timeout.
+ /// A timeout value or std::nullopt for no timeout.
///
/// \return
/// The number of bytes actually read.
/// The command arguments.
///
/// \return
- /// llvm::None if there is no special repeat command - it will use the
+ /// std::nullopt if there is no special repeat command - it will use the
/// current command line.
/// Otherwise a std::string containing the command to be repeated.
/// If the string is empty, the command won't be allow repeating.
llvm::ArrayRef<std::unique_ptr<CallEdge>> GetCallEdges();
/// Get the outgoing tail-calling edges from this function. If none exist,
- /// return None.
+ /// return std::nullopt.
llvm::ArrayRef<std::unique_ptr<CallEdge>> GetTailCallingEdges();
/// Get the outgoing call edge from this function which has the given return
///
/// If the range had no tags at all, the vector will be empty.
/// If some of the range was tagged it will have items and some
- /// of them may be llvm::None.
- /// (this saves the caller checking whether all items are llvm::None)
+ /// of them may be std::nullopt.
+ /// (this saves the caller checking whether all items are std::nullopt)
std::vector<llvm::Optional<lldb::addr_t>> GetTags(lldb::addr_t addr,
size_t len) const;
/// to a granule boundary.
///
/// \return
- /// The tag for the granule that address refers to, or llvm::None
+ /// The tag for the granule that address refers to, or std::nullopt
/// if it has no memory tag.
llvm::Optional<lldb::addr_t> GetTag(lldb::addr_t addr) const;
/// \param[in] only_if_exists
/// If \b true, besides matching \p path with the remapping rules, this
/// tries to check with the filesystem that the remapped file exists. If
- /// no valid file is found, \b None is returned. This might be expensive,
- /// specially on a network.
+ /// no valid file is found, \b std::nullopt is returned. This might be
+ /// expensive, specially on a network.
///
/// If \b false, then the existence of the returned remapping is not
/// checked.
/// The reversed mapped new path.
///
/// \return
- /// llvm::None if no remapping happens, otherwise, the matching source map
- /// entry's ""to_new_pathto"" part (which is the prefix of \a file) is
+ /// std::nullopt if no remapping happens, otherwise, the matching source
+ /// map entry's ""to_new_pathto"" part (which is the prefix of \a file) is
/// returned.
llvm::Optional<llvm::StringRef> ReverseRemapPath(const FileSpec &file,
FileSpec &fixed) const;
/// whenever an eTraceEventHWClockTick event is fired.
///
/// \return
- /// The requested HW clock value, or \a llvm::None if this information is
- /// not available for the current item.
+ /// The requested HW clock value, or \a std::nullopt if this information
+ /// is not available for the current item.
virtual llvm::Optional<uint64_t> GetHWClock() const = 0;
/// Get the approximate wall clock time in nanoseconds at which the current
/// what time 0 means.
///
/// \return
- /// The approximate wall clock time for the trace item, or \a llvm::None
+ /// The approximate wall clock time for the trace item, or \a std::nullopt
/// if not available.
virtual llvm::Optional<double> GetWallClockTime() const = 0;
/// The number of instructions to print.
///
/// \return
- /// The instruction id of the last traversed instruction, or \b llvm::None
- /// if no instructions were visited.
+ /// The instruction id of the last traversed instruction, or \b
+ /// std::nullopt if no instructions were visited.
llvm::Optional<lldb::user_id_t> DumpInstructions(size_t count);
/// Dump all function calls forwards chronologically and hierarchically
static bool Match(const FileSpec &pattern, const FileSpec &file);
/// Attempt to guess path style for a given path string. It returns a style,
- /// if it was able to make a reasonable guess, or None if it wasn't. The guess
- /// will be correct if the input path was a valid absolute path on the system
- /// which produced it. On other paths the result of this function is
- /// unreliable (e.g. "c:\foo.txt" is a valid relative posix path).
+ /// if it was able to make a reasonable guess, or std::nullopt if it wasn't.
+ /// The guess will be correct if the input path was a valid absolute path on
+ /// the system which produced it. On other paths the result of this function
+ /// is unreliable (e.g. "c:\foo.txt" is a valid relative posix path).
static llvm::Optional<Style> GuessPathStyle(llvm::StringRef absolute_path);
/// Case sensitivity of path.
static constexpr lldb::tid_t AllThreads = UINT64_MAX;
// Read thread-id from the packet. If the packet is valid, returns
- // the pair (PID, TID), otherwise returns llvm::None. If the packet
+ // the pair (PID, TID), otherwise returns std::nullopt. If the packet
// does not list a PID, default_pid is used.
llvm::Optional<std::pair<lldb::pid_t, lldb::tid_t>>
GetPidTid(lldb::pid_t default_pid);
// from Timeout<std::milli> to Timeout<std::micro>.
//
// The intended meaning of the values is:
-// - llvm::None - no timeout, the call should wait forever - 0 - poll, only
+// - std::nullopt - no timeout, the call should wait forever - 0 - poll, only
// complete the call if it will not block - >0 - wait for a given number of
// units for the result
template <typename Ratio>
/// Tracing technology name, e.g. intel-pt, arm-coresight.
std::string type;
- /// If \a llvm::None, then this starts tracing the whole process. Otherwise,
+ /// If \a std::nullopt, then this starts tracing the whole process. Otherwise,
/// only tracing for the specified threads is enabled.
llvm::Optional<std::vector<lldb::tid_t>> tids;
/// Tracing technology name, e.g. intel-pt, arm-coresight.
std::string type;
- /// If \a llvm::None, then this stops tracing the whole process. Otherwise,
+ /// If \a std::nullopt, then this stops tracing the whole process. Otherwise,
/// only tracing for the specified threads is stopped.
llvm::Optional<std::vector<lldb::tid_t>> tids;
};
bool IsRemovable() const override { return true; }
/// More documentation is available in lldb::CommandObject::GetRepeatCommand,
- /// but in short, if llvm::None is returned, the previous command will be
+ /// but in short, if std::nullopt is returned, the previous command will be
/// repeated, and if an empty string is returned, no commands will be
/// executed.
llvm::Optional<std::string> GetRepeatCommand(Args ¤t_command_args,
const llvm::StringRef path_separator = llvm::sys::path::get_separator(
m_location_spec.GetFileSpec().GetPathStyle());
// Check if "b" is a suffix of "a".
- // And return llvm::None if not or the new path
+ // And return std::nullopt if not or the new path
// of "a" after consuming "b" from the back.
auto check_suffix =
[path_separator](llvm::StringRef a, llvm::StringRef b,
/// Returns size in bytes of the type associated with this variable
///
/// \returns On success, returns byte size of the type associated
- /// with this variable. Returns NoneType otherwise.
+ /// with this variable. Returns std::nullopt otherwise.
virtual llvm::Optional<uint64_t>
GetByteSize(ExecutionContextScope *scope) const = 0;
/// Returns alignment of the type associated with this variable in bits.
///
/// \returns On success, returns alignment in bits for the type associated
- /// with this variable. Returns NoneType otherwise.
+ /// with this variable. Returns std::nullopt otherwise.
virtual llvm::Optional<size_t>
GetTypeBitAlign(ExecutionContextScope *scope) const = 0;
/// Returns decoded instruction as struct InstructionOpcodeAndModrm, holding
/// primary_opcode, opcode_len and modrm byte. Refer to the struct definition
/// for more details.
-/// Otherwise if the given instruction is invalid, returns None.
+/// Otherwise if the given instruction is invalid, returns std::nullopt.
llvm::Optional<InstructionOpcodeAndModrm>
InstructionLengthDecode(const uint8_t *inst_bytes, int bytes_len,
bool is_exec_mode_64b) {
/// non-deterministic order, so this function should have no side effects.
/// To make this easier to enforce, this function and all its parameters
/// should always be const-qualified.
- /// \return Returns llvm::None if no completion should be provided for the
+ /// \return Returns std::nullopt if no completion should be provided for the
/// given CodeCompletionResult.
llvm::Optional<CompletionWithPriority>
getCompletionForResult(const CodeCompletionResult &R) const {
namespace lldb_private {
-/// Returns all values wrapped in Optional, or None if any of the values is
-/// None.
+/// Returns all values wrapped in Optional, or std::nullopt if any of the values
+/// is None.
template <typename... Ts>
static llvm::Optional<std::tuple<Ts...>> zipOpt(llvm::Optional<Ts> &&...ts) {
if ((ts.has_value() && ...))
/// \return
/// some file descriptor in /sys/fs/ associated with the cgroup of the given
-/// pid, or \a llvm::None if the pid is not part of a cgroup.
+/// pid, or \a std::nullopt if the pid is not part of a cgroup.
static Optional<int> GetCGroupFileDescriptor(lldb::pid_t pid) {
static Optional<int> fd;
if (fd)
///
/// \param[in] cgroup_fd
/// A file descriptor in /sys/fs associated with the cgroup of the process to
- /// trace. If not \a llvm::None, then the trace sesion will use cgroup
+ /// trace. If not \a std::nullopt, then the trace sesion will use cgroup
/// filtering.
///
/// \return
///
/// \param[in] cgroup_fd
/// A file descriptor in /sys/fs associated with the cgroup of the process
- /// to trace. If not \a llvm::None, then the trace sesion will use cgroup
+ /// to trace. If not \a std::nullopt, then the trace sesion will use cgroup
/// filtering.
///
/// \return
/// from that gets updated as data gets decoded.
///
/// \return
- /// Returns a valid DIERef if decoding succeeded, llvm::None if there was
+ /// Returns a valid DIERef if decoding succeeded, std::nullopt if there was
/// unsufficient or invalid values that were decoded.
static llvm::Optional<DIERef> Decode(const lldb_private::DataExtractor &data,
lldb::offset_t *offset_ptr);
const size_t num_attributes = child.GetAttributes(attributes);
// Parse the location at index \p attr_index within this call site parameter
- // DIE, or return None on failure.
+ // DIE, or return std::nullopt on failure.
auto parse_simple_location =
[&](int attr_index) -> llvm::Optional<DWARFExpressionList> {
DWARFFormValue form_value;
// If this exact symbol opens a scope, we can just directly access its
// parent.
id.offset = getScopeParentOffset(sym);
- // Global symbols have parent offset of 0. Return llvm::None to indicate
+ // Global symbols have parent offset of 0. Return std::nullopt to indicate
// this.
if (id.offset == 0)
return std::nullopt;
/// MB and MiB for 2^20 bytes; and B for bytes. A single integral number is
/// considered bytes.
/// \return
-/// The converted number of bytes or \a llvm::None if the expression is
+/// The converted number of bytes or \a std::nullopt if the expression is
/// invalid.
llvm::Optional<uint64_t>
ParseUserFriendlySizeExpression(llvm::StringRef size_expression);
/// The trace item index to compare with.
///
/// \return
- /// The requested TSC range, or \a llvm::None if not available.
+ /// The requested TSC range, or \a std::nullopt if not available.
llvm::Optional<DecodedThread::TSCRange>
GetTSCRangeByIndex(uint64_t item_index) const;
/// The trace item index to compare with.
///
/// \return
- /// The requested nanoseconds range, or \a llvm::None if not available.
+ /// The requested nanoseconds range, or \a std::nullopt if not available.
llvm::Optional<DecodedThread::NanosecondsRange>
GetNanosecondsRangeByIndex(uint64_t item_index);
/// Find the lowest TSC in the given trace.
///
/// \return
-/// The lowest TSC value in this trace if available, \a llvm::None if the
+/// The lowest TSC value in this trace if available, \a std::nullopt if the
/// trace is empty or the trace contains no timing information, or an \a
/// llvm::Error if it was not possible to set up the decoder.
llvm::Expected<llvm::Optional<uint64_t>>
llvm::Expected<DecodedThreadSP> Decode();
/// \return
- /// The lowest TSC value in this trace if available, \a llvm::None if the
- /// trace is empty or the trace contains no timing information, or an \a
- /// llvm::Error if it was not possible to set up the decoder.
+ /// The lowest TSC value in this trace if available, \a std::nullopt if
+ /// the trace is empty or the trace contains no timing information, or an
+ /// \a llvm::Error if it was not possible to set up the decoder.
llvm::Expected<llvm::Optional<uint64_t>> FindLowestTSC();
ThreadDecoder(const ThreadDecoder &other) = delete;
/// \return
/// The lowest timestamp in nanoseconds in all traces if available, \a
- /// llvm::None if all the traces were empty or no trace contained no
+ /// std::nullopt if all the traces were empty or no trace contained no
/// timing information, or an \a llvm::Error if it was not possible to set
/// up the decoder for some trace.
llvm::Expected<llvm::Optional<uint64_t>> FindBeginningOfTimeNanos();
size_t GetTotalPSBBlocksCount() const;
/// \return
- /// The lowest TSC value in this trace if available, \a llvm::None if the
- /// trace is empty or the trace contains no timing information, or an \a
- /// llvm::Error if it was not possible to set up the decoder.
+ /// The lowest TSC value in this trace if available, \a std::nullopt if
+ /// the trace is empty or the trace contains no timing information, or an
+ /// \a llvm::Error if it was not possible to set up the decoder.
llvm::Expected<llvm::Optional<uint64_t>> FindLowestTSC();
private:
got_valid_tags = true;
}
- // To save the caller checking if every item is llvm::None,
+ // To save the caller checking if every item is std::nullopt,
// we return an empty vector if we got no tags at all.
if (got_valid_tags)
return tags;