Skip to content

Commit ec31f76

Browse files
authored
[NFC] Fix line endings for OptionStrCmp.h and .td test files (llvm#109806)
Fix line endings for these files to Unix style.
1 parent 9830156 commit ec31f76

File tree

3 files changed

+70
-70
lines changed

3 files changed

+70
-70
lines changed
+32-32
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
//===- OptionStrCmp.h - Option String Comparison ----------------*- C++ -*-===//
2-
//
3-
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4-
// See https://llvm.org/LICENSE.txt for license information.
5-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6-
//
7-
//===----------------------------------------------------------------------===//
8-
9-
#ifndef LLVM_SUPPORT_OPTIONSTRCMP_H
10-
#define LLVM_SUPPORT_OPTIONSTRCMP_H
11-
12-
#include "llvm/ADT/ArrayRef.h"
13-
#include "llvm/ADT/StringRef.h"
14-
15-
namespace llvm {
16-
17-
// Comparison function for Option strings (option names & prefixes).
18-
// The ordering is *almost* case-insensitive lexicographic, with an exception.
19-
// '\0' comes at the end of the alphabet instead of the beginning (thus options
20-
// precede any other options which prefix them). Additionally, if two options
21-
// are identical ignoring case, they are ordered according to case sensitive
22-
// ordering if `FallbackCaseSensitive` is true.
23-
int StrCmpOptionName(StringRef A, StringRef B,
24-
bool FallbackCaseSensitive = true);
25-
26-
// Comparison function for Option prefixes.
27-
int StrCmpOptionPrefixes(ArrayRef<StringRef> APrefixes,
28-
ArrayRef<StringRef> BPrefixes);
29-
30-
} // namespace llvm
31-
32-
#endif // LLVM_SUPPORT_OPTIONSTRCMP_H
1+
//===- OptionStrCmp.h - Option String Comparison ----------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_SUPPORT_OPTIONSTRCMP_H
10+
#define LLVM_SUPPORT_OPTIONSTRCMP_H
11+
12+
#include "llvm/ADT/ArrayRef.h"
13+
#include "llvm/ADT/StringRef.h"
14+
15+
namespace llvm {
16+
17+
// Comparison function for Option strings (option names & prefixes).
18+
// The ordering is *almost* case-insensitive lexicographic, with an exception.
19+
// '\0' comes at the end of the alphabet instead of the beginning (thus options
20+
// precede any other options which prefix them). Additionally, if two options
21+
// are identical ignoring case, they are ordered according to case sensitive
22+
// ordering if `FallbackCaseSensitive` is true.
23+
int StrCmpOptionName(StringRef A, StringRef B,
24+
bool FallbackCaseSensitive = true);
25+
26+
// Comparison function for Option prefixes.
27+
int StrCmpOptionPrefixes(ArrayRef<StringRef> APrefixes,
28+
ArrayRef<StringRef> BPrefixes);
29+
30+
} // namespace llvm
31+
32+
#endif // LLVM_SUPPORT_OPTIONSTRCMP_H
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: not llvm-tblgen %s 2>&1 | FileCheck %s -DFILE=%s
2-
3-
// CHECK: [[FILE]]:[[@LINE+2]]:33: error: expected list type argument in unary operator
4-
class Flatten<int A> {
5-
list<int> F = !listflatten(A);
6-
}
1+
// RUN: not llvm-tblgen %s 2>&1 | FileCheck %s -DFILE=%s
2+
3+
// CHECK: [[FILE]]:[[@LINE+2]]:33: error: expected list type argument in unary operator
4+
class Flatten<int A> {
5+
list<int> F = !listflatten(A);
6+
}

llvm/test/TableGen/listflatten.td

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
// RUN: llvm-tblgen %s | FileCheck %s
2-
3-
class Flatten<list<int> A, list<int> B> {
4-
list<int> Flat1 = !listflatten([A, B, [6], [7, 8]]);
5-
6-
list<list<int>> X = [A, B];
7-
list<int> Flat2 = !listflatten(!listconcat(X, [[7]]));
8-
9-
// Generate a nested list of integers.
10-
list<int> Y0 = [1, 2, 3, 4];
11-
list<list<int>> Y1 = !foreach(elem, Y0, [elem]);
12-
list<list<list<int>>> Y2 = !foreach(elem, Y1, [elem]);
13-
list<list<list<list<int>>>> Y3 = !foreach(elem, Y2, [elem]);
14-
15-
// Flatten it completely.
16-
list<int> Flat3=!listflatten(!listflatten(!listflatten(Y3)));
17-
18-
// Flatten it partially.
19-
list<list<list<int>>> Flat4 = !listflatten(Y3);
20-
list<list<int>> Flat5 = !listflatten(!listflatten(Y3));
21-
22-
// Test NOP flattening.
23-
list<string> Flat6 = !listflatten(["a", "b"]);
24-
}
25-
26-
// CHECK: list<int> Flat1 = [1, 2, 3, 4, 5, 6, 7, 8];
27-
// CHECK: list<int> Flat2 = [1, 2, 3, 4, 5, 7];
28-
// CHECK: list<int> Flat3 = [1, 2, 3, 4];
29-
// CHECK{LITERAL}: list<list<list<int>>> Flat4 = [[[1]], [[2]], [[3]], [[4]]];
30-
// CHECK: list<string> Flat6 = ["a", "b"];
31-
def F : Flatten<[1,2], [3,4,5]>;
32-
1+
// RUN: llvm-tblgen %s | FileCheck %s
2+
3+
class Flatten<list<int> A, list<int> B> {
4+
list<int> Flat1 = !listflatten([A, B, [6], [7, 8]]);
5+
6+
list<list<int>> X = [A, B];
7+
list<int> Flat2 = !listflatten(!listconcat(X, [[7]]));
8+
9+
// Generate a nested list of integers.
10+
list<int> Y0 = [1, 2, 3, 4];
11+
list<list<int>> Y1 = !foreach(elem, Y0, [elem]);
12+
list<list<list<int>>> Y2 = !foreach(elem, Y1, [elem]);
13+
list<list<list<list<int>>>> Y3 = !foreach(elem, Y2, [elem]);
14+
15+
// Flatten it completely.
16+
list<int> Flat3=!listflatten(!listflatten(!listflatten(Y3)));
17+
18+
// Flatten it partially.
19+
list<list<list<int>>> Flat4 = !listflatten(Y3);
20+
list<list<int>> Flat5 = !listflatten(!listflatten(Y3));
21+
22+
// Test NOP flattening.
23+
list<string> Flat6 = !listflatten(["a", "b"]);
24+
}
25+
26+
// CHECK: list<int> Flat1 = [1, 2, 3, 4, 5, 6, 7, 8];
27+
// CHECK: list<int> Flat2 = [1, 2, 3, 4, 5, 7];
28+
// CHECK: list<int> Flat3 = [1, 2, 3, 4];
29+
// CHECK{LITERAL}: list<list<list<int>>> Flat4 = [[[1]], [[2]], [[3]], [[4]]];
30+
// CHECK: list<string> Flat6 = ["a", "b"];
31+
def F : Flatten<[1,2], [3,4,5]>;
32+

0 commit comments

Comments
 (0)