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

bear generate redundant database when using wllvm #66

Closed
hongxuchen opened this issue Nov 13, 2014 · 4 comments
Closed

bear generate redundant database when using wllvm #66

hongxuchen opened this issue Nov 13, 2014 · 4 comments
Milestone

Comments

@hongxuchen
Copy link

This is a rare use-case: when using wllvm Bear always generates more compilation database entries than expected.

As the README.md mentioned, that project does 2 things when CC=wllvm and CXX=wllvm++ during compilation:

  • invoke regular compiler to build a real object
  • Do bitcode compilation with the corresponding compiler commands specified.

In this sense, I was hoping

min.out: main.o min.o
        $(CC) main.o min.o -o $@
main.o:
        $(CC) main.c -c -o $@ 
min.o:
        $(CC) min.c -c -o $@

Will generate compile commands like:

clang main.c -c -o main.o
clang min.c -c -o min.o
clang -emit-llvm main.c -c -o .main.o.bc
clang -emit-llvm main.c -c -o .min.o.bc

But the inside compiler_commands.json there are 9 entries for the same compilation commands for each build target. Also I notice that wllvm seems correct here since when set WLLVM_OUTPUT=debug it only prints each compilation once. So this may be an issue for Bear.
But as my case is not the regular compilation practice, I guess this should be of low priority.

@rizsotto
Copy link
Owner

thanks for the report. compiler wrappers are root of problems as i mentioned in the documentation.
the next release will contain fix for detecting (and filtering) potential duplicates.

@hongxuchen
Copy link
Author

@rizsotto Sorry I didn't read the document carefully. Just treat this as a reminder:-)

@rizsotto rizsotto modified the milestone: 2.0 Jan 19, 2015
@rizsotto
Copy link
Owner

there is a new version of the tool, which filters the compiler wrappers now. please give it a try and reopen this issue if that's still a case.

@hongxuchen
Copy link
Author

Works like a charm, many thanks!

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

No branches or pull requests

2 participants