[cfe-commits] r100493 - /cfe/trunk/tools/driver/cc1_main.cpp
Chris Lattner
clattner at apple.com
Tue Apr 6 19:00:40 PDT 2010
>>>> Is the <inline asm> a temporary thing? It seems like we should be able to map from source locations inside the inline asm back to real locations in the original .c file.
>>>
>>> "I'm adding a "asm generated from here" line pointing back to the original .c file next."
>>>
>>> :-)
>>
>>
>> Yes, but why the two-step with an error + note pointing back into the .c file, rather than just mapping the location of the error and having a single diagnostic?
Also it's worth pointing out that the baseline experience with gcc (or clang without the integrated assembler) is something like this:
$ clang foo.c
/tmp/<something long>/blarg.s:8123: invalid operands
$
and it deletes the file. Just producing a caret diagnostic is already a huge win :)
-Chris
>
> C (pseudo)code:
>
> void foo() {
> asm("mov %0, (%eax)" : : "=X"(abc));
>
> Desired error:
>
> <inline asm>:1:4: error: invalid operands or whatever
> mov (%ebx), (%eax)
> ^
> foo.c:123:4: note: instantiated from here:
> asm("mov %0, (%eax)" : : "=X"(abc));
> ^
>
> You really do need to see what is getting fed into the assembler to understand why it doesn't grok it.
>
> -Chris
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list