Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parser for LLVM Clang #752

Closed
ewaterlander opened this issue Apr 5, 2024 · 0 comments · Fixed by #803
Closed

Error parser for LLVM Clang #752

ewaterlander opened this issue Apr 5, 2024 · 0 comments · Fixed by #803

Comments

@ewaterlander
Copy link
Contributor

As far as I know there is no error parser for LLVM clang. I could not find it. Using the default GNU gcc/g++ error parser results in to false errors during the build step. For instance a clang "remark:" message is categorized as an error by the GNU gcc/g++ error parser.

To reproduce compile this small C++ program, using clang, with CFLAGS = -O2 -Rpass=inline

int foo(int a, int b) {
	return a + b;
}

int bar(int j) {
	return foo(j, j - 2);
}

int main(int argc, char **argv) {
	return 0;
}

Results in:

Building in: hello/build/make.run.linux.x86_64
make -f ../../Makefile
clang++ -c -O2 -Rpass=inline   -o hello.o hello/hello.cpp
hello/hello.cpp:6:9: remark: _Z3fooii inlined into _Z3bari with cost=-35 (threshold=337) [-Rpass=inline]
        return foo(j, j - 2);
               ^
clang++  -o hello hello.o
Build complete (1 errors, 0 warnings): hello/build/make.run.linux.x86_64

I would like to have an error parser for LLVM clang.

I would also like to know what alternative I have programmatically. Would it require add a complete new error parser plugin? Or is there an easy option to insert a regex via a plugin to the GNU gcc/g++ error parser?

The context is a CDT Core Build Makefile project based IDE, using LLVM clang based toolchain.

ewaterlander added a commit to ewaterlander/cdt that referenced this issue May 29, 2024
Added support for LLVM optimization remarks to the GCC c/c++ error
parser. They were falsly treated as errors (OtherError). Now they are
treated as generic infos. GCC has no diagnostic messages of 'remark'
type. Since GCC and LLVM messages are very similar, no separate LLVM
error parser was created.

Fixes eclipse-cdt#752
jonahgraham pushed a commit that referenced this issue May 29, 2024
Added support for LLVM optimization remarks to the GCC c/c++ error
parser. They were falsly treated as errors (OtherError). Now they are
treated as generic infos. GCC has no diagnostic messages of 'remark'
type. Since GCC and LLVM messages are very similar, no separate LLVM
error parser was created.

Fixes #752
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant