clang-cl: Don't store the cl compiler Tool on the stack (PR20131)
authorHans Wennborg <hans@hanshq.net>
Thu, 26 Jun 2014 19:59:02 +0000 (19:59 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 26 Jun 2014 19:59:02 +0000 (19:59 +0000)
commit1da044a4da0965a1510d626bf576d1b6c8078c4e
tree00688f1aab5e1d3911bff0012c0ddfc978c20cb5
parented988fb97d8cbede0880c1f254ff8788803dccb3
clang-cl: Don't store the cl compiler Tool on the stack (PR20131)

The Command will refer back to the Tool as its source,
so it has to outlive the Command.

Having the Tool on the stack would cause us to crash
when using "clang-cl -GR -fallback", because if the
Command fails, Driver::ExecuteCompilation tries to
peek at the Command's source.

Differential Revision: http://reviews.llvm.org/D4314

llvm-svn: 211802
clang/lib/Driver/Tools.cpp
clang/lib/Driver/Tools.h