[PATCH] D46032: [MIR] Add support for debug metadata for fixed stack objects

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 25 03:16:09 PDT 2018


thegameg added inline comments.


================
Comment at: include/llvm/CodeGen/MachineFunction.h:352
     const DIExpression *Expr;
-    unsigned Slot;
+    int Slot;
     const DILocation *Loc;
----------------
plotfi wrote:
> Why the change in type here?
Fixed stack objects have negative FrameIndex values.


================
Comment at: lib/CodeGen/MIRPrinter.cpp:277
+  }
+}
 
----------------
plotfi wrote:
> Could this be cleaned up? Something like:
> 
> ```
> SmallVector<T, 3> DebugValues = { Object.DebugVar.Value, Object.DebugExpr.Value, Object.DebugLoc.Value };
> SmallVector<T, 3> DebugVars = { DebugVar.Var, DebugVar.Expr, DebugVar.Loc };
> 
> for (unsigned i = 0; i < DebugValues.size(); ++i) {
>     raw_string_ostream StrOS(DebugValues[i]);
>     DebugVars[i]->printAsOperand(StrOS, MST);
> }
> 
> ```
I'm afraid this is not going to work since `DebugVar.Var`, `.Expr` and `.Loc` have different types.


https://reviews.llvm.org/D46032





More information about the llvm-commits mailing list