Skip to content

Commit f5eaadc

Browse files
authored
[NFC] Fix line endings for ModRef.cpp/OptionStrCmp.cpp (#109712)
1 parent 29168e8 commit f5eaadc

File tree

2 files changed

+95
-95
lines changed

2 files changed

+95
-95
lines changed

llvm/lib/Support/ModRef.cpp

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
//===--- ModRef.cpp - Memory effect modeling --------------------*- 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-
// This file implements ModRef and MemoryEffects misc functions.
10-
//
11-
//===----------------------------------------------------------------------===//
12-
13-
#include "llvm/Support/ModRef.h"
14-
#include "llvm/ADT/STLExtras.h"
15-
16-
using namespace llvm;
17-
18-
raw_ostream &llvm::operator<<(raw_ostream &OS, ModRefInfo MR) {
19-
switch (MR) {
20-
case ModRefInfo::NoModRef:
21-
OS << "NoModRef";
22-
break;
23-
case ModRefInfo::Ref:
24-
OS << "Ref";
25-
break;
26-
case ModRefInfo::Mod:
27-
OS << "Mod";
28-
break;
29-
case ModRefInfo::ModRef:
30-
OS << "ModRef";
31-
break;
32-
}
33-
return OS;
34-
}
35-
36-
raw_ostream &llvm::operator<<(raw_ostream &OS, MemoryEffects ME) {
37-
interleaveComma(MemoryEffects::locations(), OS, [&](IRMemLocation Loc) {
38-
switch (Loc) {
39-
case IRMemLocation::ArgMem:
40-
OS << "ArgMem: ";
41-
break;
42-
case IRMemLocation::InaccessibleMem:
43-
OS << "InaccessibleMem: ";
44-
break;
45-
case IRMemLocation::Other:
46-
OS << "Other: ";
47-
break;
48-
}
49-
OS << ME.getModRef(Loc);
50-
});
51-
return OS;
52-
}
1+
//===--- ModRef.cpp - Memory effect modeling --------------------*- 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+
// This file implements ModRef and MemoryEffects misc functions.
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#include "llvm/Support/ModRef.h"
14+
#include "llvm/ADT/STLExtras.h"
15+
16+
using namespace llvm;
17+
18+
raw_ostream &llvm::operator<<(raw_ostream &OS, ModRefInfo MR) {
19+
switch (MR) {
20+
case ModRefInfo::NoModRef:
21+
OS << "NoModRef";
22+
break;
23+
case ModRefInfo::Ref:
24+
OS << "Ref";
25+
break;
26+
case ModRefInfo::Mod:
27+
OS << "Mod";
28+
break;
29+
case ModRefInfo::ModRef:
30+
OS << "ModRef";
31+
break;
32+
}
33+
return OS;
34+
}
35+
36+
raw_ostream &llvm::operator<<(raw_ostream &OS, MemoryEffects ME) {
37+
interleaveComma(MemoryEffects::locations(), OS, [&](IRMemLocation Loc) {
38+
switch (Loc) {
39+
case IRMemLocation::ArgMem:
40+
OS << "ArgMem: ";
41+
break;
42+
case IRMemLocation::InaccessibleMem:
43+
OS << "InaccessibleMem: ";
44+
break;
45+
case IRMemLocation::Other:
46+
OS << "Other: ";
47+
break;
48+
}
49+
OS << ME.getModRef(Loc);
50+
});
51+
return OS;
52+
}

llvm/lib/Support/OptionStrCmp.cpp

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
//===- OptionStrCmp.cpp - 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-
#include "llvm/Support/OptionStrCmp.h"
10-
#include "llvm/ADT/STLExtras.h"
11-
12-
using namespace llvm;
13-
14-
// Comparison function for Option strings (option names & prefixes).
15-
// The ordering is *almost* case-insensitive lexicographic, with an exception.
16-
// '\0' comes at the end of the alphabet instead of the beginning (thus options
17-
// precede any other options which prefix them). Additionally, if two options
18-
// are identical ignoring case, they are ordered according to case sensitive
19-
// ordering if `FallbackCaseSensitive` is true.
20-
int llvm::StrCmpOptionName(StringRef A, StringRef B,
21-
bool FallbackCaseSensitive) {
22-
size_t MinSize = std::min(A.size(), B.size());
23-
if (int Res = A.substr(0, MinSize).compare_insensitive(B.substr(0, MinSize)))
24-
return Res;
25-
26-
// If they are identical ignoring case, use case sensitive ordering.
27-
if (A.size() == B.size())
28-
return FallbackCaseSensitive ? A.compare(B) : 0;
29-
30-
return (A.size() == MinSize) ? 1 /* A is a prefix of B. */
31-
: -1 /* B is a prefix of A */;
32-
}
33-
34-
// Comparison function for Option prefixes.
35-
int llvm::StrCmpOptionPrefixes(ArrayRef<StringRef> APrefixes,
36-
ArrayRef<StringRef> BPrefixes) {
37-
for (const auto &[APre, BPre] : zip(APrefixes, BPrefixes)) {
38-
if (int Cmp = StrCmpOptionName(APre, BPre))
39-
return Cmp;
40-
}
41-
// Both prefixes are identical.
42-
return 0;
43-
}
1+
//===- OptionStrCmp.cpp - 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+
#include "llvm/Support/OptionStrCmp.h"
10+
#include "llvm/ADT/STLExtras.h"
11+
12+
using namespace llvm;
13+
14+
// Comparison function for Option strings (option names & prefixes).
15+
// The ordering is *almost* case-insensitive lexicographic, with an exception.
16+
// '\0' comes at the end of the alphabet instead of the beginning (thus options
17+
// precede any other options which prefix them). Additionally, if two options
18+
// are identical ignoring case, they are ordered according to case sensitive
19+
// ordering if `FallbackCaseSensitive` is true.
20+
int llvm::StrCmpOptionName(StringRef A, StringRef B,
21+
bool FallbackCaseSensitive) {
22+
size_t MinSize = std::min(A.size(), B.size());
23+
if (int Res = A.substr(0, MinSize).compare_insensitive(B.substr(0, MinSize)))
24+
return Res;
25+
26+
// If they are identical ignoring case, use case sensitive ordering.
27+
if (A.size() == B.size())
28+
return FallbackCaseSensitive ? A.compare(B) : 0;
29+
30+
return (A.size() == MinSize) ? 1 /* A is a prefix of B. */
31+
: -1 /* B is a prefix of A */;
32+
}
33+
34+
// Comparison function for Option prefixes.
35+
int llvm::StrCmpOptionPrefixes(ArrayRef<StringRef> APrefixes,
36+
ArrayRef<StringRef> BPrefixes) {
37+
for (const auto &[APre, BPre] : zip(APrefixes, BPrefixes)) {
38+
if (int Cmp = StrCmpOptionName(APre, BPre))
39+
return Cmp;
40+
}
41+
// Both prefixes are identical.
42+
return 0;
43+
}

0 commit comments

Comments
 (0)