Skip to content

Commit f500da9

Browse files
committed
Modified return type of builtinAllocaAddreSpace function.
1 parent a77dfff commit f500da9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clang/lib/Sema/SemaChecking.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,16 +1479,14 @@ static bool BuiltinSEHScopeCheck(Sema &SemaRef, CallExpr *TheCall,
14791479

14801480
// In OpenCL, __builtin_alloca_* should return a pointer to address space
14811481
// that corresponds to the stack address space i.e private address space.
1482-
static bool builtinAllocaAddrSpace(Sema &S, CallExpr *TheCall) {
1482+
static void builtinAllocaAddrSpace(Sema &S, CallExpr *TheCall) {
14831483
QualType RT = TheCall->getType();
14841484
assert((RT->isPointerType() && !(RT->getPointeeType().hasAddressSpace())) &&
14851485
"__builtin_alloca has invalid address space");
14861486

14871487
RT = RT->getPointeeType();
14881488
RT = S.Context.getAddrSpaceQualType(RT, LangAS::opencl_private);
14891489
TheCall->setType(S.Context.getPointerType(RT));
1490-
1491-
return false;
14921490
}
14931491

14941492
namespace {
@@ -2225,8 +2223,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
22252223
Diag(TheCall->getBeginLoc(), diag::warn_alloca)
22262224
<< TheCall->getDirectCallee();
22272225
if (getLangOpts().OpenCL) {
2228-
if (builtinAllocaAddrSpace(*this, TheCall))
2229-
return ExprError();
2226+
builtinAllocaAddrSpace(*this, TheCall);
22302227
}
22312228
break;
22322229
case Builtin::BI__arithmetic_fence:

0 commit comments

Comments
 (0)