22
22
// the Coroutine library.
23
23
// ===----------------------------------------------------------------------===//
24
24
25
- #ifndef LLVM_LIB_TRANSFORMS_COROUTINES_COROINSTR_H
26
- #define LLVM_LIB_TRANSFORMS_COROUTINES_COROINSTR_H
25
+ #ifndef LLVM_TRANSFORMS_COROUTINES_COROINSTR_H
26
+ #define LLVM_TRANSFORMS_COROUTINES_COROINSTR_H
27
27
28
28
#include " llvm/IR/GlobalVariable.h"
29
29
#include " llvm/IR/IntrinsicInst.h"
32
32
namespace llvm {
33
33
34
34
// / This class represents the llvm.coro.subfn.addr instruction.
35
- class LLVM_LIBRARY_VISIBILITY CoroSubFnInst : public IntrinsicInst {
35
+ class CoroSubFnInst : public IntrinsicInst {
36
36
enum { FrameArg, IndexArg };
37
37
38
38
public:
@@ -67,7 +67,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSubFnInst : public IntrinsicInst {
67
67
};
68
68
69
69
// / This represents the llvm.coro.alloc instruction.
70
- class LLVM_LIBRARY_VISIBILITY CoroAllocInst : public IntrinsicInst {
70
+ class CoroAllocInst : public IntrinsicInst {
71
71
public:
72
72
// Methods to support type inquiry through isa, cast, and dyn_cast:
73
73
static bool classof (const IntrinsicInst *I) {
@@ -82,7 +82,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAllocInst : public IntrinsicInst {
82
82
// FIXME: add callback metadata
83
83
// FIXME: make a proper IntrinisicInst. Currently this is not possible,
84
84
// because llvm.coro.await.suspend.* can be invoked.
85
- class LLVM_LIBRARY_VISIBILITY CoroAwaitSuspendInst : public CallBase {
85
+ class CoroAwaitSuspendInst : public CallBase {
86
86
enum { AwaiterArg, FrameArg, WrapperArg };
87
87
88
88
public:
@@ -112,7 +112,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAwaitSuspendInst : public CallBase {
112
112
};
113
113
114
114
// / This represents a common base class for llvm.coro.id instructions.
115
- class LLVM_LIBRARY_VISIBILITY AnyCoroIdInst : public IntrinsicInst {
115
+ class AnyCoroIdInst : public IntrinsicInst {
116
116
public:
117
117
CoroAllocInst *getCoroAlloc () {
118
118
for (User *U : users ())
@@ -143,7 +143,7 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroIdInst : public IntrinsicInst {
143
143
};
144
144
145
145
// / This represents the llvm.coro.id instruction.
146
- class LLVM_LIBRARY_VISIBILITY CoroIdInst : public AnyCoroIdInst {
146
+ class CoroIdInst : public AnyCoroIdInst {
147
147
enum { AlignArg, PromiseArg, CoroutineArg, InfoArg };
148
148
149
149
public:
@@ -232,7 +232,7 @@ class LLVM_LIBRARY_VISIBILITY CoroIdInst : public AnyCoroIdInst {
232
232
233
233
// / This represents either the llvm.coro.id.retcon or
234
234
// / llvm.coro.id.retcon.once instruction.
235
- class LLVM_LIBRARY_VISIBILITY AnyCoroIdRetconInst : public AnyCoroIdInst {
235
+ class AnyCoroIdRetconInst : public AnyCoroIdInst {
236
236
enum { SizeArg, AlignArg, StorageArg, PrototypeArg, AllocArg, DeallocArg };
237
237
238
238
public:
@@ -246,9 +246,7 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroIdRetconInst : public AnyCoroIdInst {
246
246
return cast<ConstantInt>(getArgOperand (AlignArg))->getAlignValue ();
247
247
}
248
248
249
- Value *getStorage () const {
250
- return getArgOperand (StorageArg);
251
- }
249
+ Value *getStorage () const { return getArgOperand (StorageArg); }
252
250
253
251
// / Return the prototype for the continuation function. The type,
254
252
// / attributes, and calling convention of the continuation function(s)
@@ -270,17 +268,16 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroIdRetconInst : public AnyCoroIdInst {
270
268
// Methods to support type inquiry through isa, cast, and dyn_cast:
271
269
static bool classof (const IntrinsicInst *I) {
272
270
auto ID = I->getIntrinsicID ();
273
- return ID == Intrinsic::coro_id_retcon
274
- || ID == Intrinsic::coro_id_retcon_once;
271
+ return ID == Intrinsic::coro_id_retcon ||
272
+ ID == Intrinsic::coro_id_retcon_once;
275
273
}
276
274
static bool classof (const Value *V) {
277
275
return isa<IntrinsicInst>(V) && classof (cast<IntrinsicInst>(V));
278
276
}
279
277
};
280
278
281
279
// / This represents the llvm.coro.id.retcon instruction.
282
- class LLVM_LIBRARY_VISIBILITY CoroIdRetconInst
283
- : public AnyCoroIdRetconInst {
280
+ class CoroIdRetconInst : public AnyCoroIdRetconInst {
284
281
public:
285
282
// Methods to support type inquiry through isa, cast, and dyn_cast:
286
283
static bool classof (const IntrinsicInst *I) {
@@ -292,8 +289,7 @@ class LLVM_LIBRARY_VISIBILITY CoroIdRetconInst
292
289
};
293
290
294
291
// / This represents the llvm.coro.id.retcon.once instruction.
295
- class LLVM_LIBRARY_VISIBILITY CoroIdRetconOnceInst
296
- : public AnyCoroIdRetconInst {
292
+ class CoroIdRetconOnceInst : public AnyCoroIdRetconInst {
297
293
public:
298
294
// Methods to support type inquiry through isa, cast, and dyn_cast:
299
295
static bool classof (const IntrinsicInst *I) {
@@ -305,7 +301,7 @@ class LLVM_LIBRARY_VISIBILITY CoroIdRetconOnceInst
305
301
};
306
302
307
303
// / This represents the llvm.coro.id.async instruction.
308
- class LLVM_LIBRARY_VISIBILITY CoroIdAsyncInst : public AnyCoroIdInst {
304
+ class CoroIdAsyncInst : public AnyCoroIdInst {
309
305
enum { SizeArg, AlignArg, StorageArg, AsyncFuncPtrArg };
310
306
311
307
public:
@@ -356,7 +352,7 @@ class LLVM_LIBRARY_VISIBILITY CoroIdAsyncInst : public AnyCoroIdInst {
356
352
};
357
353
358
354
// / This represents the llvm.coro.context.alloc instruction.
359
- class LLVM_LIBRARY_VISIBILITY CoroAsyncContextAllocInst : public IntrinsicInst {
355
+ class CoroAsyncContextAllocInst : public IntrinsicInst {
360
356
enum { AsyncFuncPtrArg };
361
357
362
358
public:
@@ -375,8 +371,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncContextAllocInst : public IntrinsicInst {
375
371
};
376
372
377
373
// / This represents the llvm.coro.context.dealloc instruction.
378
- class LLVM_LIBRARY_VISIBILITY CoroAsyncContextDeallocInst
379
- : public IntrinsicInst {
374
+ class CoroAsyncContextDeallocInst : public IntrinsicInst {
380
375
enum { AsyncContextArg };
381
376
382
377
public:
@@ -396,7 +391,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncContextDeallocInst
396
391
// / This represents the llvm.coro.async.resume instruction.
397
392
// / During lowering this is replaced by the resume function of a suspend point
398
393
// / (the continuation function).
399
- class LLVM_LIBRARY_VISIBILITY CoroAsyncResumeInst : public IntrinsicInst {
394
+ class CoroAsyncResumeInst : public IntrinsicInst {
400
395
public:
401
396
// Methods to support type inquiry through isa, cast, and dyn_cast:
402
397
static bool classof (const IntrinsicInst *I) {
@@ -408,7 +403,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncResumeInst : public IntrinsicInst {
408
403
};
409
404
410
405
// / This represents the llvm.coro.async.size.replace instruction.
411
- class LLVM_LIBRARY_VISIBILITY CoroAsyncSizeReplace : public IntrinsicInst {
406
+ class CoroAsyncSizeReplace : public IntrinsicInst {
412
407
public:
413
408
// Methods to support type inquiry through isa, cast, and dyn_cast:
414
409
static bool classof (const IntrinsicInst *I) {
@@ -420,7 +415,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncSizeReplace : public IntrinsicInst {
420
415
};
421
416
422
417
// / This represents the llvm.coro.frame instruction.
423
- class LLVM_LIBRARY_VISIBILITY CoroFrameInst : public IntrinsicInst {
418
+ class CoroFrameInst : public IntrinsicInst {
424
419
public:
425
420
// Methods to support type inquiry through isa, cast, and dyn_cast:
426
421
static bool classof (const IntrinsicInst *I) {
@@ -432,7 +427,7 @@ class LLVM_LIBRARY_VISIBILITY CoroFrameInst : public IntrinsicInst {
432
427
};
433
428
434
429
// / This represents the llvm.coro.free instruction.
435
- class LLVM_LIBRARY_VISIBILITY CoroFreeInst : public IntrinsicInst {
430
+ class CoroFreeInst : public IntrinsicInst {
436
431
enum { IdArg, FrameArg };
437
432
438
433
public:
@@ -447,8 +442,8 @@ class LLVM_LIBRARY_VISIBILITY CoroFreeInst : public IntrinsicInst {
447
442
}
448
443
};
449
444
450
- // / This class represents the llvm.coro.begin instruction .
451
- class LLVM_LIBRARY_VISIBILITY CoroBeginInst : public IntrinsicInst {
445
+ // / This class represents the llvm.coro.begin instructions .
446
+ class CoroBeginInst : public IntrinsicInst {
452
447
enum { IdArg, MemArg };
453
448
454
449
public:
@@ -468,7 +463,7 @@ class LLVM_LIBRARY_VISIBILITY CoroBeginInst : public IntrinsicInst {
468
463
};
469
464
470
465
// / This represents the llvm.coro.save instruction.
471
- class LLVM_LIBRARY_VISIBILITY CoroSaveInst : public IntrinsicInst {
466
+ class CoroSaveInst : public IntrinsicInst {
472
467
public:
473
468
// Methods to support type inquiry through isa, cast, and dyn_cast:
474
469
static bool classof (const IntrinsicInst *I) {
@@ -480,7 +475,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSaveInst : public IntrinsicInst {
480
475
};
481
476
482
477
// / This represents the llvm.coro.promise instruction.
483
- class LLVM_LIBRARY_VISIBILITY CoroPromiseInst : public IntrinsicInst {
478
+ class CoroPromiseInst : public IntrinsicInst {
484
479
enum { FrameArg, AlignArg, FromArg };
485
480
486
481
public:
@@ -505,7 +500,7 @@ class LLVM_LIBRARY_VISIBILITY CoroPromiseInst : public IntrinsicInst {
505
500
}
506
501
};
507
502
508
- class LLVM_LIBRARY_VISIBILITY AnyCoroSuspendInst : public IntrinsicInst {
503
+ class AnyCoroSuspendInst : public IntrinsicInst {
509
504
public:
510
505
CoroSaveInst *getCoroSave () const ;
511
506
@@ -521,7 +516,7 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroSuspendInst : public IntrinsicInst {
521
516
};
522
517
523
518
// / This represents the llvm.coro.suspend instruction.
524
- class LLVM_LIBRARY_VISIBILITY CoroSuspendInst : public AnyCoroSuspendInst {
519
+ class CoroSuspendInst : public AnyCoroSuspendInst {
525
520
enum { SaveArg, FinalArg };
526
521
527
522
public:
@@ -553,7 +548,7 @@ inline CoroSaveInst *AnyCoroSuspendInst::getCoroSave() const {
553
548
}
554
549
555
550
// / This represents the llvm.coro.suspend.async instruction.
556
- class LLVM_LIBRARY_VISIBILITY CoroSuspendAsyncInst : public AnyCoroSuspendInst {
551
+ class CoroSuspendAsyncInst : public AnyCoroSuspendInst {
557
552
public:
558
553
enum {
559
554
StorageArgNoArg,
@@ -594,7 +589,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSuspendAsyncInst : public AnyCoroSuspendInst {
594
589
};
595
590
596
591
// / This represents the llvm.coro.suspend.retcon instruction.
597
- class LLVM_LIBRARY_VISIBILITY CoroSuspendRetconInst : public AnyCoroSuspendInst {
592
+ class CoroSuspendRetconInst : public AnyCoroSuspendInst {
598
593
public:
599
594
op_iterator value_begin () { return arg_begin (); }
600
595
const_op_iterator value_begin () const { return arg_begin (); }
@@ -619,7 +614,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSuspendRetconInst : public AnyCoroSuspendInst
619
614
};
620
615
621
616
// / This represents the llvm.coro.size instruction.
622
- class LLVM_LIBRARY_VISIBILITY CoroSizeInst : public IntrinsicInst {
617
+ class CoroSizeInst : public IntrinsicInst {
623
618
public:
624
619
// Methods to support type inquiry through isa, cast, and dyn_cast:
625
620
static bool classof (const IntrinsicInst *I) {
@@ -631,7 +626,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSizeInst : public IntrinsicInst {
631
626
};
632
627
633
628
// / This represents the llvm.coro.align instruction.
634
- class LLVM_LIBRARY_VISIBILITY CoroAlignInst : public IntrinsicInst {
629
+ class CoroAlignInst : public IntrinsicInst {
635
630
public:
636
631
// Methods to support type inquiry through isa, cast, and dyn_cast:
637
632
static bool classof (const IntrinsicInst *I) {
@@ -643,7 +638,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAlignInst : public IntrinsicInst {
643
638
};
644
639
645
640
// / This represents the llvm.end.results instruction.
646
- class LLVM_LIBRARY_VISIBILITY CoroEndResults : public IntrinsicInst {
641
+ class CoroEndResults : public IntrinsicInst {
647
642
public:
648
643
op_iterator retval_begin () { return arg_begin (); }
649
644
const_op_iterator retval_begin () const { return arg_begin (); }
@@ -671,7 +666,7 @@ class LLVM_LIBRARY_VISIBILITY CoroEndResults : public IntrinsicInst {
671
666
}
672
667
};
673
668
674
- class LLVM_LIBRARY_VISIBILITY AnyCoroEndInst : public IntrinsicInst {
669
+ class AnyCoroEndInst : public IntrinsicInst {
675
670
enum { FrameArg, UnwindArg, TokenArg };
676
671
677
672
public:
@@ -700,7 +695,7 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroEndInst : public IntrinsicInst {
700
695
};
701
696
702
697
// / This represents the llvm.coro.end instruction.
703
- class LLVM_LIBRARY_VISIBILITY CoroEndInst : public AnyCoroEndInst {
698
+ class CoroEndInst : public AnyCoroEndInst {
704
699
public:
705
700
// Methods to support type inquiry through isa, cast, and dyn_cast:
706
701
static bool classof (const IntrinsicInst *I) {
@@ -712,7 +707,7 @@ class LLVM_LIBRARY_VISIBILITY CoroEndInst : public AnyCoroEndInst {
712
707
};
713
708
714
709
// / This represents the llvm.coro.end instruction.
715
- class LLVM_LIBRARY_VISIBILITY CoroAsyncEndInst : public AnyCoroEndInst {
710
+ class CoroAsyncEndInst : public AnyCoroEndInst {
716
711
enum { FrameArg, UnwindArg, MustTailCallFuncArg };
717
712
718
713
public:
@@ -736,12 +731,11 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncEndInst : public AnyCoroEndInst {
736
731
};
737
732
738
733
// / This represents the llvm.coro.alloca.alloc instruction.
739
- class LLVM_LIBRARY_VISIBILITY CoroAllocaAllocInst : public IntrinsicInst {
734
+ class CoroAllocaAllocInst : public IntrinsicInst {
740
735
enum { SizeArg, AlignArg };
736
+
741
737
public:
742
- Value *getSize () const {
743
- return getArgOperand (SizeArg);
744
- }
738
+ Value *getSize () const { return getArgOperand (SizeArg); }
745
739
Align getAlignment () const {
746
740
return cast<ConstantInt>(getArgOperand (AlignArg))->getAlignValue ();
747
741
}
@@ -756,8 +750,9 @@ class LLVM_LIBRARY_VISIBILITY CoroAllocaAllocInst : public IntrinsicInst {
756
750
};
757
751
758
752
// / This represents the llvm.coro.alloca.get instruction.
759
- class LLVM_LIBRARY_VISIBILITY CoroAllocaGetInst : public IntrinsicInst {
753
+ class CoroAllocaGetInst : public IntrinsicInst {
760
754
enum { AllocArg };
755
+
761
756
public:
762
757
CoroAllocaAllocInst *getAlloc () const {
763
758
return cast<CoroAllocaAllocInst>(getArgOperand (AllocArg));
@@ -773,8 +768,9 @@ class LLVM_LIBRARY_VISIBILITY CoroAllocaGetInst : public IntrinsicInst {
773
768
};
774
769
775
770
// / This represents the llvm.coro.alloca.free instruction.
776
- class LLVM_LIBRARY_VISIBILITY CoroAllocaFreeInst : public IntrinsicInst {
771
+ class CoroAllocaFreeInst : public IntrinsicInst {
777
772
enum { AllocArg };
773
+
778
774
public:
779
775
CoroAllocaAllocInst *getAlloc () const {
780
776
return cast<CoroAllocaAllocInst>(getArgOperand (AllocArg));
@@ -791,4 +787,4 @@ class LLVM_LIBRARY_VISIBILITY CoroAllocaFreeInst : public IntrinsicInst {
791
787
792
788
} // End namespace llvm.
793
789
794
- #endif
790
+ #endif // LLVM_TRANSFORMS_COROUTINES_COROINSTR_H
0 commit comments