summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-08-31 18:50:09 +0000
committerDevang Patel <dpatel@apple.com>2010-08-31 18:50:09 +0000
commit8559932d36eff4a83c154ea52964c462112a56e7 (patch)
tree09c49a8ea9f95911d4792e681462e134c9e54ed6 /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parent6f6b590b996b21c90af7c35685214b5e298dc5aa (diff)
downloadbcm5719-llvm-8559932d36eff4a83c154ea52964c462112a56e7.tar.gz
bcm5719-llvm-8559932d36eff4a83c154ea52964c462112a56e7.zip
Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011. llvm-svn: 112623
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 77a2c866966..bed9c08ee9d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -254,6 +254,29 @@ unsigned FunctionLoweringInfo::CreateRegs(const Type *Ty) {
return FirstReg;
}
+/// setByValArgumentFrameIndex - Record frame index for the byval
+/// argument. This overrides previous frame index entry for this argument,
+/// if any.
+void FunctionLoweringInfo::setByValArgumentFrameIndex(const Argument *A,
+ int FI) {
+ assert (A->hasByValAttr() && "Argument does not have byval attribute!");
+ ByValArgFrameIndexMap[A] = FI;
+}
+
+/// getByValArgumentFrameIndex - Get frame index for the byval argument.
+/// This routine must be used after the argument's frame index is set.
+/// If the argument does not have any entry in the map then assertion
+/// will be raised.
+int FunctionLoweringInfo::getByValArgumentFrameIndex(const Argument *A) {
+ assert (A->hasByValAttr() && "Argument does not have byval attribute!");
+ DenseMap<const Argument *, int>::iterator I =
+ ByValArgFrameIndexMap.find(A);
+ assert (I != ByValArgFrameIndexMap.end() &&
+ "Argument does not have assigned frame index!");
+ return I->second;
+
+}
+
/// AddCatchInfo - Extract the personality and type infos from an eh.selector
/// call, and add them to the specified machine basic block.
void llvm::AddCatchInfo(const CallInst &I, MachineModuleInfo *MMI,
OpenPOWER on IntegriCloud