<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi all,<br>
<br>
I am newbie for llvm. I just create a global variable, there are some statements in my pass like:<br>
<br>
LoadInst* int64_64 = new LoadInst(pthreadPID, "", false, OptAplusOne);<br>
int64_64->setAlignment(8);<br>
<br>
int64_64->dump();<br>
LoadInst* int32_65 = new LoadInst(gvar_int32_myFlag, "", false, OptAplusOne);<br>
int32_65->setAlignment(4);<br>
<br>
int32_65->dump();<br>
<br>
But when I run my pass, it generates an error, I don't know why.<br>
<br>
@myFlag = global i32 0, align 4<br>
@myPid = common global [20 x i64] zeroinitializer, align 16 //this is the global,
<br>
%117 = load i64* %t, align 8<br>
%118 = load i32* @myFlag, align 4<br>
While deleting: i32* %myFlag<br>
Use still stuck around after Def is destroyed:@myFlag = global i32 <null operand!>, align 4<br>
<br>
I am sure I initialize the global variable myFlag, I don't delete this global variable.<br>
<br>
Can anyone give some hints, or suggestions? <br>
<br>
Yuxi<br>
<br>
</div>
</body>
</html>