diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-04-25 18:58:06 +0000 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-04-25 18:58:06 +0000 |
commit | 57fcd3454a5c3285fe7959e14601b8c307ed03b6 (patch) | |
tree | 42cdc13363acef9e5fa393a3abcebd555b2af875 /llvm/lib/CodeGen/MIRParser/MIRParser.cpp | |
parent | beffdb9daac6ed4545fcf241abad559387c6ea51 (diff) | |
download | bcm5719-llvm-57fcd3454a5c3285fe7959e14601b8c307ed03b6.tar.gz bcm5719-llvm-57fcd3454a5c3285fe7959e14601b8c307ed03b6.zip |
[MIR] Add support for debug metadata for fixed stack objects
Debug var, expr and loc were only supported for non-fixed stack objects.
This patch adds the following fields to the "fixedStack:" entries, and
renames the ones from "stack:" to:
* debug-info-variable
* debug-info-expression
* debug-info-location
Differential Revision: https://reviews.llvm.org/D46032
llvm-svn: 330859
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIRParser.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index 378102403b3..3d2db97acb4 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -122,8 +122,9 @@ public: const yaml::StringValue &RegisterSource, bool IsRestored, int FrameIdx); + template <typename T> bool parseStackObjectsDebugInfo(PerFunctionMIParsingState &PFS, - const yaml::MachineStackObject &Object, + const T &Object, int FrameIdx); bool initializeConstantPool(PerFunctionMIParsingState &PFS, @@ -616,6 +617,8 @@ bool MIRParserImpl::initializeFrameInfo(PerFunctionMIParsingState &PFS, if (parseCalleeSavedRegister(PFS, CSIInfo, Object.CalleeSavedRegister, Object.CalleeSavedRestored, ObjectIdx)) return true; + if (parseStackObjectsDebugInfo(PFS, Object, ObjectIdx)) + return true; } // Initialize the ordinary frame objects. @@ -700,11 +703,11 @@ static bool typecheckMDNode(T *&Result, MDNode *Node, return false; } +template <typename T> bool MIRParserImpl::parseStackObjectsDebugInfo(PerFunctionMIParsingState &PFS, - const yaml::MachineStackObject &Object, int FrameIdx) { + const T &Object, int FrameIdx) { // Debug information can only be attached to stack objects; Fixed stack // objects aren't supported. - assert(FrameIdx >= 0 && "Expected a stack object frame index"); MDNode *Var = nullptr, *Expr = nullptr, *Loc = nullptr; if (parseMDNode(PFS, Var, Object.DebugVar) || parseMDNode(PFS, Expr, Object.DebugExpr) || @@ -719,7 +722,7 @@ bool MIRParserImpl::parseStackObjectsDebugInfo(PerFunctionMIParsingState &PFS, typecheckMDNode(DIExpr, Expr, Object.DebugExpr, "DIExpression", *this) || typecheckMDNode(DILoc, Loc, Object.DebugLoc, "DILocation", *this)) return true; - PFS.MF.setVariableDbgInfo(DIVar, DIExpr, unsigned(FrameIdx), DILoc); + PFS.MF.setVariableDbgInfo(DIVar, DIExpr, FrameIdx, DILoc); return false; } |