diff --git a/include/dxc/Support/HLSLOptions.h b/include/dxc/Support/HLSLOptions.h index c5e52e5680..41f6b2c63b 100644 --- a/include/dxc/Support/HLSLOptions.h +++ b/include/dxc/Support/HLSLOptions.h @@ -229,16 +229,16 @@ class DxcOpts { std::vector 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 diff --git a/lib/DxcSupport/HLSLOptions.cpp b/lib/DxcSupport/HLSLOptions.cpp index 717bb15b64..a76a788a4d 100644 --- a/lib/DxcSupport/HLSLOptions.cpp +++ b/lib/DxcSupport/HLSLOptions.cpp @@ -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();