Skip to content

Commit 3ccd90a

Browse files
toppercIanWood1
authored andcommitted
[TableGen] Use StringRef::empty() instead of comparing to an empty string. NFC (llvm#137673)
1 parent 989df7c commit 3ccd90a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/TableGen/DecoderEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ bool FilterChooser::emitBinaryParser(raw_ostream &OS, indent Indent,
11821182
}
11831183

11841184
bool OpHasCompleteDecoder;
1185-
if (Decoder != "") {
1185+
if (!Decoder.empty()) {
11861186
OpHasCompleteDecoder = OpInfo.HasCompleteDecoder;
11871187
OS << Indent << "if (!Check(S, " << Decoder
11881188
<< "(MI, tmp, Address, Decoder))) { "
@@ -1946,7 +1946,7 @@ populateInstruction(const CodeGenTarget &Target, const Record &EncodingDef,
19461946
// If the instruction has specified a custom decoding hook, use that instead
19471947
// of trying to auto-generate the decoder.
19481948
StringRef InstDecoder = EncodingDef.getValueAsString("DecoderMethod");
1949-
if (InstDecoder != "") {
1949+
if (!InstDecoder.empty()) {
19501950
bool HasCompleteInstDecoder =
19511951
EncodingDef.getValueAsBit("hasCompleteDecoder");
19521952
InsnOperands.push_back(

0 commit comments

Comments
 (0)