summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2019-07-17 20:46:09 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2019-07-17 20:46:09 +0000
commit90ba54bf67c4c134d000b064121789a32c0c6a73 (patch)
tree6d9c555b0b0466f3904730918613ba7e3f8037f6 /llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
parent85d667fcb6f34175f9a9af87f58fe05b177e7d82 (diff)
downloadbcm5719-llvm-90ba54bf67c4c134d000b064121789a32c0c6a73.tar.gz
bcm5719-llvm-90ba54bf67c4c134d000b064121789a32c0c6a73.zip
[CodeGen][NFC] Simplify checks for stack protector index checking
Use `hasStackProtectorIndex()` instead of `getStackProtectorIndex() >= 0`. llvm-svn: 366369
Diffstat (limited to 'llvm/lib/CodeGen/LocalStackSlotAllocation.cpp')
-rw-r--r--llvm/lib/CodeGen/LocalStackSlotAllocation.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
index bddd0c7732c..aa8f824c6b9 100644
--- a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
+++ b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
@@ -199,19 +199,19 @@ void LocalStackSlotPass::calculateFrameObjectOffsets(MachineFunction &Fn) {
// Make sure that the stack protector comes before the local variables on the
// stack.
SmallSet<int, 16> ProtectedObjs;
- if (MFI.getStackProtectorIndex() >= 0) {
+ if (MFI.hasStackProtectorIndex()) {
+ int StackProtectorFI = MFI.getStackProtectorIndex();
StackObjSet LargeArrayObjs;
StackObjSet SmallArrayObjs;
StackObjSet AddrOfObjs;
- AdjustStackOffset(MFI, MFI.getStackProtectorIndex(), Offset,
- StackGrowsDown, MaxAlign);
+ AdjustStackOffset(MFI, StackProtectorFI, Offset, StackGrowsDown, MaxAlign);
// Assign large stack objects first.
for (unsigned i = 0, e = MFI.getObjectIndexEnd(); i != e; ++i) {
if (MFI.isDeadObjectIndex(i))
continue;
- if (MFI.getStackProtectorIndex() == (int)i)
+ if (StackProtectorFI == (int)i)
continue;
switch (MFI.getObjectSSPLayout(i)) {
OpenPOWER on IntegriCloud