[llvm] [DXIL] Consume Metadata Analysis information in passes (PR #108034)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 09:59:21 PDT 2024


================
@@ -21,20 +21,20 @@ class Function;
 namespace dxil {
 
 struct EntryProperties {
-  const Function *Entry;
+  const Function *Entry{nullptr};
   // Specific target shader stage may be specified for entry functions
   Triple::EnvironmentType ShaderStage = Triple::UnknownEnvironment;
   unsigned NumThreadsX{0}; // X component
   unsigned NumThreadsY{0}; // Y component
   unsigned NumThreadsZ{0}; // Z component
 
-  EntryProperties(const Function &Fn) : Entry(&Fn) {};
+  EntryProperties(const Function *Fn = nullptr) : Entry(Fn) {};
 };
 
 struct ModuleMetadataInfo {
   VersionTuple DXILVersion{};
   VersionTuple ShaderModelVersion{};
-  Triple::EnvironmentType ShaderStage = Triple::UnknownEnvironment;
+  Triple::EnvironmentType ShaderProfile = Triple::UnknownEnvironment;
----------------
bharadwajy wrote:

> I'm wondering why we're happy with default initialization for all the other members, but not this one.
> 
> These two suggestions I think are equivalent, but more consistent with the style used in rest of the struct:

Changed default initialization style as suggested.

https://github.com/llvm/llvm-project/pull/108034


More information about the llvm-commits mailing list