aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/CodeGen/CallingConvLower.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 21:25:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 21:25:48 +0000
commitd88c1a5a572cdb661c111098831fa526e933756f (patch)
tree97b32c3372106ac47ded3d1a99f9c023a8530073 /contrib/llvm/lib/CodeGen/CallingConvLower.cpp
parent715652a404ee99f10c09c0a5edbb5883961b8c25 (diff)
parentb915e9e0fc85ba6f398b3fab0db6a81a8913af94 (diff)
Notes
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 7d67bcfe5469..2e33f14c7ee3 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