Skip to content

[3.0 regression] clang not mapping inline ask errors back to source #11515

@lattner

Description

@lattner
Bugzilla Link 11143
Resolution FIXED
Resolved on Oct 17, 2011 00:21
Version 1.0
OS All
CC @d0k

Extended Description

As of Kevin's patch in r141814, we now are not mapping inline assembly errors back to clang's diagnostic handler. This prevents us from printing the source location, and we don't realize that an error occurred, so we continue compilation.

$ cat t.c
void foo() {
asm("movl 0(%rax), 0(%edx)");
}
$ clang t.c
:1:16: error: invalid operand for instruction
movl 0(%rax), 0(%edx)
^~~~~~~
Undefined symbols for architecture x86_64:
"_main", referenced from:
start in crt1.10.6.o

This is what we used to get:

$ old-clang t.c
t.c:3:7: error: invalid operand for instruction
asm("movl 0(%rax), 0(%edx)");
^
:1:16: note: instantiated into assembly here
movl 0(%rax), 0(%edx)
^
1 error generated.

It looks like the bug is in around MCParser/AsmParser.cpp:1269, not passing diagnostics into the LLVMContext's register diagnostic handler anymore. This needs to be fixed for LLVM 3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions