[Mlir-commits] [mlir] 0159eb6 - [mlir] Use StringRef::consume_front (NFC) (#139459)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun May 11 10:46:38 PDT 2025


Author: Kazu Hirata
Date: 2025-05-11T10:46:35-07:00
New Revision: 0159eb6367b1f894c946904c70a08d783ace303b

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

LOG: [mlir] Use StringRef::consume_front (NFC) (#139459)

Added: 
    

Modified: 
    mlir/lib/Target/LLVMIR/ModuleTranslation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index ad4f65da9d7f5..1168b9f339904 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -296,8 +296,7 @@ translateDataLayout(DataLayoutSpecInterface attribute,
       return failure();
   }
   StringRef layoutSpec(llvmDataLayout);
-  if (layoutSpec.starts_with("-"))
-    layoutSpec = layoutSpec.drop_front();
+  layoutSpec.consume_front("-");
 
   return llvm::DataLayout(layoutSpec);
 }


        


More information about the Mlir-commits mailing list