-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[HLSL] Set default DwarfVersion to 4 for HLSL. #97854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Set default DwarfVersion to 4 for HLSL to match DXIL which not support DwarfVersion 5. Based on https://registry.khronos.org/SPIR-V/specs/unified1/DebugInfo.html SPIRV is currently using Dwarf4 as well. This is for the Dwarf Version 5 part of llvm#96912.
@llvm/pr-subscribers-clang @llvm/pr-subscribers-hlsl Author: Xiang Li (python3kgae) ChangesSet default DwarfVersion to 4 for HLSL to match DXIL which does not support DwarfVersion 5. Based on https://registry.khronos.org/SPIR-V/specs/unified1/DebugInfo.html SPIRV is currently using Dwarf4 as well. This is for the Dwarf Version 5 part of #96912. Full diff: https://github.com/llvm/llvm-project/pull/97854.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/HLSL.h b/clang/lib/Driver/ToolChains/HLSL.h
index 7b775b89743188..b2a31aabab7dc1 100644
--- a/clang/lib/Driver/ToolChains/HLSL.h
+++ b/clang/lib/Driver/ToolChains/HLSL.h
@@ -52,6 +52,9 @@ class LLVM_LIBRARY_VISIBILITY HLSLToolChain : public ToolChain {
static std::optional<std::string> parseTargetProfile(StringRef TargetProfile);
bool requiresValidation(llvm::opt::DerivedArgList &Args) const;
+ // Set default DWARF version to 4 for DXIL uses version 4.
+ unsigned GetDefaultDwarfVersion() const override { return 4; }
+
private:
mutable std::unique_ptr<tools::hlsl::Validator> Validator;
};
diff --git a/clang/test/Driver/dxc_debug.hlsl b/clang/test/Driver/dxc_debug.hlsl
index 9e207da85d5de8..0eab32168982b0 100644
--- a/clang/test/Driver/dxc_debug.hlsl
+++ b/clang/test/Driver/dxc_debug.hlsl
@@ -11,4 +11,5 @@
// CHECK: "-cc1"
// CHECK-CV-SAME: -gcodeview
// CHECK-SAME: "-debug-info-kind=constructor"
-// CHECK-DWARF-SAME: -dwarf-version
+// Make sure dwarf-version is 4.
+// CHECK-DWARF-SAME: -dwarf-version=4
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/50/builds/951 Here is the relevant piece of the build log for the reference:
|
Set default DwarfVersion to 4 for HLSL to match DXIL which does not support DwarfVersion 5. Based on https://registry.khronos.org/SPIR-V/specs/unified1/DebugInfo.html SPIRV is currently using Dwarf4 as well. This is for the Dwarf Version 5 part of llvm#96912.
Set default DwarfVersion to 4 for HLSL to match DXIL which does not support DwarfVersion 5.
Based on https://registry.khronos.org/SPIR-V/specs/unified1/DebugInfo.html SPIRV is currently using Dwarf4 as well.
This is for the Dwarf Version 5 part of #96912.