77// ===----------------------------------------------------------------------===//
88
99#include " DXILPrettyPrinter.h"
10- #include " DXILResourceAnalysis.h"
1110#include " DirectX.h"
1211#include " llvm/ADT/StringRef.h"
1312#include " llvm/Analysis/DXILResource.h"
@@ -222,8 +221,7 @@ struct FormatBindingSize
222221} // namespace
223222
224223static void prettyPrintResources (raw_ostream &OS, const DXILBindingMap &DBM,
225- DXILResourceTypeMap &DRTM,
226- const dxil::Resources &MDResources) {
224+ DXILResourceTypeMap &DRTM) {
227225 // Column widths are arbitrary but match the widths DXC uses.
228226 OS << " ;\n ; Resource Bindings:\n ;\n " ;
229227 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,
237235 const dxil::ResourceTypeInfo &RTI = DRTM[RBI.getHandleTy ()];
238236
239237 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-
245238 StringRef Name (RBI.getName ());
246239 StringRef Type (getRCName (RC));
247240 StringRef Format (getFormatName (RTI));
@@ -252,21 +245,14 @@ static void prettyPrintResources(raw_ostream &OS, const DXILBindingMap &DBM,
252245 OS << formatv (" ; {0,-30} {1,10} {2,7} {3,11} {4,7} {5,14} {6,9}\n " , Name,
253246 Type, Format, Dim, ID, Bind, Count);
254247 }
255-
256- if (MDResources.hasCBuffers ())
257- MDResources.printCBuffers (OS);
258- if (MDResources.hasUAVs ())
259- MDResources.printUAVs (OS);
260-
261248 OS << " ;\n " ;
262249}
263250
264251PreservedAnalyses DXILPrettyPrinterPass::run (Module &M,
265252 ModuleAnalysisManager &MAM) {
266253 const DXILBindingMap &DBM = MAM.getResult <DXILResourceBindingAnalysis>(M);
267254 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);
270256 return PreservedAnalyses::all ();
271257}
272258
@@ -293,7 +279,6 @@ class DXILPrettyPrinterLegacy : public llvm::ModulePass {
293279 AU.setPreservesAll ();
294280 AU.addRequired <DXILResourceTypeWrapperPass>();
295281 AU.addRequired <DXILResourceBindingWrapperPass>();
296- AU.addRequired <DXILResourceMDWrapper>();
297282 }
298283};
299284} // namespace
@@ -303,7 +288,6 @@ INITIALIZE_PASS_BEGIN(DXILPrettyPrinterLegacy, "dxil-pretty-printer",
303288 " DXIL Metadata Pretty Printer" , true , true )
304289INITIALIZE_PASS_DEPENDENCY(DXILResourceTypeWrapperPass)
305290INITIALIZE_PASS_DEPENDENCY(DXILResourceBindingWrapperPass)
306- INITIALIZE_PASS_DEPENDENCY(DXILResourceMDWrapper)
307291INITIALIZE_PASS_END(DXILPrettyPrinterLegacy, " dxil-pretty-printer" ,
308292 " DXIL Metadata Pretty Printer" , true , true )
309293
@@ -312,8 +296,7 @@ bool DXILPrettyPrinterLegacy::runOnModule(Module &M) {
312296 getAnalysis<DXILResourceBindingWrapperPass>().getBindingMap ();
313297 DXILResourceTypeMap &DRTM =
314298 getAnalysis<DXILResourceTypeWrapperPass>().getResourceTypeMap ();
315- dxil::Resources &Res = getAnalysis<DXILResourceMDWrapper>().getDXILResource ();
316- prettyPrintResources (OS, DBM, DRTM, Res);
299+ prettyPrintResources (OS, DBM, DRTM);
317300 return false ;
318301}
319302
0 commit comments