diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-06-26 19:59:02 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-06-26 19:59:02 +0000 |
commit | 1da044a4da0965a1510d626bf576d1b6c8078c4e (patch) | |
tree | 00688f1aab5e1d3911bff0012c0ddfc978c20cb5 /clang/lib/Driver/Tools.h | |
parent | ed988fb97d8cbede0880c1f254ff8788803dccb3 (diff) | |
download | bcm5719-llvm-1da044a4da0965a1510d626bf576d1b6c8078c4e.tar.gz bcm5719-llvm-1da044a4da0965a1510d626bf576d1b6c8078c4e.zip |
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
Diffstat (limited to 'clang/lib/Driver/Tools.h')
-rw-r--r-- | clang/lib/Driver/Tools.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Driver/Tools.h b/clang/lib/Driver/Tools.h index a25653ea70f..c4e6d6c8298 100644 --- a/clang/lib/Driver/Tools.h +++ b/clang/lib/Driver/Tools.h @@ -29,6 +29,11 @@ namespace toolchains { } namespace tools { + +namespace visualstudio { + class Compile; +} + using llvm::opt::ArgStringList; /// \brief Clang compiler tool. @@ -78,6 +83,10 @@ using llvm::opt::ArgStringList; void AddClangCLArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const; + visualstudio::Compile *getCLFallback() const; + + mutable std::unique_ptr<visualstudio::Compile> CLFallback; + public: Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {} @@ -563,7 +572,7 @@ namespace dragonfly { }; } // end namespace dragonfly - /// Visual studio tools. +/// Visual studio tools. namespace visualstudio { class LLVM_LIBRARY_VISIBILITY Link : public Tool { public: |