@@ -209,16 +209,15 @@ getEntryPropAsMetadata(const EntryProperties &EP, uint64_t EntryShaderFlags,
209
209
return MDNode::get (Ctx, MDVals);
210
210
}
211
211
212
- // Each entry point metadata record specifies:
213
- // * reference to the entry point function global symbol
214
- // * unmangled name
215
- // * list of signatures
216
- // * list of resources
217
- // * list of tag-value pairs of shader capabilities and other properties
218
-
219
212
MDTuple *constructEntryMetadata (const Function *EntryFn, MDTuple *Signatures,
220
213
MDNode *Resources, MDTuple *Properties,
221
214
LLVMContext &Ctx) {
215
+ // Each entry point metadata record specifies:
216
+ // * reference to the entry point function global symbol
217
+ // * unmangled name
218
+ // * list of signatures
219
+ // * list of resources
220
+ // * list of tag-value pairs of shader capabilities and other properties
222
221
Metadata *MDVals[5 ];
223
222
MDVals[0 ] =
224
223
EntryFn ? ValueAsMetadata::get (const_cast <Function *>(EntryFn)) : nullptr ;
@@ -240,19 +239,20 @@ static MDTuple *emitEntryMD(const EntryProperties &EP, MDTuple *Signatures,
240
239
}
241
240
242
241
static void emitValidatorVersionMD (Module &M, const ModuleMetadataInfo &MMDI) {
243
- if (!MMDI.ValidatorVersion .empty ()) {
244
- LLVMContext &Ctx = M.getContext ();
245
- IRBuilder<> IRB (Ctx);
246
- Metadata *MDVals[2 ];
247
- MDVals[0 ] =
248
- ConstantAsMetadata::get (IRB.getInt32 (MMDI.ValidatorVersion .getMajor ()));
249
- MDVals[1 ] = ConstantAsMetadata::get (
250
- IRB.getInt32 (MMDI.ValidatorVersion .getMinor ().value_or (0 )));
251
- NamedMDNode *ValVerNode = M.getOrInsertNamedMetadata (" dx.valver" );
252
- // Set validator version obtained from DXIL Metadata Analysis pass
253
- ValVerNode->clearOperands ();
254
- ValVerNode->addOperand (MDNode::get (Ctx, MDVals));
255
- }
242
+ if (MMDI.ValidatorVersion .empty ())
243
+ return ;
244
+
245
+ LLVMContext &Ctx = M.getContext ();
246
+ IRBuilder<> IRB (Ctx);
247
+ Metadata *MDVals[2 ];
248
+ MDVals[0 ] =
249
+ ConstantAsMetadata::get (IRB.getInt32 (MMDI.ValidatorVersion .getMajor ()));
250
+ MDVals[1 ] = ConstantAsMetadata::get (
251
+ IRB.getInt32 (MMDI.ValidatorVersion .getMinor ().value_or (0 )));
252
+ NamedMDNode *ValVerNode = M.getOrInsertNamedMetadata (" dx.valver" );
253
+ // Set validator version obtained from DXIL Metadata Analysis pass
254
+ ValVerNode->clearOperands ();
255
+ ValVerNode->addOperand (MDNode::get (Ctx, MDVals));
256
256
}
257
257
258
258
static void emitShaderModelVersionMD (Module &M,
0 commit comments