<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hi,</div><div><br></div><div>I tried to get the name of function+loop, so I write a small function as following:</div><div><br></div><div><p style="margin: 0px;" data-mce-style="margin: 0px;">StringRef getStringofFL(const Function * F, const Loop * L){<br> StringRef sr;<br> std::string s1 = F->getName();<br> std::string s2 = L->getHeader()->getName();<br> sr = s1+s2;<br> return sr;<br>}</p><p style="margin: 0px;" data-mce-style="margin: 0px;"><br></p><p style="margin: 0px;" data-mce-style="margin: 0px;">However, two questions came:</p><p style="margin: 0px;" data-mce-style="margin: 0px;">1, if I output sr like: errs() << sr; it's ok (for instance: <span style="font-family: Menlo; font-size: 11px;" data-mce-style="font-family: Menlo; font-size: 11px;">mainfor.cond</span><span style="font-size: 12pt;" data-mce-style="font-size: 12pt;">), but when I called this function and got the StringRef: StringRef s= getStringofFL(F, L); errs() << s; the result is: </span><span style="font-family: Menlo; font-size: 11px;" data-mce-style="font-family: Menlo; font-size: 11px;">m\275[\377\177\000\0002\354\333\004\001,<span style="font-family: arial, helvetica, sans-serif; font-size: small;"> </span></span><span style="font-family: arial, helvetica, sans-serif; font-size: small;">why?</span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><font face="arial, helvetica, sans-serif" size="2">2, I used the StringMap, and the StringRef got from the function getStringofFL as a key. Then I stored something into this StringMap, but I couldn't get it with the same function and loop. why?</font></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><font face="arial, helvetica, sans-serif" size="2"><br></font></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><font face="arial, helvetica, sans-serif" size="2"><br></font></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><font face="arial, helvetica, sans-serif" size="2">Thank you!</font></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><font face="arial, helvetica, sans-serif" size="2"><br></font></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><font face="arial, helvetica, sans-serif" size="2">Hanbing</font></p></div></div></body></html>