File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -616,3 +616,28 @@ unsigned EnumPayload::getAllocSizeInBits(const llvm::DataLayout &DL) const {
616616 }
617617 return size;
618618}
619+
620+ void EnumPayload::print (llvm::raw_ostream &OS) {
621+ if (StorageType) {
622+ OS << " storage-type: " ;
623+ StorageType->print (OS);
624+ OS << ' \n ' ;
625+ }
626+ for (LazyValue pv : PayloadValues) {
627+ if (auto *v = pv.dyn_cast <llvm::Value*>()) {
628+ OS << " value: " ;
629+ v->print (OS);
630+ OS << ' \n ' ;
631+ } else {
632+ auto *t = pv.get <llvm::Type*>();
633+ OS << " type: " ;
634+ t->print (OS);
635+ OS << ' \n ' ;
636+ }
637+ }
638+ }
639+
640+ void EnumPayload::dump () {
641+ print (llvm::errs ());
642+ }
643+
Original file line number Diff line number Diff line change @@ -174,6 +174,10 @@ class EnumPayload {
174174 const SpareBitVector &spareBits,
175175 unsigned firstBitOffset,
176176 unsigned bitWidth) const ;
177+
178+ void print (llvm::raw_ostream &OS);
179+ void dump ();
180+
177181private:
178182 // / Calculate the total number of bits this payload requires.
179183 // / This will always be a multiple of 8.
You can’t perform that action at this time.
0 commit comments