Skip to content

[CodeGen] Change the type from int64_t to uint64_t for getObjectSize and setObjectSize #149251

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/MachineFrameInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,14 +471,14 @@ class MachineFrameInfo {
}

/// Return the size of the specified object.
int64_t getObjectSize(int ObjectIdx) const {
uint64_t getObjectSize(int ObjectIdx) const {
assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
"Invalid Object Idx!");
return Objects[ObjectIdx+NumFixedObjects].Size;
}

/// Change the size of the specified stack object.
void setObjectSize(int ObjectIdx, int64_t Size) {
void setObjectSize(int ObjectIdx, uint64_t Size) {
assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
"Invalid Object Idx!");
Objects[ObjectIdx+NumFixedObjects].Size = Size;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bool MachineSanitizerBinaryMetadata::run(MachineFunction &MF) {
if (!Features->getUniqueInteger()[kSanitizerBinaryMetadataUARBit])
return false;
// Calculate size of stack args for the function.
int64_t Size = 0;
uint64_t Size = 0;
uint64_t Align = 0;
const MachineFrameInfo &MFI = MF.getFrameInfo();
for (int i = -1; i >= (int)-MFI.getNumFixedObjects(); --i) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ spillIncomingStatepointValue(SDValue Incoming, SDValue Chain,
MachineFrameInfo &MFI = Builder.DAG.getMachineFunction().getFrameInfo();
assert((MFI.getObjectSize(Index) * 8) ==
(-8 & (7 + // Round up modulo 8.
(int64_t)Incoming.getValueSizeInBits())) &&
Incoming.getValueSizeInBits())) &&
"Bad spill: stack slot does not match!");

// Note: Using the alignment of the spill slot (rather than the abi or
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ bool SystemZInstrInfo::isStackSlotCopy(const MachineInstr &MI,
return false;

// Check that Length covers the full slots.
int64_t Length = MI.getOperand(2).getImm();
uint64_t Length = MI.getOperand(2).getImm();
unsigned FI1 = MI.getOperand(0).getIndex();
unsigned FI2 = MI.getOperand(3).getIndex();
if (MFI.getObjectSize(FI1) != Length ||
Expand Down
Loading