diff options
author | Joey Gouly <joey.gouly@gmail.com> | 2017-08-09 14:52:47 +0000 |
---|---|---|
committer | Joey Gouly <joey.gouly@gmail.com> | 2017-08-09 14:52:47 +0000 |
commit | 922ca2345d29f3c6bd089afedbb06b7d88bd4d99 (patch) | |
tree | 2611fe762d56728265fce2dcdd94a31f98c71ea7 /clang/lib/Sema/SemaChecking.cpp | |
parent | fc4b3951e95323014c8f616726fe328f57d4aa05 (diff) | |
download | bcm5719-llvm-922ca2345d29f3c6bd089afedbb06b7d88bd4d99.tar.gz bcm5719-llvm-922ca2345d29f3c6bd089afedbb06b7d88bd4d99.zip |
[OpenCL] Minor refactoring to reduce copy/pasted code
Set the type of TheCall inside SemaBuiltinReserveRWPipe to reduce
duplicated code.
llvm-svn: 310477
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index bbb4b7592ed..0112bffa29b 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -683,6 +683,11 @@ static bool SemaBuiltinReserveRWPipe(Sema &S, CallExpr *Call) { return true; } + // Since return type of reserve_read/write_pipe built-in function is + // reserve_id_t, which is not defined in the builtin def file , we used int + // as return type and need to override the return type of these functions. + Call->setType(S.Context.OCLReserveIDTy); + return false; } @@ -1086,20 +1091,12 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BIwork_group_reserve_write_pipe: if (SemaBuiltinReserveRWPipe(*this, TheCall)) return ExprError(); - // Since return type of reserve_read/write_pipe built-in function is - // reserve_id_t, which is not defined in the builtin def file , we used int - // as return type and need to override the return type of these functions. - TheCall->setType(Context.OCLReserveIDTy); break; case Builtin::BIsub_group_reserve_read_pipe: case Builtin::BIsub_group_reserve_write_pipe: if (checkOpenCLSubgroupExt(*this, TheCall) || SemaBuiltinReserveRWPipe(*this, TheCall)) return ExprError(); - // Since return type of reserve_read/write_pipe built-in function is - // reserve_id_t, which is not defined in the builtin def file , we used int - // as return type and need to override the return type of these functions. - TheCall->setType(Context.OCLReserveIDTy); break; case Builtin::BIcommit_read_pipe: case Builtin::BIcommit_write_pipe: |