[llvm] afbd2ce - [TableGen] Use StringRef::empty() instead of comparing to an empty string. NFC (#137673)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 28 16:47:55 PDT 2025


Author: Craig Topper
Date: 2025-04-28T16:47:52-07:00
New Revision: afbd2ce80f62d645eb1f7bee2ce6c14ac626c337

URL: https://github.com/llvm/llvm-project/commit/afbd2ce80f62d645eb1f7bee2ce6c14ac626c337
DIFF: https://github.com/llvm/llvm-project/commit/afbd2ce80f62d645eb1f7bee2ce6c14ac626c337.diff

LOG: [TableGen] Use StringRef::empty() instead of comparing to an empty string. NFC (#137673)

Added: 
    

Modified: 
    llvm/utils/TableGen/DecoderEmitter.cpp

Removed: 
    


################################################################################
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(


        


More information about the llvm-commits mailing list