Skip to content

Commit 5146f84

Browse files
committed
LLVM_NODISCARD => [[nodiscard]]. NFC
1 parent 3219783 commit 5146f84

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

lldb/include/lldb/Interpreter/CommandInterpreter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ class CommandInterpreter : public Broadcaster,
588588
/// \return True if the exit code was successfully set; false if the
589589
/// interpreter doesn't allow custom exit codes.
590590
/// \see AllowExitCodeOnQuit
591-
LLVM_NODISCARD bool SetQuitExitCode(int exit_code);
591+
[[nodiscard]] bool SetQuitExitCode(int exit_code);
592592

593593
/// Returns the exit code that the user has specified when running the
594594
/// 'quit' command.

lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CppModuleConfiguration {
3030
public:
3131
/// Try setting the path. Returns true if the path was set and false if
3232
/// the path was already set.
33-
LLVM_NODISCARD bool TrySet(llvm::StringRef path);
33+
[[nodiscard]] bool TrySet(llvm::StringRef path);
3434
/// Return the path if there is one.
3535
llvm::StringRef Get() const {
3636
assert(m_valid && "Called Get() on an invalid SetOncePath?");

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ ValueObjectSP AppleObjCRuntime::GetExceptionObjectForThread(
503503
/// \param msg The message to add to the log.
504504
/// \return An invalid ThreadSP to be returned from
505505
/// GetBacktraceThreadFromException.
506-
LLVM_NODISCARD
506+
[[nodiscard]]
507507
static ThreadSP FailExceptionParsing(llvm::StringRef msg) {
508508
Log *log = GetLog(LLDBLog::Language);
509509
LLDB_LOG(log, "Failed getting backtrace from exception: {0}", msg);

mlir/include/mlir/Analysis/AliasAnalysis.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ inline raw_ostream &operator<<(raw_ostream &os, const AliasResult &result) {
8787
/// The possible results of whether a memory access modifies or references
8888
/// a memory location. The possible results are: no access at all, a
8989
/// modification, a reference, or both a modification and a reference.
90-
class LLVM_NODISCARD ModRefResult {
90+
class [[nodiscard]] ModRefResult {
9191
/// Note: This is a simplified version of the ModRefResult in
9292
/// `llvm/Analysis/AliasAnalysis.h`, and namely removes the `Must` concept. If
9393
/// this becomes useful/necessary we should add it here.
@@ -123,23 +123,23 @@ class LLVM_NODISCARD ModRefResult {
123123
static ModRefResult getModAndRef() { return Kind::ModRef; }
124124

125125
/// Returns if this result does not modify or reference memory.
126-
LLVM_NODISCARD bool isNoModRef() const { return kind == Kind::NoModRef; }
126+
[[nodiscard]] bool isNoModRef() const { return kind == Kind::NoModRef; }
127127

128128
/// Returns if this result modifies memory.
129-
LLVM_NODISCARD bool isMod() const {
129+
[[nodiscard]] bool isMod() const {
130130
return static_cast<int>(kind) & static_cast<int>(Kind::Mod);
131131
}
132132

133133
/// Returns if this result references memory.
134-
LLVM_NODISCARD bool isRef() const {
134+
[[nodiscard]] bool isRef() const {
135135
return static_cast<int>(kind) & static_cast<int>(Kind::Ref);
136136
}
137137

138138
/// Returns if this result modifies *or* references memory.
139-
LLVM_NODISCARD bool isModOrRef() const { return kind != Kind::NoModRef; }
139+
[[nodiscard]] bool isModOrRef() const { return kind != Kind::NoModRef; }
140140

141141
/// Returns if this result modifies *and* references memory.
142-
LLVM_NODISCARD bool isModAndRef() const { return kind == Kind::ModRef; }
142+
[[nodiscard]] bool isModAndRef() const { return kind == Kind::ModRef; }
143143

144144
/// Merge this ModRef result with `other` and return the result.
145145
ModRefResult merge(const ModRefResult &other) {

mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace mlir {
3131
/// Transform IR operations containing other operations are allowed to do either
3232
/// with the results of the nested transformations, but must propagate definite
3333
/// failures as their diagnostics have been already reported to the user.
34-
class LLVM_NODISCARD DiagnosedSilenceableFailure {
34+
class [[nodiscard]] DiagnosedSilenceableFailure {
3535
public:
3636
explicit DiagnosedSilenceableFailure(LogicalResult result) : result(result) {}
3737
DiagnosedSilenceableFailure(const DiagnosedSilenceableFailure &) = delete;

mlir/include/mlir/IR/OpImplementation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ class AsmParser {
726726
bool hasValue() const { return result.has_value(); }
727727

728728
/// Return the result of the switch.
729-
LLVM_NODISCARD operator ResultT() {
729+
[[nodiscard]] operator ResultT() {
730730
if (!result)
731731
return parser.emitError(loc, "unexpected keyword: ") << keyword;
732732
return std::move(*result);

mlir/include/mlir/Support/LogicalResult.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace mlir {
2323
/// this class, it generally shouldn't be used as the result of functions that
2424
/// very frequently have the result ignored. This class is intended to be used
2525
/// in conjunction with the utility functions below.
26-
struct LLVM_NODISCARD LogicalResult {
26+
struct [[nodiscard]] LogicalResult {
2727
public:
2828
/// If isSuccess is true a `success` result is generated, otherwise a
2929
/// 'failure' result is generated.
@@ -75,7 +75,7 @@ inline bool failed(LogicalResult result) { return result.failed(); }
7575
/// value of type `T`. This allows for integrating with LogicalResult, while
7676
/// also providing a value on the success path.
7777
template <typename T>
78-
class LLVM_NODISCARD FailureOr : public Optional<T> {
78+
class [[nodiscard]] FailureOr : public Optional<T> {
7979
public:
8080
/// Allow constructing from a LogicalResult. The result *must* be a failure.
8181
/// Success results should use a proper instance of type `T`.
@@ -110,7 +110,7 @@ class LLVM_NODISCARD FailureOr : public Optional<T> {
110110
/// swallowed up in boilerplate without this, so we provide this for narrow
111111
/// cases where it is important.
112112
///
113-
class LLVM_NODISCARD ParseResult : public LogicalResult {
113+
class [[nodiscard]] ParseResult : public LogicalResult {
114114
public:
115115
ParseResult(LogicalResult result = success()) : LogicalResult(result) {}
116116

0 commit comments

Comments
 (0)