<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Looks to me like it converted the ? into the ascii hexadecimal representation _3F_.  I don't think another underscore was pre-pended.<div><br></div><div>This is probably thanks to lib/Target/Mangler.cpp.  You'll want to let ? be treated as an acceptable character.</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #b930a1">static</span> <span style="color: #b930a1">bool</span> isAcceptableChar(<span style="color: #b930a1">char</span> C, <span style="color: #b930a1">bool</span> AllowPeriod) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">  <span style="color: #b930a1">if</span> ((C < <span style="color: #3031d5">'a'</span> || C > <span style="color: #3031d5">'z'</span>) &&</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">      (C < <span style="color: #3031d5">'A'</span> || C > <span style="color: #3031d5">'Z'</span>) &&</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">      (C < <span style="color: #3031d5">'0'</span> || C > <span style="color: #3031d5">'9'</span>) &&</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">      C != <span style="color: #3031d5">'_'</span> && C != <span style="color: #3031d5">'$'</span> && C != <span style="color: #3031d5">'@'</span> && </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">      !(AllowPeriod && C == <span style="color: #3031d5">'.'</span>))</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(185, 48, 161); "><span style="color: #000000">    </span>return<span style="color: #000000"> </span>false<span style="color: #000000">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(185, 48, 161); "><span style="color: #000000">  </span>return<span style="color: #000000"> </span>true<span style="color: #000000">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">}</div></div><div><br></div><div>But you might want to add doesAllowQuestionMarksInName() to MCAsmInfo, it's possible that other name manglers don't accept question marks.</div><div><br></div><div>Cheers,</div><div> <br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" color="#a9a9a9" face="'Times New Roman'" size="2">Joe Abbey<br>Software Architect<br>Arxan Technologies, Inc.<br>1305 Cumberland Ave, Ste 215<br>West Lafayette, IN 47906<br><a href="mailto:jabbey@arxan.com">jabbey@arxan.com</a><br>www.arxan.com</font><br><br><br></div>
</div>


<br><div><div>On Nov 25, 2011, at 10:39 AM, Michael Spencer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>So I was taking a look at Microsoft C++ ABI support while on vacation,<br>and ran into a major issue. Given the following llvm-ir:<br><br>$ clang++ -S -emit-llvm -O3 mangling.cpp -o - -Xclang -cxx-abi -Xclang microsoft<br>; ModuleID = 'mangling.cpp'<br>target datalayout =<br>"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-<br>v128:128:128-a0:0:64-f80:32:32-n8:16:32-S32"<br>target triple = "i686-pc-win32"<br><br>define i32 @"?heyimacxxfunction@@YAHXZ"() nounwind readnone {<br>entry:<br>  ret i32 42<br>}<br><br>Note the ?heyimacxxfunction@@YAHXZ. Now if I generate assembly (using<br>clang or llc) I get:<br><br>$ clang++ -S -O3 mangling.cpp -o - -Xclang -cxx-abi -Xclang microsoft<br>        .def     __3F_heyimacxxfunction@@YAHXZ;<br>        .scl    2;<br>        .type   32;<br>        .endef<br>        .text<br>        .globl  __3F_heyimacxxfunction@@YAHXZ<br>        .align  16, 0x90<br>__3F_heyimacxxfunction@@YAHXZ:          # @"?heyimacxxfunction@@YAHXZ"<br># BB#0:                                 # %entry<br>        movl    $42, %eax<br>        ret<br><br>It turned the ? into _3F_, and prepended _ someplace. I get the same<br>symbol if I use integrated-as to generate an object file.<br><br>I've been unable thus far to find out exactly where this occurs. And<br>once I do find it, I'm not sure of the correct fix. I assume that LLVM<br>mangles the '?' because it means something special in the gas syntax.<br>There also has to be a way to communicate to llvm from clang that this<br>symbol should not receive a prepended _.<br><br>Thanks,<br><br>- Michael Spencer<br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></div></body></html>