/// Represents a call to a CUDA kernel function.
class CUDAKernelCallExpr final : public CallExpr {
+ friend class ASTStmtReader;
+
enum { CONFIG, END_PREARG };
// CUDAKernelCallExpr has some trailing objects belonging
}
CallExpr *getConfig() { return cast_or_null<CallExpr>(getPreArg(CONFIG)); }
- /// Sets the kernel configuration expression.
- ///
- /// Note that this method cannot be called if config has already been set to a
- /// non-null value.
- void setConfig(CallExpr *E) {
- assert(!getConfig() &&
- "Cannot call setConfig if config is not null");
- setPreArg(CONFIG, E);
- setInstantiationDependent(isInstantiationDependent() ||
- E->isInstantiationDependent());
- setContainsUnexpandedParameterPack(containsUnexpandedParameterPack() ||
- E->containsUnexpandedParameterPack());
- }
-
static bool classof(const Stmt *T) {
return T->getStmtClass() == CUDAKernelCallExprClass;
}
void ASTStmtReader::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
VisitCallExpr(E);
- E->setConfig(cast<CallExpr>(Record.readSubExpr()));
+ E->setPreArg(CUDAKernelCallExpr::CONFIG, Record.readSubExpr());
}
//===----------------------------------------------------------------------===//