Skip to content

Commit 7c1fa25

Browse files
committed
change type
1 parent ced9cf5 commit 7c1fa25

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

llvm/lib/IR/Intrinsics.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ bool Intrinsic::isTargetIntrinsic(Intrinsic::ID IID) {
622622
/// and all entries must start with "llvm.". If NameTable contains an exact
623623
/// match for Name or a prefix of Name followed by a dot, its index in
624624
/// NameTable is returned. Otherwise, -1 is returned.
625-
static int lookupLLVMIntrinsicByName(ArrayRef<int> NameOffsetTable,
625+
static int lookupLLVMIntrinsicByName(ArrayRef<unsigned> NameOffsetTable,
626626
StringRef Name, StringRef Target = "") {
627627
assert(Name.starts_with("llvm.") && "Unexpected intrinsic prefix");
628628
assert(Name.drop_front(5).starts_with(Target) && "Unexpected target");
@@ -638,9 +638,9 @@ static int lookupLLVMIntrinsicByName(ArrayRef<int> NameOffsetTable,
638638
if (!Target.empty())
639639
CmpEnd += 1 + Target.size(); // skip the .target component.
640640

641-
const int *Low = NameOffsetTable.begin();
642-
const int *High = NameOffsetTable.end();
643-
const int *LastLow = Low;
641+
const unsigned *Low = NameOffsetTable.begin();
642+
const unsigned *High = NameOffsetTable.end();
643+
const unsigned *LastLow = Low;
644644
while (CmpEnd < Name.size() && High - Low > 0) {
645645
size_t CmpStart = CmpEnd;
646646
CmpEnd = Name.find('.', CmpStart + 1);
@@ -684,7 +684,8 @@ static int lookupLLVMIntrinsicByName(ArrayRef<int> NameOffsetTable,
684684
///
685685
/// Returns the relevant slice of \c IntrinsicNameOffsetTable and the target
686686
/// name.
687-
static std::pair<ArrayRef<int>, StringRef> findTargetSubtable(StringRef Name) {
687+
static std::pair<ArrayRef<unsigned>, StringRef>
688+
findTargetSubtable(StringRef Name) {
688689
assert(Name.starts_with("llvm."));
689690

690691
ArrayRef<IntrinsicTargetInfo> Targets(TargetInfos);

llvm/utils/TableGen/IntrinsicEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ void IntrinsicEmitter::EmitIntrinsicToNameTable(
256256
/*Indent=*/"");
257257

258258
OS << R"(
259-
static constexpr int IntrinsicNameOffsetTable[] = {
259+
static constexpr unsigned IntrinsicNameOffsetTable[] = {
260260
)";
261261

262262
OS << formatv(" {}, // {}\n", Table.GetStringOffset(NotIntrinsic),

0 commit comments

Comments
 (0)