Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions clang/lib/Driver/ToolChains/HLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,3 +567,7 @@ bool HLSLToolChain::isLastJob(DerivedArgList &Args,
// output to the result file.
return true;
}

void HLSLToolChain::addClangWarningOptions(ArgStringList &CC1Args) const {
CC1Args.push_back("-Wconversion");
}
2 changes: 2 additions & 0 deletions clang/lib/Driver/ToolChains/HLSL.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class LLVM_LIBRARY_VISIBILITY HLSLToolChain : public ToolChain {
// Set default DWARF version to 4 for DXIL uses version 4.
unsigned GetDefaultDwarfVersion() const override { return 4; }

void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const override;

private:
mutable std::unique_ptr<tools::hlsl::Validator> Validator;
mutable std::unique_ptr<tools::hlsl::MetalConverter> MetalConverter;
Expand Down
7 changes: 7 additions & 0 deletions clang/test/Driver/HLSL/wconversion.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// RUN: %clang_dxc -T lib_6_7 %s -### %s 2>&1 | FileCheck %s --check-prefixes=CONV
// RUN: %clang_dxc -T lib_6_7 -Wno-conversion %s -### %s 2>&1 | FileCheck %s --check-prefixes=NOCONV

// make sure we generate -Wconversion by default
// CONV: "-Wconversion"
// make sure -Wno-conversion still works
// NOCONV: "-Wno-conversion"
Loading