[llvm] [TableGen] Use StringRef::empty() instead of comparing to an empty string. NFC (PR #137673)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 28 10:30:39 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-tablegen
Author: Craig Topper (topperc)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/137673.diff
1 Files Affected:
- (modified) llvm/utils/TableGen/DecoderEmitter.cpp (+2-2)
``````````diff
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index f0f07dfce4abb..eb3b30018da8a 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -1182,7 +1182,7 @@ bool FilterChooser::emitBinaryParser(raw_ostream &OS, indent Indent,
}
bool OpHasCompleteDecoder;
- if (Decoder != "") {
+ if (!Decoder.empty()) {
OpHasCompleteDecoder = OpInfo.HasCompleteDecoder;
OS << Indent << "if (!Check(S, " << Decoder
<< "(MI, tmp, Address, Decoder))) { "
@@ -1946,7 +1946,7 @@ populateInstruction(const CodeGenTarget &Target, const Record &EncodingDef,
// If the instruction has specified a custom decoding hook, use that instead
// of trying to auto-generate the decoder.
StringRef InstDecoder = EncodingDef.getValueAsString("DecoderMethod");
- if (InstDecoder != "") {
+ if (!InstDecoder.empty()) {
bool HasCompleteInstDecoder =
EncodingDef.getValueAsBit("hasCompleteDecoder");
InsnOperands.push_back(
``````````
</details>
https://github.com/llvm/llvm-project/pull/137673
More information about the llvm-commits
mailing list