Skip to content

[NFC] Fix line endings for OptionStrCmp.h and .td test files #109806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions llvm/include/llvm/Support/OptionStrCmp.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
//===- OptionStrCmp.h - Option String Comparison ----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_SUPPORT_OPTIONSTRCMP_H
#define LLVM_SUPPORT_OPTIONSTRCMP_H
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
namespace llvm {
// Comparison function for Option strings (option names & prefixes).
// The ordering is *almost* case-insensitive lexicographic, with an exception.
// '\0' comes at the end of the alphabet instead of the beginning (thus options
// precede any other options which prefix them). Additionally, if two options
// are identical ignoring case, they are ordered according to case sensitive
// ordering if `FallbackCaseSensitive` is true.
int StrCmpOptionName(StringRef A, StringRef B,
bool FallbackCaseSensitive = true);
// Comparison function for Option prefixes.
int StrCmpOptionPrefixes(ArrayRef<StringRef> APrefixes,
ArrayRef<StringRef> BPrefixes);
} // namespace llvm
#endif // LLVM_SUPPORT_OPTIONSTRCMP_H
//===- OptionStrCmp.h - Option String Comparison ----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SUPPORT_OPTIONSTRCMP_H
#define LLVM_SUPPORT_OPTIONSTRCMP_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"

namespace llvm {

// Comparison function for Option strings (option names & prefixes).
// The ordering is *almost* case-insensitive lexicographic, with an exception.
// '\0' comes at the end of the alphabet instead of the beginning (thus options
// precede any other options which prefix them). Additionally, if two options
// are identical ignoring case, they are ordered according to case sensitive
// ordering if `FallbackCaseSensitive` is true.
int StrCmpOptionName(StringRef A, StringRef B,
bool FallbackCaseSensitive = true);

// Comparison function for Option prefixes.
int StrCmpOptionPrefixes(ArrayRef<StringRef> APrefixes,
ArrayRef<StringRef> BPrefixes);

} // namespace llvm

#endif // LLVM_SUPPORT_OPTIONSTRCMP_H
12 changes: 6 additions & 6 deletions llvm/test/TableGen/listflatten-error.td
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: not llvm-tblgen %s 2>&1 | FileCheck %s -DFILE=%s
// CHECK: [[FILE]]:[[@LINE+2]]:33: error: expected list type argument in unary operator
class Flatten<int A> {
list<int> F = !listflatten(A);
}
// RUN: not llvm-tblgen %s 2>&1 | FileCheck %s -DFILE=%s

// CHECK: [[FILE]]:[[@LINE+2]]:33: error: expected list type argument in unary operator
class Flatten<int A> {
list<int> F = !listflatten(A);
}
64 changes: 32 additions & 32 deletions llvm/test/TableGen/listflatten.td
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
// RUN: llvm-tblgen %s | FileCheck %s
class Flatten<list<int> A, list<int> B> {
list<int> Flat1 = !listflatten([A, B, [6], [7, 8]]);
list<list<int>> X = [A, B];
list<int> Flat2 = !listflatten(!listconcat(X, [[7]]));
// Generate a nested list of integers.
list<int> Y0 = [1, 2, 3, 4];
list<list<int>> Y1 = !foreach(elem, Y0, [elem]);
list<list<list<int>>> Y2 = !foreach(elem, Y1, [elem]);
list<list<list<list<int>>>> Y3 = !foreach(elem, Y2, [elem]);
// Flatten it completely.
list<int> Flat3=!listflatten(!listflatten(!listflatten(Y3)));
// Flatten it partially.
list<list<list<int>>> Flat4 = !listflatten(Y3);
list<list<int>> Flat5 = !listflatten(!listflatten(Y3));
// Test NOP flattening.
list<string> Flat6 = !listflatten(["a", "b"]);
}
// CHECK: list<int> Flat1 = [1, 2, 3, 4, 5, 6, 7, 8];
// CHECK: list<int> Flat2 = [1, 2, 3, 4, 5, 7];
// CHECK: list<int> Flat3 = [1, 2, 3, 4];
// CHECK{LITERAL}: list<list<list<int>>> Flat4 = [[[1]], [[2]], [[3]], [[4]]];
// CHECK: list<string> Flat6 = ["a", "b"];
def F : Flatten<[1,2], [3,4,5]>;
// RUN: llvm-tblgen %s | FileCheck %s

class Flatten<list<int> A, list<int> B> {
list<int> Flat1 = !listflatten([A, B, [6], [7, 8]]);

list<list<int>> X = [A, B];
list<int> Flat2 = !listflatten(!listconcat(X, [[7]]));

// Generate a nested list of integers.
list<int> Y0 = [1, 2, 3, 4];
list<list<int>> Y1 = !foreach(elem, Y0, [elem]);
list<list<list<int>>> Y2 = !foreach(elem, Y1, [elem]);
list<list<list<list<int>>>> Y3 = !foreach(elem, Y2, [elem]);

// Flatten it completely.
list<int> Flat3=!listflatten(!listflatten(!listflatten(Y3)));

// Flatten it partially.
list<list<list<int>>> Flat4 = !listflatten(Y3);
list<list<int>> Flat5 = !listflatten(!listflatten(Y3));

// Test NOP flattening.
list<string> Flat6 = !listflatten(["a", "b"]);
}

// CHECK: list<int> Flat1 = [1, 2, 3, 4, 5, 6, 7, 8];
// CHECK: list<int> Flat2 = [1, 2, 3, 4, 5, 7];
// CHECK: list<int> Flat3 = [1, 2, 3, 4];
// CHECK{LITERAL}: list<list<list<int>>> Flat4 = [[[1]], [[2]], [[3]], [[4]]];
// CHECK: list<string> Flat6 = ["a", "b"];
def F : Flatten<[1,2], [3,4,5]>;

Loading