<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p style="margin-top:0; margin-bottom:0">Hello,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Could someone explain to me what the rules are for concatenation of DWARF location expressions?</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">For example in <span>lib/CodeGen/PrologEpilogInserter.cpp there is a call to <span>DIExpression::prepend to concatenate the stack slot address of a variable to an existing expression. Now the problem here is that the
 former is a 'Memory location description' while the latter could very well be a 'Implicit location description' (e.g. the sign extension from  <span>lib/Transforms/Utils/Local.cpp) in which case a DW_OP_deref of some sort would be needed in between.</span></span></span></p>
<p style="margin-top:0; margin-bottom:0"><span><span><span><br>
</span></span></span></p>
<p style="margin-top:0; margin-bottom:0"><span><span><span>To me it seems that there is no clear way of knowing what to do when concatenating because there is no clear way of knowing the kind of the existing expression (is it Memory, Register or Implicit). </span></span></span></p>
<p style="margin-top:0; margin-bottom:0"><span><span><span><br>
</span></span></span></p>
<p style="margin-top:0; margin-bottom:0"><span><span><span>Without having thought too much about it it would seem that having additional meta ops in the expression for the sole purpose of identifying what kind it is would be helpful when concatenating.</span></span></span></p>
<p style="margin-top:0; margin-bottom:0"><span><span><span><br>
</span></span></span></p>
<p style="margin-top:0; margin-bottom:0">I could find similar topics being raised on the list in the past but was not able to find any clear conclusion.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Thanks!</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">-Markus</p>
<p style="margin-top:0; margin-bottom:0"><span><span><span><br>
</span></span></span></p>
<p style="margin-top:0; margin-bottom:0"><span><span><span><br>
</span></span></span></p>
</div>
</body>
</html>