aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorGor Nishanov <GorNishanov@gmail.com>2016-10-03 22:44:48 +0000
committerGor Nishanov <GorNishanov@gmail.com>2016-10-03 22:44:48 +0000
commit97e3b6d895baaebd243efbb4821d38cd10d6ae75 (patch)
tree8e0fae717c69ca8e9686688aa165dac06b807e85 /clang/lib/CodeGen/CodeGenFunction.h
parente040533ecec5b1c0ab83c1c7b65342d46478afc5 (diff)
downloadllvm-97e3b6d895baaebd243efbb4821d38cd10d6ae75.zip
llvm-97e3b6d895baaebd243efbb4821d38cd10d6ae75.tar.gz
llvm-97e3b6d895baaebd243efbb4821d38cd10d6ae75.tar.bz2
[coroutines] Adding builtins for coroutine intrinsics and backendutil support.
Summary: With this commit simple coroutines can be created in plain C using coroutine builtins. Reviewers: rnk, EricWF, rsmith Subscribers: modocache, mgorny, mehdi_amini, beanz, cfe-commits Differential Revision: https://reviews.llvm.org/D24373 llvm-svn: 283155
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index db57985..4e149e6 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -88,6 +88,7 @@ class BlockFieldFlags;
class RegionCodeGenTy;
class TargetCodeGenInfo;
struct OMPTaskDataTy;
+struct CGCoroData;
/// The kind of evaluation to perform on values of a particular
/// type. Basically, is the code in CGExprScalar, CGExprComplex, or
@@ -155,6 +156,16 @@ public:
QualType FnRetTy;
llvm::Function *CurFn;
+ // Holds coroutine data if the current function is a coroutine. We use a
+ // wrapper to manage its lifetime, so that we don't have to define CGCoroData
+ // in this header.
+ struct CGCoroInfo {
+ std::unique_ptr<CGCoroData> Data;
+ CGCoroInfo();
+ ~CGCoroInfo();
+ };
+ CGCoroInfo CurCoro;
+
/// CurGD - The GlobalDecl for the current function being compiled.
GlobalDecl CurGD;
@@ -2290,6 +2301,8 @@ public:
void EmitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt &S);
void EmitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt &S);
+ RValue EmitCoroutineIntrinsic(const CallExpr *E, unsigned int IID);
+
void EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock = false);
void ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock = false);