Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

tooling::ToolInvocation catastrophic failure if not -fsyntax-only #34908

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR35935
Status NEW
Importance P release blocker
Reported by Asher Haig (asher@strong.ai)
Reported on 2018-01-12 12:04:34 -0800
Last modified on 2018-01-12 12:04:34 -0800
Version trunk
Hardware Macintosh MacOS X
CC dgregor@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments toolinvocationerror.cpp (3833 bytes, text/x-csrc)
Blocks
Blocked by
See also
Created attachment 19669
Code demonstrating the problem

It seems that clang::tooling::ToolInvocation erases -fno-lto and always creates
2 compilation jobs for any single file (the second job being link to libLTO).

The result is that clang::tooling::ToolInvocation always fails with the message
"unable to handle compilation, expected exactly one compiler job".

I am attempting to compile code from a string, and this seems to be the way it
is done. I cannot get code to work either from a virtual file or from a real
file. I have working code for real files using Driver based on Examples/clang-
interpreter.

Error seems to occur on 5.0 and 7.0. All tests for both 5.0 and 7.0 (from check-
clang) seem to pass as expected.

Attached file with code.

Asher
Quuxplusone commented 6 years ago

Attached toolinvocationerror.cpp (3833 bytes, text/x-csrc): Code demonstrating the problem