From 623d2e618f4e672c47edff9ec63ed6d733ac81d3 Mon Sep 17 00:00:00 2001 From: Juergen Ributzka Date: Fri, 8 Nov 2013 23:28:16 +0000 Subject: [Stackmap] Add AnyReg calling convention support for patchpoint intrinsic. The idea of the AnyReg Calling Convention is to provide the call arguments in registers, but not to force them to be placed in a paticular order into a specified set of registers. Instead it is up tp the register allocator to assign any register as it sees fit. The same applies to the return value (if applicable). Differential Revision: http://llvm-reviews.chandlerc.com/D2009 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194293 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/StackMaps.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/StackMaps.cpp') diff --git a/lib/CodeGen/StackMaps.cpp b/lib/CodeGen/StackMaps.cpp index 51580b479d..89da78294f 100644 --- a/lib/CodeGen/StackMaps.cpp +++ b/lib/CodeGen/StackMaps.cpp @@ -30,7 +30,8 @@ using namespace llvm; void StackMaps::recordStackMap(const MachineInstr &MI, uint32_t ID, MachineInstr::const_mop_iterator MOI, - MachineInstr::const_mop_iterator MOE) { + MachineInstr::const_mop_iterator MOE, + bool recordResult) { MCContext &OutContext = AP.OutStreamer.getContext(); MCSymbol *MILabel = OutContext.CreateTempSymbol(); @@ -38,6 +39,16 @@ void StackMaps::recordStackMap(const MachineInstr &MI, uint32_t ID, LocationVec CallsiteLocs; + if (recordResult) { + std::pair ParseResult = + OpParser(MI.operands_begin(), llvm::next(MI.operands_begin(), 1)); + + Location &Loc = ParseResult.first; + assert(Loc.LocType == Location::Register && + "Stackmap return location must be a register."); + CallsiteLocs.push_back(Loc); + } + while (MOI != MOE) { std::pair ParseResult = OpParser(MOI, MOE); -- cgit v1.2.3