summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/CodeGen/CallingConvLower.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/CodeGen/CallingConvLower.cpp')
-rw-r--r--contrib/llvm/lib/CodeGen/CallingConvLower.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/llvm/lib/CodeGen/CallingConvLower.cpp b/contrib/llvm/lib/CodeGen/CallingConvLower.cpp
index 7d67bcf..2e33f14 100644
--- a/contrib/llvm/lib/CodeGen/CallingConvLower.cpp
+++ b/contrib/llvm/lib/CodeGen/CallingConvLower.cpp
@@ -23,6 +23,8 @@
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
+#include <algorithm>
+
using namespace llvm;
CCState::CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &mf,
@@ -64,6 +66,22 @@ void CCState::MarkAllocated(unsigned Reg) {
UsedRegs[*AI/32] |= 1 << (*AI&31);
}
+bool CCState::IsShadowAllocatedReg(unsigned Reg) const {
+ if (!isAllocated(Reg))
+ return false;
+
+ for (auto const &ValAssign : Locs) {
+ if (ValAssign.isRegLoc()) {
+ for (MCRegAliasIterator AI(ValAssign.getLocReg(), &TRI, true);
+ AI.isValid(); ++AI) {
+ if (*AI == Reg)
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
/// Analyze an array of argument values,
/// incorporating info about the formals into this state.
void
OpenPOWER on IntegriCloud