<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71794>71794</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
How can I get GlobalVariable from DIGlobalVariable?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ash1852
</td>
</tr>
</table>
<pre>
like title says, I recently is upgrade my tool to be compatable with llvm-15(used be compatable with llvm-3.6.2). In llvm-3.6.2 I can get GlobalVariable by using api DIGlobalVariable::getGlobal, whose codes have been shown below, but in llvm-15.0.0 it was removed. How can I get GlobalVariable from DIGlobalVariable? Can i just cast the forth operand of DIGlobalVariable to GlobalVaribale like that in llvm-3.6..2?
![image](https://github.com/llvm/llvm-project/assets/87304478/4c41a925-e0b0-4856-a002-ddc2517fbf58)
thanks in advance for helping.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyck8-O2yAQxp8GX0axAJsYH3zY3chtXqD3wZ4YdjFEBifK21f2ttpW3R7aE9L8gd98H4MpuSkQdUw9M3UqcM02Lh0mK7SShYnjo_PujSC77AkSPhKTL3CGhQYK2T_AJViv04IjwfyAHKOHHMEQDHG-YkbjCe4uW_D-Nh-EYlKvica_VlTlsZRMtiWcwy8ROMOAASbK8MVHg_4bLm5vNQ9YkwsT4NXB6fx7llVPrHqaKL-HN_a7jWl7e6QEFm8EhihAsvEewJCP963IrBlc-Mlc8pKDy3DHBAvN8UZjCV_jfUc6fwZ1WeL8CUwPLxjAweuaMgyYMmRLcIlLthCvtGAYIV7-aNwU_YgY9ATvplj8wNxkKiWresZPjD8xKZh6djNOxNSJSW1zvqZND9kz2U8u29WUQ5yZ7Lf-H8fhusRXGjKTPaZEOTHZ66bidd1oJvt6qAW2Uh2IG36otToekHN5GMdBKtFczEVpJtt3hGwxvKUNEMcbhmGfFCz5qwtTWYxdNbZViwV14ti2SupKi8J2xxqHS9Vw3Ug9iMugudHc4Ki4argmU7hOclkJwVshRMVFOVZKITZje1SDqivNak4zOl9uE5VxmQqX0kpdI5q2Ljwa8mn_8VIGusOeZFJuC7B0uwpmnRKruXcpp49b9iXo_sv4Yl18988W7GSbBTv59wAAAP__4tExeg">