@@ -326,7 +326,7 @@ class ResourceTypeInfo {
326326
327327// ===----------------------------------------------------------------------===//
328328
329- class ResourceBindingInfo {
329+ class ResourceInfo {
330330public:
331331 struct ResourceBinding {
332332 uint32_t RecordID;
@@ -353,9 +353,9 @@ class ResourceBindingInfo {
353353 GlobalVariable *Symbol = nullptr ;
354354
355355public:
356- ResourceBindingInfo (uint32_t RecordID, uint32_t Space, uint32_t LowerBound,
357- uint32_t Size, TargetExtType *HandleTy,
358- GlobalVariable *Symbol = nullptr )
356+ ResourceInfo (uint32_t RecordID, uint32_t Space, uint32_t LowerBound,
357+ uint32_t Size, TargetExtType *HandleTy,
358+ GlobalVariable *Symbol = nullptr )
359359 : Binding{RecordID, Space, LowerBound, Size}, HandleTy(HandleTy),
360360 Symbol (Symbol) {}
361361
@@ -372,14 +372,12 @@ class ResourceBindingInfo {
372372 std::pair<uint32_t , uint32_t >
373373 getAnnotateProps (Module &M, dxil::ResourceTypeInfo &RTI) const ;
374374
375- bool operator ==(const ResourceBindingInfo &RHS) const {
375+ bool operator ==(const ResourceInfo &RHS) const {
376376 return std::tie (Binding, HandleTy, Symbol) ==
377377 std::tie (RHS.Binding , RHS.HandleTy , RHS.Symbol );
378378 }
379- bool operator !=(const ResourceBindingInfo &RHS) const {
380- return !(*this == RHS);
381- }
382- bool operator <(const ResourceBindingInfo &RHS) const {
379+ bool operator !=(const ResourceInfo &RHS) const { return !(*this == RHS); }
380+ bool operator <(const ResourceInfo &RHS) const {
383381 return Binding < RHS.Binding ;
384382 }
385383
@@ -440,8 +438,8 @@ ModulePass *createDXILResourceTypeWrapperPassPass();
440438
441439// ===----------------------------------------------------------------------===//
442440
443- class DXILBindingMap {
444- SmallVector<dxil::ResourceBindingInfo > Infos;
441+ class DXILResourceMap {
442+ SmallVector<dxil::ResourceInfo > Infos;
445443 DenseMap<CallInst *, unsigned > CallMap;
446444 unsigned FirstUAV = 0 ;
447445 unsigned FirstCBuffer = 0 ;
@@ -451,8 +449,8 @@ class DXILBindingMap {
451449 void populate (Module &M, DXILResourceTypeMap &DRTM);
452450
453451public:
454- using iterator = SmallVector<dxil::ResourceBindingInfo >::iterator;
455- using const_iterator = SmallVector<dxil::ResourceBindingInfo >::const_iterator;
452+ using iterator = SmallVector<dxil::ResourceInfo >::iterator;
453+ using const_iterator = SmallVector<dxil::ResourceInfo >::const_iterator;
456454
457455 iterator begin () { return Infos.begin (); }
458456 const_iterator begin () const { return Infos.begin (); }
@@ -466,12 +464,12 @@ class DXILBindingMap {
466464 return Pos == CallMap.end () ? Infos.end () : (Infos.begin () + Pos->second );
467465 }
468466
469- // / Resolves a resource handle into a vector of ResourceBindingInfos that
467+ // / Resolves a resource handle into a vector of ResourceInfos that
470468 // / represent the possible unique creations of the handle. Certain cases are
471469 // / ambiguous so multiple creation instructions may be returned. The resulting
472- // / ResourceBindingInfo can be used to depuplicate unique handles that
470+ // / ResourceInfo can be used to depuplicate unique handles that
473471 // / reference the same resource
474- SmallVector<dxil::ResourceBindingInfo > findByUse (const Value *Key) const ;
472+ SmallVector<dxil::ResourceInfo > findByUse (const Value *Key) const ;
475473
476474 const_iterator find (const CallInst *Key) const {
477475 auto Pos = CallMap.find (Key);
@@ -521,48 +519,46 @@ class DXILBindingMap {
521519 void print (raw_ostream &OS, DXILResourceTypeMap &DRTM,
522520 const DataLayout &DL) const ;
523521
524- friend class DXILResourceBindingAnalysis ;
525- friend class DXILResourceBindingWrapperPass ;
522+ friend class DXILResourceAnalysis ;
523+ friend class DXILResourceWrapperPass ;
526524};
527525
528- class DXILResourceBindingAnalysis
529- : public AnalysisInfoMixin<DXILResourceBindingAnalysis> {
530- friend AnalysisInfoMixin<DXILResourceBindingAnalysis>;
526+ class DXILResourceAnalysis : public AnalysisInfoMixin <DXILResourceAnalysis> {
527+ friend AnalysisInfoMixin<DXILResourceAnalysis>;
531528
532529 static AnalysisKey Key;
533530
534531public:
535- using Result = DXILBindingMap ;
532+ using Result = DXILResourceMap ;
536533
537534 // / Gather resource info for the module \c M.
538- DXILBindingMap run (Module &M, ModuleAnalysisManager &AM);
535+ DXILResourceMap run (Module &M, ModuleAnalysisManager &AM);
539536};
540537
541- // / Printer pass for the \c DXILResourceBindingAnalysis results.
542- class DXILResourceBindingPrinterPass
543- : public PassInfoMixin<DXILResourceBindingPrinterPass> {
538+ // / Printer pass for the \c DXILResourceAnalysis results.
539+ class DXILResourcePrinterPass : public PassInfoMixin <DXILResourcePrinterPass> {
544540 raw_ostream &OS;
545541
546542public:
547- explicit DXILResourceBindingPrinterPass (raw_ostream &OS) : OS(OS) {}
543+ explicit DXILResourcePrinterPass (raw_ostream &OS) : OS(OS) {}
548544
549545 PreservedAnalyses run (Module &M, ModuleAnalysisManager &AM);
550546
551547 static bool isRequired () { return true ; }
552548};
553549
554- class DXILResourceBindingWrapperPass : public ModulePass {
555- std::unique_ptr<DXILBindingMap > Map;
550+ class DXILResourceWrapperPass : public ModulePass {
551+ std::unique_ptr<DXILResourceMap > Map;
556552 DXILResourceTypeMap *DRTM;
557553
558554public:
559555 static char ID; // Class identification, replacement for typeinfo
560556
561- DXILResourceBindingWrapperPass ();
562- ~DXILResourceBindingWrapperPass () override ;
557+ DXILResourceWrapperPass ();
558+ ~DXILResourceWrapperPass () override ;
563559
564- const DXILBindingMap &getBindingMap () const { return *Map; }
565- DXILBindingMap &getBindingMap () { return *Map; }
560+ const DXILResourceMap &getBindingMap () const { return *Map; }
561+ DXILResourceMap &getBindingMap () { return *Map; }
566562
567563 void getAnalysisUsage (AnalysisUsage &AU) const override ;
568564 bool runOnModule (Module &M) override ;
@@ -572,7 +568,7 @@ class DXILResourceBindingWrapperPass : public ModulePass {
572568 void dump () const ;
573569};
574570
575- ModulePass *createDXILResourceBindingWrapperPassPass ();
571+ ModulePass *createDXILResourceWrapperPassPass ();
576572
577573} // namespace llvm
578574
0 commit comments