diff options
author | Philip Reames <listmail@philipreames.com> | 2016-08-23 23:33:29 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2016-08-23 23:33:29 +0000 |
commit | e83c4b30ca8f189d5dbd4e0be53110c3a1f7129e (patch) | |
tree | 6b9b32f91eec706ff85d80c08393af8483f4c597 /llvm/lib/CodeGen/StackMaps.cpp | |
parent | bd63d436c148152aedf13818475e66892449662b (diff) | |
download | bcm5719-llvm-e83c4b30ca8f189d5dbd4e0be53110c3a1f7129e.tar.gz bcm5719-llvm-e83c4b30ca8f189d5dbd4e0be53110c3a1f7129e.zip |
[stackmaps] More extraction of common code [NFCI]
General cleanup before starting to work on the part I want to actually change.
llvm-svn: 279586
Diffstat (limited to 'llvm/lib/CodeGen/StackMaps.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StackMaps.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp index 9e6df468341..c7f45fff29e 100644 --- a/llvm/lib/CodeGen/StackMaps.cpp +++ b/llvm/lib/CodeGen/StackMaps.cpp @@ -35,7 +35,8 @@ static cl::opt<int> StackMapVersion( const char *StackMaps::WSMP = "Stack Maps: "; -StackMapOpers::StackMapOpers(const MachineInstr *MI) { +StackMapOpers::StackMapOpers(const MachineInstr *MI) + : MI(MI) { assert(getVarIdx() <= MI->getNumOperands() && "invalid stackmap definition"); } @@ -43,8 +44,7 @@ StackMapOpers::StackMapOpers(const MachineInstr *MI) { PatchPointOpers::PatchPointOpers(const MachineInstr *MI) : MI(MI), HasDef(MI->getOperand(0).isReg() && MI->getOperand(0).isDef() && !MI->getOperand(0).isImplicit()), - IsAnyReg(MI->getOperand(getMetaIdx(CCPos)).getImm() == - CallingConv::AnyReg) { + IsAnyReg(getCallingConv() == CallingConv::AnyReg) { #ifndef NDEBUG unsigned CheckStartIdx = 0, e = MI->getNumOperands(); while (CheckStartIdx < e && MI->getOperand(CheckStartIdx).isReg() && @@ -358,8 +358,7 @@ void StackMaps::recordPatchPoint(const MachineInstr &MI) { assert(MI.getOpcode() == TargetOpcode::PATCHPOINT && "expected patchpoint"); PatchPointOpers opers(&MI); - const int64_t ID = opers.getMetaOper(PatchPointOpers::IDPos).getImm(); - + const int64_t ID = opers.getID(); auto MOI = std::next(MI.operands_begin(), opers.getStackMapStartIdx()); recordStackMapOpers(MI, ID, MOI, MI.operands_end(), opers.isAnyReg() && opers.hasDef()); @@ -368,7 +367,7 @@ void StackMaps::recordPatchPoint(const MachineInstr &MI) { // verify anyregcc auto &Locations = CSInfos.back().Locations; if (opers.isAnyReg()) { - unsigned NArgs = opers.getMetaOper(PatchPointOpers::NArgPos).getImm(); + unsigned NArgs = opers.getNumCallArgs(); for (unsigned i = 0, e = (opers.hasDef() ? NArgs + 1 : NArgs); i != e; ++i) assert(Locations[i].Type == Location::Register && "anyreg arg must be in reg."); |