[cfe-commits] r173186 - in /cfe/trunk: include/clang/Basic/LangOptions.def include/clang/Driver/Options.td lib/Driver/Tools.cpp lib/Frontend/CompilerInvocation.cpp lib/Parse/ParseStmt.cpp test/CodeGen/ms-inline-asm-64.c test/CodeGen/ms-inline-asm.c test/Driver/clang_f_opts.c test/Sema/ms-inline-asm.c

Renato Golin renato.golin at linaro.org
Thu Jan 24 11:57:08 PST 2013


On 23 January 2013 18:23, Chad Rosier <mcrosier at apple.com> wrote:

> Hi Renato,
> 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?
>

Hi Chad,

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).

Code:
599  // Get the target specific parser.
600  std::string Error;
601  const std::string &TT =
Context.getTargetInfo().getTriple().getTriple();
602  const llvm::Target *TheTarget(llvm::TargetRegistry::lookupTarget(TT,
Error));
603
604  OwningPtr<llvm::MCAsmInfo> MAI(TheTarget->createMCAsmInfo(TT));
605  OwningPtr<llvm::MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TT));
606  OwningPtr<llvm::MCObjectFileInfo> MOFI(new llvm::MCObjectFileInfo());
607  OwningPtr<llvm::MCSubtargetInfo>
608    STI(TheTarget->createMCSubtargetInfo(TT, "", ""));

on line 604 "TheTarget" is NULL.

So, there are two things here, and I'm including cfe-dev for discussion:

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.

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.

cheers,
--renato

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130124/c49bdc64/attachment.html>


More information about the cfe-commits mailing list