<div dir="ltr">On 23 January 2013 18:23, Chad Rosier <span dir="ltr"><<a href="mailto:mcrosier@apple.com" target="_blank">mcrosier@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi Renato,<div>Yes, these are mine, but I'm not sure how I can go about debugging this.  Unfortunately, the stack dump is over little help and I don't have a way of reproducing this.  Could I get access to the machine, so I can try to reproduce the problem?</div>
</div></blockquote><div><br></div><div style>Hi Chad,</div><div style><br></div><div style>So, I got to the bottom of it, and the problem is that Clang is looking for a Target-Specific parser, while the target does not exist (since it wasn't build for it).</div>
<div style><br></div><div style>Code:</div><div style><div>599<span class="" style="white-space:pre">       </span>  // Get the target specific parser.</div><div>600<span class="" style="white-space:pre">    </span>  std::string Error;</div>
<div>601<span class="" style="white-space:pre"> </span>  const std::string &TT = Context.getTargetInfo().getTriple().getTriple();</div><div>602<span class="" style="white-space:pre">  </span>  const llvm::Target *TheTarget(llvm::TargetRegistry::lookupTarget(TT, Error));</div>
<div>603<span class="" style="white-space:pre"> </span></div><div>604<span class="" style="white-space:pre">        </span>  OwningPtr<llvm::MCAsmInfo> MAI(TheTarget->createMCAsmInfo(TT));</div><div>605<span class="" style="white-space:pre">      </span>  OwningPtr<llvm::MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TT));</div>
<div>606<span class="" style="white-space:pre"> </span>  OwningPtr<llvm::MCObjectFileInfo> MOFI(new llvm::MCObjectFileInfo());</div><div>607<span class="" style="white-space:pre">   </span>  OwningPtr<llvm::MCSubtargetInfo></div>
<div>608<span class="" style="white-space:pre"> </span>    STI(TheTarget->createMCSubtargetInfo(TT, "", ""));</div><div><br></div><div style>on line 604 "TheTarget" is NULL.</div><div style>
<br></div><div style>So, there are two things here, and I'm including cfe-dev for discussion:</div><div style><br></div><div style>1. Any target-specific behaviour should be reported as an error early on the compilation phase. Still, would be good to put an "user error" in here, warning that the target was not compiled blah blah.</div>
<div style><br></div><div style>2. This test should be in a target-specific place, since even if the NULL pointer is fixed, the test on non-i386 targets will still fail with a "target not available" error message.</div>
<div style><br></div><div style>cheers,</div><div style>--renato</div></div><div style><br></div><div style>PS: You can reproduce by compiling on any machine but only building the ARM backend (or possibly any non-i386 backends). This error is not specific to MS ASM syntax, but was exposed by it.</div>
<div><br></div></div></div></div>