7
7
// ===----------------------------------------------------------------------===//
8
8
9
9
#include " DXILPrettyPrinter.h"
10
- #include " DXILResourceAnalysis.h"
11
10
#include " DirectX.h"
12
11
#include " llvm/ADT/StringRef.h"
13
12
#include " llvm/Analysis/DXILResource.h"
@@ -222,8 +221,7 @@ struct FormatBindingSize
222
221
} // namespace
223
222
224
223
static void prettyPrintResources (raw_ostream &OS, const DXILBindingMap &DBM,
225
- DXILResourceTypeMap &DRTM,
226
- const dxil::Resources &MDResources) {
224
+ DXILResourceTypeMap &DRTM) {
227
225
// Column widths are arbitrary but match the widths DXC uses.
228
226
OS << " ;\n ; Resource Bindings:\n ;\n " ;
229
227
OS << formatv (" ; {0,-30} {1,10} {2,7} {3,11} {4,7} {5,14} {6,9}\n " , " Name" ,
@@ -237,11 +235,6 @@ static void prettyPrintResources(raw_ostream &OS, const DXILBindingMap &DBM,
237
235
const dxil::ResourceTypeInfo &RTI = DRTM[RBI.getHandleTy ()];
238
236
239
237
dxil::ResourceClass RC = RTI.getResourceClass ();
240
- assert ((RC != dxil::ResourceClass::CBuffer || !MDResources.hasCBuffers ()) &&
241
- " Old and new cbuffer representations can't coexist" );
242
- assert ((RC != dxil::ResourceClass::UAV || !MDResources.hasUAVs ()) &&
243
- " Old and new UAV representations can't coexist" );
244
-
245
238
StringRef Name (RBI.getName ());
246
239
StringRef Type (getRCName (RC));
247
240
StringRef Format (getFormatName (RTI));
@@ -252,21 +245,14 @@ static void prettyPrintResources(raw_ostream &OS, const DXILBindingMap &DBM,
252
245
OS << formatv (" ; {0,-30} {1,10} {2,7} {3,11} {4,7} {5,14} {6,9}\n " , Name,
253
246
Type, Format, Dim, ID, Bind, Count);
254
247
}
255
-
256
- if (MDResources.hasCBuffers ())
257
- MDResources.printCBuffers (OS);
258
- if (MDResources.hasUAVs ())
259
- MDResources.printUAVs (OS);
260
-
261
248
OS << " ;\n " ;
262
249
}
263
250
264
251
PreservedAnalyses DXILPrettyPrinterPass::run (Module &M,
265
252
ModuleAnalysisManager &MAM) {
266
253
const DXILBindingMap &DBM = MAM.getResult <DXILResourceBindingAnalysis>(M);
267
254
DXILResourceTypeMap &DRTM = MAM.getResult <DXILResourceTypeAnalysis>(M);
268
- const dxil::Resources &MDResources = MAM.getResult <DXILResourceMDAnalysis>(M);
269
- prettyPrintResources (OS, DBM, DRTM, MDResources);
255
+ prettyPrintResources (OS, DBM, DRTM);
270
256
return PreservedAnalyses::all ();
271
257
}
272
258
@@ -293,7 +279,6 @@ class DXILPrettyPrinterLegacy : public llvm::ModulePass {
293
279
AU.setPreservesAll ();
294
280
AU.addRequired <DXILResourceTypeWrapperPass>();
295
281
AU.addRequired <DXILResourceBindingWrapperPass>();
296
- AU.addRequired <DXILResourceMDWrapper>();
297
282
}
298
283
};
299
284
} // namespace
@@ -303,7 +288,6 @@ INITIALIZE_PASS_BEGIN(DXILPrettyPrinterLegacy, "dxil-pretty-printer",
303
288
" DXIL Metadata Pretty Printer" , true , true )
304
289
INITIALIZE_PASS_DEPENDENCY(DXILResourceTypeWrapperPass)
305
290
INITIALIZE_PASS_DEPENDENCY(DXILResourceBindingWrapperPass)
306
- INITIALIZE_PASS_DEPENDENCY(DXILResourceMDWrapper)
307
291
INITIALIZE_PASS_END(DXILPrettyPrinterLegacy, " dxil-pretty-printer" ,
308
292
" DXIL Metadata Pretty Printer" , true , true )
309
293
@@ -312,8 +296,7 @@ bool DXILPrettyPrinterLegacy::runOnModule(Module &M) {
312
296
getAnalysis<DXILResourceBindingWrapperPass>().getBindingMap ();
313
297
DXILResourceTypeMap &DRTM =
314
298
getAnalysis<DXILResourceTypeWrapperPass>().getResourceTypeMap ();
315
- dxil::Resources &Res = getAnalysis<DXILResourceMDWrapper>().getDXILResource ();
316
- prettyPrintResources (OS, DBM, DRTM, Res);
299
+ prettyPrintResources (OS, DBM, DRTM);
317
300
return false ;
318
301
}
319
302
0 commit comments