@@ -326,7 +326,7 @@ class ResourceTypeInfo {
326
326
327
327
// ===----------------------------------------------------------------------===//
328
328
329
- class ResourceBindingInfo {
329
+ class ResourceInfo {
330
330
public:
331
331
struct ResourceBinding {
332
332
uint32_t RecordID;
@@ -353,9 +353,9 @@ class ResourceBindingInfo {
353
353
GlobalVariable *Symbol = nullptr ;
354
354
355
355
public:
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 )
359
359
: Binding{RecordID, Space, LowerBound, Size}, HandleTy(HandleTy),
360
360
Symbol (Symbol) {}
361
361
@@ -372,14 +372,12 @@ class ResourceBindingInfo {
372
372
std::pair<uint32_t , uint32_t >
373
373
getAnnotateProps (Module &M, dxil::ResourceTypeInfo &RTI) const ;
374
374
375
- bool operator ==(const ResourceBindingInfo &RHS) const {
375
+ bool operator ==(const ResourceInfo &RHS) const {
376
376
return std::tie (Binding, HandleTy, Symbol) ==
377
377
std::tie (RHS.Binding , RHS.HandleTy , RHS.Symbol );
378
378
}
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 {
383
381
return Binding < RHS.Binding ;
384
382
}
385
383
@@ -440,8 +438,8 @@ ModulePass *createDXILResourceTypeWrapperPassPass();
440
438
441
439
// ===----------------------------------------------------------------------===//
442
440
443
- class DXILBindingMap {
444
- SmallVector<dxil::ResourceBindingInfo > Infos;
441
+ class DXILResourceMap {
442
+ SmallVector<dxil::ResourceInfo > Infos;
445
443
DenseMap<CallInst *, unsigned > CallMap;
446
444
unsigned FirstUAV = 0 ;
447
445
unsigned FirstCBuffer = 0 ;
@@ -451,8 +449,8 @@ class DXILBindingMap {
451
449
void populate (Module &M, DXILResourceTypeMap &DRTM);
452
450
453
451
public:
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;
456
454
457
455
iterator begin () { return Infos.begin (); }
458
456
const_iterator begin () const { return Infos.begin (); }
@@ -466,12 +464,12 @@ class DXILBindingMap {
466
464
return Pos == CallMap.end () ? Infos.end () : (Infos.begin () + Pos->second );
467
465
}
468
466
469
- // / Resolves a resource handle into a vector of ResourceBindingInfos that
467
+ // / Resolves a resource handle into a vector of ResourceInfos that
470
468
// / represent the possible unique creations of the handle. Certain cases are
471
469
// / 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
473
471
// / reference the same resource
474
- SmallVector<dxil::ResourceBindingInfo > findByUse (const Value *Key) const ;
472
+ SmallVector<dxil::ResourceInfo > findByUse (const Value *Key) const ;
475
473
476
474
const_iterator find (const CallInst *Key) const {
477
475
auto Pos = CallMap.find (Key);
@@ -521,48 +519,46 @@ class DXILBindingMap {
521
519
void print (raw_ostream &OS, DXILResourceTypeMap &DRTM,
522
520
const DataLayout &DL) const ;
523
521
524
- friend class DXILResourceBindingAnalysis ;
525
- friend class DXILResourceBindingWrapperPass ;
522
+ friend class DXILResourceAnalysis ;
523
+ friend class DXILResourceWrapperPass ;
526
524
};
527
525
528
- class DXILResourceBindingAnalysis
529
- : public AnalysisInfoMixin<DXILResourceBindingAnalysis> {
530
- friend AnalysisInfoMixin<DXILResourceBindingAnalysis>;
526
+ class DXILResourceAnalysis : public AnalysisInfoMixin <DXILResourceAnalysis> {
527
+ friend AnalysisInfoMixin<DXILResourceAnalysis>;
531
528
532
529
static AnalysisKey Key;
533
530
534
531
public:
535
- using Result = DXILBindingMap ;
532
+ using Result = DXILResourceMap ;
536
533
537
534
// / Gather resource info for the module \c M.
538
- DXILBindingMap run (Module &M, ModuleAnalysisManager &AM);
535
+ DXILResourceMap run (Module &M, ModuleAnalysisManager &AM);
539
536
};
540
537
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> {
544
540
raw_ostream &OS;
545
541
546
542
public:
547
- explicit DXILResourceBindingPrinterPass (raw_ostream &OS) : OS(OS) {}
543
+ explicit DXILResourcePrinterPass (raw_ostream &OS) : OS(OS) {}
548
544
549
545
PreservedAnalyses run (Module &M, ModuleAnalysisManager &AM);
550
546
551
547
static bool isRequired () { return true ; }
552
548
};
553
549
554
- class DXILResourceBindingWrapperPass : public ModulePass {
555
- std::unique_ptr<DXILBindingMap > Map;
550
+ class DXILResourceWrapperPass : public ModulePass {
551
+ std::unique_ptr<DXILResourceMap > Map;
556
552
DXILResourceTypeMap *DRTM;
557
553
558
554
public:
559
555
static char ID; // Class identification, replacement for typeinfo
560
556
561
- DXILResourceBindingWrapperPass ();
562
- ~DXILResourceBindingWrapperPass () override ;
557
+ DXILResourceWrapperPass ();
558
+ ~DXILResourceWrapperPass () override ;
563
559
564
- const DXILBindingMap &getBindingMap () const { return *Map; }
565
- DXILBindingMap &getBindingMap () { return *Map; }
560
+ const DXILResourceMap &getBindingMap () const { return *Map; }
561
+ DXILResourceMap &getBindingMap () { return *Map; }
566
562
567
563
void getAnalysisUsage (AnalysisUsage &AU) const override ;
568
564
bool runOnModule (Module &M) override ;
@@ -572,7 +568,7 @@ class DXILResourceBindingWrapperPass : public ModulePass {
572
568
void dump () const ;
573
569
};
574
570
575
- ModulePass *createDXILResourceBindingWrapperPassPass ();
571
+ ModulePass *createDXILResourceWrapperPassPass ();
576
572
577
573
} // namespace llvm
578
574
0 commit comments