2222// the Coroutine library.
2323// ===----------------------------------------------------------------------===//
2424
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
2727
2828#include " llvm/IR/GlobalVariable.h"
2929#include " llvm/IR/IntrinsicInst.h"
3232namespace llvm {
3333
3434// / This class represents the llvm.coro.subfn.addr instruction.
35- class LLVM_LIBRARY_VISIBILITY CoroSubFnInst : public IntrinsicInst {
35+ class CoroSubFnInst : public IntrinsicInst {
3636 enum { FrameArg, IndexArg };
3737
3838public:
@@ -67,7 +67,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSubFnInst : public IntrinsicInst {
6767};
6868
6969// / This represents the llvm.coro.alloc instruction.
70- class LLVM_LIBRARY_VISIBILITY CoroAllocInst : public IntrinsicInst {
70+ class CoroAllocInst : public IntrinsicInst {
7171public:
7272 // Methods to support type inquiry through isa, cast, and dyn_cast:
7373 static bool classof (const IntrinsicInst *I) {
@@ -82,7 +82,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAllocInst : public IntrinsicInst {
8282// FIXME: add callback metadata
8383// FIXME: make a proper IntrinisicInst. Currently this is not possible,
8484// because llvm.coro.await.suspend.* can be invoked.
85- class LLVM_LIBRARY_VISIBILITY CoroAwaitSuspendInst : public CallBase {
85+ class CoroAwaitSuspendInst : public CallBase {
8686 enum { AwaiterArg, FrameArg, WrapperArg };
8787
8888public:
@@ -112,7 +112,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAwaitSuspendInst : public CallBase {
112112};
113113
114114// / This represents a common base class for llvm.coro.id instructions.
115- class LLVM_LIBRARY_VISIBILITY AnyCoroIdInst : public IntrinsicInst {
115+ class AnyCoroIdInst : public IntrinsicInst {
116116public:
117117 CoroAllocInst *getCoroAlloc () {
118118 for (User *U : users ())
@@ -143,7 +143,7 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroIdInst : public IntrinsicInst {
143143};
144144
145145// / This represents the llvm.coro.id instruction.
146- class LLVM_LIBRARY_VISIBILITY CoroIdInst : public AnyCoroIdInst {
146+ class CoroIdInst : public AnyCoroIdInst {
147147 enum { AlignArg, PromiseArg, CoroutineArg, InfoArg };
148148
149149public:
@@ -232,7 +232,7 @@ class LLVM_LIBRARY_VISIBILITY CoroIdInst : public AnyCoroIdInst {
232232
233233// / This represents either the llvm.coro.id.retcon or
234234// / llvm.coro.id.retcon.once instruction.
235- class LLVM_LIBRARY_VISIBILITY AnyCoroIdRetconInst : public AnyCoroIdInst {
235+ class AnyCoroIdRetconInst : public AnyCoroIdInst {
236236 enum { SizeArg, AlignArg, StorageArg, PrototypeArg, AllocArg, DeallocArg };
237237
238238public:
@@ -246,9 +246,7 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroIdRetconInst : public AnyCoroIdInst {
246246 return cast<ConstantInt>(getArgOperand (AlignArg))->getAlignValue ();
247247 }
248248
249- Value *getStorage () const {
250- return getArgOperand (StorageArg);
251- }
249+ Value *getStorage () const { return getArgOperand (StorageArg); }
252250
253251 // / Return the prototype for the continuation function. The type,
254252 // / attributes, and calling convention of the continuation function(s)
@@ -270,17 +268,16 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroIdRetconInst : public AnyCoroIdInst {
270268 // Methods to support type inquiry through isa, cast, and dyn_cast:
271269 static bool classof (const IntrinsicInst *I) {
272270 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;
275273 }
276274 static bool classof (const Value *V) {
277275 return isa<IntrinsicInst>(V) && classof (cast<IntrinsicInst>(V));
278276 }
279277};
280278
281279// / This represents the llvm.coro.id.retcon instruction.
282- class LLVM_LIBRARY_VISIBILITY CoroIdRetconInst
283- : public AnyCoroIdRetconInst {
280+ class CoroIdRetconInst : public AnyCoroIdRetconInst {
284281public:
285282 // Methods to support type inquiry through isa, cast, and dyn_cast:
286283 static bool classof (const IntrinsicInst *I) {
@@ -292,8 +289,7 @@ class LLVM_LIBRARY_VISIBILITY CoroIdRetconInst
292289};
293290
294291// / This represents the llvm.coro.id.retcon.once instruction.
295- class LLVM_LIBRARY_VISIBILITY CoroIdRetconOnceInst
296- : public AnyCoroIdRetconInst {
292+ class CoroIdRetconOnceInst : public AnyCoroIdRetconInst {
297293public:
298294 // Methods to support type inquiry through isa, cast, and dyn_cast:
299295 static bool classof (const IntrinsicInst *I) {
@@ -305,7 +301,7 @@ class LLVM_LIBRARY_VISIBILITY CoroIdRetconOnceInst
305301};
306302
307303// / This represents the llvm.coro.id.async instruction.
308- class LLVM_LIBRARY_VISIBILITY CoroIdAsyncInst : public AnyCoroIdInst {
304+ class CoroIdAsyncInst : public AnyCoroIdInst {
309305 enum { SizeArg, AlignArg, StorageArg, AsyncFuncPtrArg };
310306
311307public:
@@ -356,7 +352,7 @@ class LLVM_LIBRARY_VISIBILITY CoroIdAsyncInst : public AnyCoroIdInst {
356352};
357353
358354// / This represents the llvm.coro.context.alloc instruction.
359- class LLVM_LIBRARY_VISIBILITY CoroAsyncContextAllocInst : public IntrinsicInst {
355+ class CoroAsyncContextAllocInst : public IntrinsicInst {
360356 enum { AsyncFuncPtrArg };
361357
362358public:
@@ -375,8 +371,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncContextAllocInst : public IntrinsicInst {
375371};
376372
377373// / This represents the llvm.coro.context.dealloc instruction.
378- class LLVM_LIBRARY_VISIBILITY CoroAsyncContextDeallocInst
379- : public IntrinsicInst {
374+ class CoroAsyncContextDeallocInst : public IntrinsicInst {
380375 enum { AsyncContextArg };
381376
382377public:
@@ -396,7 +391,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncContextDeallocInst
396391// / This represents the llvm.coro.async.resume instruction.
397392// / During lowering this is replaced by the resume function of a suspend point
398393// / (the continuation function).
399- class LLVM_LIBRARY_VISIBILITY CoroAsyncResumeInst : public IntrinsicInst {
394+ class CoroAsyncResumeInst : public IntrinsicInst {
400395public:
401396 // Methods to support type inquiry through isa, cast, and dyn_cast:
402397 static bool classof (const IntrinsicInst *I) {
@@ -408,7 +403,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncResumeInst : public IntrinsicInst {
408403};
409404
410405// / This represents the llvm.coro.async.size.replace instruction.
411- class LLVM_LIBRARY_VISIBILITY CoroAsyncSizeReplace : public IntrinsicInst {
406+ class CoroAsyncSizeReplace : public IntrinsicInst {
412407public:
413408 // Methods to support type inquiry through isa, cast, and dyn_cast:
414409 static bool classof (const IntrinsicInst *I) {
@@ -420,7 +415,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncSizeReplace : public IntrinsicInst {
420415};
421416
422417// / This represents the llvm.coro.frame instruction.
423- class LLVM_LIBRARY_VISIBILITY CoroFrameInst : public IntrinsicInst {
418+ class CoroFrameInst : public IntrinsicInst {
424419public:
425420 // Methods to support type inquiry through isa, cast, and dyn_cast:
426421 static bool classof (const IntrinsicInst *I) {
@@ -432,7 +427,7 @@ class LLVM_LIBRARY_VISIBILITY CoroFrameInst : public IntrinsicInst {
432427};
433428
434429// / This represents the llvm.coro.free instruction.
435- class LLVM_LIBRARY_VISIBILITY CoroFreeInst : public IntrinsicInst {
430+ class CoroFreeInst : public IntrinsicInst {
436431 enum { IdArg, FrameArg };
437432
438433public:
@@ -447,8 +442,8 @@ class LLVM_LIBRARY_VISIBILITY CoroFreeInst : public IntrinsicInst {
447442 }
448443};
449444
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 {
452447 enum { IdArg, MemArg };
453448
454449public:
@@ -468,7 +463,7 @@ class LLVM_LIBRARY_VISIBILITY CoroBeginInst : public IntrinsicInst {
468463};
469464
470465// / This represents the llvm.coro.save instruction.
471- class LLVM_LIBRARY_VISIBILITY CoroSaveInst : public IntrinsicInst {
466+ class CoroSaveInst : public IntrinsicInst {
472467public:
473468 // Methods to support type inquiry through isa, cast, and dyn_cast:
474469 static bool classof (const IntrinsicInst *I) {
@@ -480,7 +475,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSaveInst : public IntrinsicInst {
480475};
481476
482477// / This represents the llvm.coro.promise instruction.
483- class LLVM_LIBRARY_VISIBILITY CoroPromiseInst : public IntrinsicInst {
478+ class CoroPromiseInst : public IntrinsicInst {
484479 enum { FrameArg, AlignArg, FromArg };
485480
486481public:
@@ -505,7 +500,7 @@ class LLVM_LIBRARY_VISIBILITY CoroPromiseInst : public IntrinsicInst {
505500 }
506501};
507502
508- class LLVM_LIBRARY_VISIBILITY AnyCoroSuspendInst : public IntrinsicInst {
503+ class AnyCoroSuspendInst : public IntrinsicInst {
509504public:
510505 CoroSaveInst *getCoroSave () const ;
511506
@@ -521,7 +516,7 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroSuspendInst : public IntrinsicInst {
521516};
522517
523518// / This represents the llvm.coro.suspend instruction.
524- class LLVM_LIBRARY_VISIBILITY CoroSuspendInst : public AnyCoroSuspendInst {
519+ class CoroSuspendInst : public AnyCoroSuspendInst {
525520 enum { SaveArg, FinalArg };
526521
527522public:
@@ -553,7 +548,7 @@ inline CoroSaveInst *AnyCoroSuspendInst::getCoroSave() const {
553548}
554549
555550// / This represents the llvm.coro.suspend.async instruction.
556- class LLVM_LIBRARY_VISIBILITY CoroSuspendAsyncInst : public AnyCoroSuspendInst {
551+ class CoroSuspendAsyncInst : public AnyCoroSuspendInst {
557552public:
558553 enum {
559554 StorageArgNoArg,
@@ -594,7 +589,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSuspendAsyncInst : public AnyCoroSuspendInst {
594589};
595590
596591// / This represents the llvm.coro.suspend.retcon instruction.
597- class LLVM_LIBRARY_VISIBILITY CoroSuspendRetconInst : public AnyCoroSuspendInst {
592+ class CoroSuspendRetconInst : public AnyCoroSuspendInst {
598593public:
599594 op_iterator value_begin () { return arg_begin (); }
600595 const_op_iterator value_begin () const { return arg_begin (); }
@@ -619,7 +614,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSuspendRetconInst : public AnyCoroSuspendInst
619614};
620615
621616// / This represents the llvm.coro.size instruction.
622- class LLVM_LIBRARY_VISIBILITY CoroSizeInst : public IntrinsicInst {
617+ class CoroSizeInst : public IntrinsicInst {
623618public:
624619 // Methods to support type inquiry through isa, cast, and dyn_cast:
625620 static bool classof (const IntrinsicInst *I) {
@@ -631,7 +626,7 @@ class LLVM_LIBRARY_VISIBILITY CoroSizeInst : public IntrinsicInst {
631626};
632627
633628// / This represents the llvm.coro.align instruction.
634- class LLVM_LIBRARY_VISIBILITY CoroAlignInst : public IntrinsicInst {
629+ class CoroAlignInst : public IntrinsicInst {
635630public:
636631 // Methods to support type inquiry through isa, cast, and dyn_cast:
637632 static bool classof (const IntrinsicInst *I) {
@@ -643,7 +638,7 @@ class LLVM_LIBRARY_VISIBILITY CoroAlignInst : public IntrinsicInst {
643638};
644639
645640// / This represents the llvm.end.results instruction.
646- class LLVM_LIBRARY_VISIBILITY CoroEndResults : public IntrinsicInst {
641+ class CoroEndResults : public IntrinsicInst {
647642public:
648643 op_iterator retval_begin () { return arg_begin (); }
649644 const_op_iterator retval_begin () const { return arg_begin (); }
@@ -671,7 +666,7 @@ class LLVM_LIBRARY_VISIBILITY CoroEndResults : public IntrinsicInst {
671666 }
672667};
673668
674- class LLVM_LIBRARY_VISIBILITY AnyCoroEndInst : public IntrinsicInst {
669+ class AnyCoroEndInst : public IntrinsicInst {
675670 enum { FrameArg, UnwindArg, TokenArg };
676671
677672public:
@@ -700,7 +695,7 @@ class LLVM_LIBRARY_VISIBILITY AnyCoroEndInst : public IntrinsicInst {
700695};
701696
702697// / This represents the llvm.coro.end instruction.
703- class LLVM_LIBRARY_VISIBILITY CoroEndInst : public AnyCoroEndInst {
698+ class CoroEndInst : public AnyCoroEndInst {
704699public:
705700 // Methods to support type inquiry through isa, cast, and dyn_cast:
706701 static bool classof (const IntrinsicInst *I) {
@@ -712,7 +707,7 @@ class LLVM_LIBRARY_VISIBILITY CoroEndInst : public AnyCoroEndInst {
712707};
713708
714709// / This represents the llvm.coro.end instruction.
715- class LLVM_LIBRARY_VISIBILITY CoroAsyncEndInst : public AnyCoroEndInst {
710+ class CoroAsyncEndInst : public AnyCoroEndInst {
716711 enum { FrameArg, UnwindArg, MustTailCallFuncArg };
717712
718713public:
@@ -736,12 +731,11 @@ class LLVM_LIBRARY_VISIBILITY CoroAsyncEndInst : public AnyCoroEndInst {
736731};
737732
738733// / This represents the llvm.coro.alloca.alloc instruction.
739- class LLVM_LIBRARY_VISIBILITY CoroAllocaAllocInst : public IntrinsicInst {
734+ class CoroAllocaAllocInst : public IntrinsicInst {
740735 enum { SizeArg, AlignArg };
736+
741737public:
742- Value *getSize () const {
743- return getArgOperand (SizeArg);
744- }
738+ Value *getSize () const { return getArgOperand (SizeArg); }
745739 Align getAlignment () const {
746740 return cast<ConstantInt>(getArgOperand (AlignArg))->getAlignValue ();
747741 }
@@ -756,8 +750,9 @@ class LLVM_LIBRARY_VISIBILITY CoroAllocaAllocInst : public IntrinsicInst {
756750};
757751
758752// / This represents the llvm.coro.alloca.get instruction.
759- class LLVM_LIBRARY_VISIBILITY CoroAllocaGetInst : public IntrinsicInst {
753+ class CoroAllocaGetInst : public IntrinsicInst {
760754 enum { AllocArg };
755+
761756public:
762757 CoroAllocaAllocInst *getAlloc () const {
763758 return cast<CoroAllocaAllocInst>(getArgOperand (AllocArg));
@@ -773,8 +768,9 @@ class LLVM_LIBRARY_VISIBILITY CoroAllocaGetInst : public IntrinsicInst {
773768};
774769
775770// / This represents the llvm.coro.alloca.free instruction.
776- class LLVM_LIBRARY_VISIBILITY CoroAllocaFreeInst : public IntrinsicInst {
771+ class CoroAllocaFreeInst : public IntrinsicInst {
777772 enum { AllocArg };
773+
778774public:
779775 CoroAllocaAllocInst *getAlloc () const {
780776 return cast<CoroAllocaAllocInst>(getArgOperand (AllocArg));
@@ -791,4 +787,4 @@ class LLVM_LIBRARY_VISIBILITY CoroAllocaFreeInst : public IntrinsicInst {
791787
792788} // End namespace llvm.
793789
794- #endif
790+ #endif // LLVM_TRANSFORMS_COROUTINES_COROINSTR_H
0 commit comments