From 7c5a2a4fb155d528eb4975cc3a893d1a64e12b4c Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 27 Apr 2025 22:35:49 -0700 Subject: [PATCH] [TableGen] Simplify a string comparison (NFC) --- 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 0364b02c2483d..09ce9f3027410 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()) {