diff options
Diffstat (limited to 'clang/lib/Driver/ToolChains/HLSL.h')
| -rw-r--r-- | clang/lib/Driver/ToolChains/HLSL.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/HLSL.h b/clang/lib/Driver/ToolChains/HLSL.h index 3824b4252324..3aed90464842 100644 --- a/clang/lib/Driver/ToolChains/HLSL.h +++ b/clang/lib/Driver/ToolChains/HLSL.h @@ -42,6 +42,20 @@ public: const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + +class LLVM_LIBRARY_VISIBILITY LLVMObjcopy : public Tool { +public: + LLVMObjcopy(const ToolChain &TC) + : Tool("hlsl::LLVMObjcopy", "llvm-objcopy", TC) {} + + bool hasIntegratedCPP() const override { return false; } + + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; + } // namespace hlsl } // namespace tools @@ -65,6 +79,13 @@ public: static std::optional<std::string> parseTargetProfile(StringRef TargetProfile); bool requiresValidation(llvm::opt::DerivedArgList &Args) const; bool requiresBinaryTranslation(llvm::opt::DerivedArgList &Args) const; + bool requiresObjcopy(llvm::opt::DerivedArgList &Args) const; + + /// If we are targeting DXIL then the last job should output the DXContainer + /// to the specified output file with /Fo. Otherwise, we will emit to a + /// temporary file for the next job to use. + /// + /// Returns true if we should output to the final result file. bool isLastJob(llvm::opt::DerivedArgList &Args, Action::ActionClass AC) const; // Set default DWARF version to 4 for DXIL uses version 4. @@ -73,6 +94,7 @@ public: private: mutable std::unique_ptr<tools::hlsl::Validator> Validator; mutable std::unique_ptr<tools::hlsl::MetalConverter> MetalConverter; + mutable std::unique_ptr<tools::hlsl::LLVMObjcopy> LLVMObjcopy; }; } // end namespace toolchains |
