Skip to content

Commit

Permalink
Make HLSLOptions getter methods const (microsoft#5333)
Browse files Browse the repository at this point in the history
Make HLSLOptions getter methods const

Co-authored-by: Tex Riddell <[email protected]>
  • Loading branch information
python3kgae and tex3d authored Jun 28, 2023
1 parent b28885f commit a35f1fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions include/dxc/Support/HLSLOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,16 @@ class DxcOpts {

std::vector<std::string> Warnings;

bool IsRootSignatureProfile();
bool IsLibraryProfile();
bool IsRootSignatureProfile() const;
bool IsLibraryProfile() const;

// Helpers to clarify interpretation of flags for behavior in implementation
bool GenerateFullDebugInfo(); // Zi
bool GeneratePDB(); // Zi or Zs
bool EmbedDebugInfo(); // Qembed_debug
bool EmbedPDBName(); // Zi or Fd
bool DebugFileIsDirectory(); // Fd ends in '\\'
llvm::StringRef GetPDBName(); // Fd name
bool GenerateFullDebugInfo() const; // Zi
bool GeneratePDB() const; // Zi or Zs
bool EmbedDebugInfo() const; // Qembed_debug
bool EmbedPDBName() const; // Zi or Fd
bool DebugFileIsDirectory() const; // Fd ends in '\\'
llvm::StringRef GetPDBName() const; // Fd name

// SPIRV Change Starts
#ifdef ENABLE_SPIRV_CODEGEN
Expand Down
16 changes: 8 additions & 8 deletions lib/DxcSupport/HLSLOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,36 +130,36 @@ void DxcDefines::BuildDefines() {
}
}

bool DxcOpts::IsRootSignatureProfile() {
bool DxcOpts::IsRootSignatureProfile() const {
return TargetProfile == "rootsig_1_0" ||
TargetProfile == "rootsig_1_1";
}

bool DxcOpts::IsLibraryProfile() {
bool DxcOpts::IsLibraryProfile() const {
return TargetProfile.startswith("lib_");
}

bool DxcOpts::GenerateFullDebugInfo() {
bool DxcOpts::GenerateFullDebugInfo() const {
return DebugInfo;
}

bool DxcOpts::GeneratePDB() {
bool DxcOpts::GeneratePDB() const {
return DebugInfo || SourceOnlyDebug;
}

bool DxcOpts::EmbedDebugInfo() {
bool DxcOpts::EmbedDebugInfo() const {
return EmbedDebug;
}

bool DxcOpts::EmbedPDBName() {
bool DxcOpts::EmbedPDBName() const {
return GeneratePDB() || !DebugFile.empty();
}

bool DxcOpts::DebugFileIsDirectory() {
bool DxcOpts::DebugFileIsDirectory() const {
return !DebugFile.empty() && llvm::sys::path::is_separator(DebugFile[DebugFile.size() - 1]);
}

llvm::StringRef DxcOpts::GetPDBName() {
llvm::StringRef DxcOpts::GetPDBName() const {
if (!DebugFileIsDirectory())
return DebugFile;
return llvm::StringRef();
Expand Down

0 comments on commit a35f1fa

Please sign in to comment.