summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2018-04-05 22:47:25 +0000
committerManoj Gupta <manojgupta@google.com>2018-04-05 22:47:25 +0000
commit9d68b9eac58291ba781e26cb4f8a83c658e1e9b3 (patch)
treea50a08e70972b69e0ecff1dcc8fd657acfbea112 /llvm/lib/Target/Mips
parent5f969602f0a0b7b161a88f7f78ae50e090822c6c (diff)
downloadbcm5719-llvm-9d68b9eac58291ba781e26cb4f8a83c658e1e9b3.tar.gz
bcm5719-llvm-9d68b9eac58291ba781e26cb4f8a83c658e1e9b3.zip
Attempt to fix Mips breakages.
Summary: Replace ArrayRefs by actual std::array objects so that there are no dangling references. Reviewers: rsmith, gkistanova Subscribers: sdardis, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D45338 llvm-svn: 329359
Diffstat (limited to 'llvm/lib/Target/Mips')
-rw-r--r--llvm/lib/Target/Mips/MipsFastISel.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Target/Mips/MipsFastISel.cpp b/llvm/lib/Target/Mips/MipsFastISel.cpp
index 85bd565571c..ac1f9c5129b 100644
--- a/llvm/lib/Target/Mips/MipsFastISel.cpp
+++ b/llvm/lib/Target/Mips/MipsFastISel.cpp
@@ -67,6 +67,7 @@
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
+#include <array>
#include <cassert>
#include <cstdint>
@@ -1306,13 +1307,13 @@ bool MipsFastISel::fastLowerArguments() {
return false;
}
- const ArrayRef<MCPhysReg> GPR32ArgRegs = {Mips::A0, Mips::A1, Mips::A2,
- Mips::A3};
- const ArrayRef<MCPhysReg> FGR32ArgRegs = {Mips::F12, Mips::F14};
- const ArrayRef<MCPhysReg> AFGR64ArgRegs = {Mips::D6, Mips::D7};
- ArrayRef<MCPhysReg>::iterator NextGPR32 = GPR32ArgRegs.begin();
- ArrayRef<MCPhysReg>::iterator NextFGR32 = FGR32ArgRegs.begin();
- ArrayRef<MCPhysReg>::iterator NextAFGR64 = AFGR64ArgRegs.begin();
+ std::array<MCPhysReg, 4> GPR32ArgRegs = {Mips::A0, Mips::A1, Mips::A2,
+ Mips::A3};
+ std::array<MCPhysReg, 2> FGR32ArgRegs = {Mips::F12, Mips::F14};
+ std::array<MCPhysReg, 2> AFGR64ArgRegs = {Mips::D6, Mips::D7};
+ auto NextGPR32 = GPR32ArgRegs.begin();
+ auto NextFGR32 = FGR32ArgRegs.begin();
+ auto NextAFGR64 = AFGR64ArgRegs.begin();
struct AllocatedReg {
const TargetRegisterClass *RC;
OpenPOWER on IntegriCloud