Deleted Added
sdiff udiff text old ( 280031 ) new ( 283526 )
full compact
1//===--- SemaChecking.cpp - Extra Semantic Checking -----------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 283 unchanged lines hidden (view full) ---

292 case Builtin::BI__builtin_object_size:
293 if (SemaBuiltinConstantArgRange(TheCall, 1, 0, 3))
294 return ExprError();
295 break;
296 case Builtin::BI__builtin_longjmp:
297 if (SemaBuiltinLongjmp(TheCall))
298 return ExprError();
299 break;
300
301 case Builtin::BI__builtin_classify_type:
302 if (checkArgCount(*this, TheCall, 1)) return true;
303 TheCall->setType(Context.IntTy);
304 break;
305 case Builtin::BI__builtin_constant_p:
306 if (checkArgCount(*this, TheCall, 1)) return true;
307 TheCall->setType(Context.IntTy);

--- 2054 unchanged lines hidden (view full) ---

2362 if (Result.getSExtValue() < Low || Result.getSExtValue() > High)
2363 return Diag(TheCall->getLocStart(), diag::err_argument_invalid_range)
2364 << Low << High << Arg->getSourceRange();
2365
2366 return false;
2367}
2368
2369/// SemaBuiltinLongjmp - Handle __builtin_longjmp(void *env[5], int val).
2370/// This checks that val is a constant 1.
2371bool Sema::SemaBuiltinLongjmp(CallExpr *TheCall) {
2372 Expr *Arg = TheCall->getArg(1);
2373 llvm::APSInt Result;
2374
2375 // TODO: This is less than ideal. Overload this to take a value.
2376 if (SemaBuiltinConstantArg(TheCall, 1, Result))
2377 return true;
2378
2379 if (Result != 1)
2380 return Diag(TheCall->getLocStart(), diag::err_builtin_longjmp_invalid_val)
2381 << SourceRange(Arg->getLocStart(), Arg->getLocEnd());
2382
2383 return false;
2384}
2385
2386namespace {
2387enum StringLiteralCheckType {
2388 SLCT_NotALiteral,
2389 SLCT_UncheckedLiteral,
2390 SLCT_CheckedLiteral
2391};
2392}
2393

--- 6468 unchanged lines hidden ---