Use StringRef::{starts,ends}_with (NFC)
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.
I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.
This commit is contained in:
@@ -78,7 +78,7 @@ int dumpMLIR() {
|
||||
|
||||
// Handle '.toy' input to the compiler.
|
||||
if (inputType != InputType::MLIR &&
|
||||
!llvm::StringRef(inputFilename).endswith(".mlir")) {
|
||||
!llvm::StringRef(inputFilename).ends_with(".mlir")) {
|
||||
auto moduleAST = parseInputFile(inputFilename);
|
||||
if (!moduleAST)
|
||||
return 6;
|
||||
|
||||
@@ -82,7 +82,7 @@ int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context,
|
||||
mlir::OwningOpRef<mlir::ModuleOp> &module) {
|
||||
// Handle '.toy' input to the compiler.
|
||||
if (inputType != InputType::MLIR &&
|
||||
!llvm::StringRef(inputFilename).endswith(".mlir")) {
|
||||
!llvm::StringRef(inputFilename).ends_with(".mlir")) {
|
||||
auto moduleAST = parseInputFile(inputFilename);
|
||||
if (!moduleAST)
|
||||
return 6;
|
||||
|
||||
@@ -83,7 +83,7 @@ int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context,
|
||||
mlir::OwningOpRef<mlir::ModuleOp> &module) {
|
||||
// Handle '.toy' input to the compiler.
|
||||
if (inputType != InputType::MLIR &&
|
||||
!llvm::StringRef(inputFilename).endswith(".mlir")) {
|
||||
!llvm::StringRef(inputFilename).ends_with(".mlir")) {
|
||||
auto moduleAST = parseInputFile(inputFilename);
|
||||
if (!moduleAST)
|
||||
return 6;
|
||||
|
||||
@@ -88,7 +88,7 @@ int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context,
|
||||
mlir::OwningOpRef<mlir::ModuleOp> &module) {
|
||||
// Handle '.toy' input to the compiler.
|
||||
if (inputType != InputType::MLIR &&
|
||||
!llvm::StringRef(inputFilename).endswith(".mlir")) {
|
||||
!llvm::StringRef(inputFilename).ends_with(".mlir")) {
|
||||
auto moduleAST = parseInputFile(inputFilename);
|
||||
if (!moduleAST)
|
||||
return 6;
|
||||
|
||||
@@ -112,7 +112,7 @@ int loadMLIR(mlir::MLIRContext &context,
|
||||
mlir::OwningOpRef<mlir::ModuleOp> &module) {
|
||||
// Handle '.toy' input to the compiler.
|
||||
if (inputType != InputType::MLIR &&
|
||||
!llvm::StringRef(inputFilename).endswith(".mlir")) {
|
||||
!llvm::StringRef(inputFilename).ends_with(".mlir")) {
|
||||
auto moduleAST = parseInputFile(inputFilename);
|
||||
if (!moduleAST)
|
||||
return 6;
|
||||
|
||||
@@ -112,7 +112,7 @@ int loadMLIR(mlir::MLIRContext &context,
|
||||
mlir::OwningOpRef<mlir::ModuleOp> &module) {
|
||||
// Handle '.toy' input to the compiler.
|
||||
if (inputType != InputType::MLIR &&
|
||||
!llvm::StringRef(inputFilename).endswith(".mlir")) {
|
||||
!llvm::StringRef(inputFilename).ends_with(".mlir")) {
|
||||
auto moduleAST = parseInputFile(inputFilename);
|
||||
if (!moduleAST)
|
||||
return 6;
|
||||
|
||||
Reference in New Issue
Block a user