From 044ff78adcf6e5c6848ea8a8bb9dec2f4a32066c Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 28 Apr 2025 09:34:27 -0700 Subject: [PATCH] [TableGen] Simplify a string comparison (NFC) (#137584) --- llvm/utils/TableGen/DXILEmitter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/utils/TableGen/DXILEmitter.cpp b/llvm/utils/TableGen/DXILEmitter.cpp index 0364b02c2483..09ce9f302741 100644 --- a/llvm/utils/TableGen/DXILEmitter.cpp +++ b/llvm/utils/TableGen/DXILEmitter.cpp @@ -172,10 +172,9 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) { // Get the operation class OpClass = R->getValueAsDef("OpClass")->getName(); - if (!OpClass.str().compare("UnknownOpClass")) { + if (OpClass.str() == "UnknownOpClass") PrintFatalError(R, Twine("Unspecified DXIL OpClass for DXIL operation - ") + OpName); - } auto IntrinsicSelectRecords = R->getValueAsListOfDefs("intrinsics"); if (IntrinsicSelectRecords.size()) {