Home | History | Annotate | Download | only in Sema

Lines Matching refs:Literal

1160 /// BuildCookedLiteralOperatorCall - A user-defined literal was found. Look up
1161 /// the corresponding cooked (non-raw) literal operator, and build a call to it.
1167 assert(Args.size() <= 2 && "too many arguments for literal operator");
1200 StringLiteralParser Literal(StringToks, NumStringToks, PP);
1201 if (Literal.hadError)
1209 if (Literal.isWide())
1211 else if (Literal.isUTF16())
1213 else if (Literal.isUTF32())
1215 else if (Literal.isPascal())
1219 if (Literal.isWide())
1221 else if (Literal.isUTF8())
1223 else if (Literal.isUTF16())
1225 else if (Literal.isUTF32())
1228 // A C++ string literal has a const-qualified element type (C++ 2.13.4p1).
1236 llvm::APInt(32, Literal.GetNumStringChars()+1),
1240 StringLiteral *Lit = StringLiteral::Create(Context, Literal.GetString(),
1241 Kind, Literal.Pascal, StrTy,
1244 if (Literal.getUDSuffix().empty())
1247 // We're building a user-defined literal.
1248 IdentifierInfo *UDSuffix = &Context.Idents.get(Literal.getUDSuffix());
1250 getUDSuffixLoc(*this, StringTokLocs[Literal.getUDSuffixToken()],
1251 Literal.getUDSuffixOffset());
1257 // C++11 [lex.ext]p5: The literal L is treated as a call of the form
1260 llvm::APInt Len(Context.getIntWidth(SizeType), Literal.GetNumStringChars());
2418 CharLiteralParser Literal(ThisTok.begin(), ThisTok.end(), Tok.getLocation(),
2420 if (Literal.hadError())
2424 if (Literal.isWide())
2426 else if (Literal.isUTF16())
2428 else if (Literal.isUTF32())
2430 else if (!getLangOpts().CPlusPlus || Literal.isMultiChar())
2436 if (Literal.isWide())
2438 else if (Literal.isUTF16())
2440 else if (Literal.isUTF32())
2443 Expr *Lit = new (Context) CharacterLiteral(Literal.getValue(), Kind, Ty,
2446 if (Literal.getUDSuffix().empty())
2449 // We're building a user-defined literal.
2450 IdentifierInfo *UDSuffix = &Context.Idents.get(Literal.getUDSuffix());
2452 getUDSuffixLoc(*this, Tok.getLocation(), Literal.getUDSuffixOffset());
2458 // C++11 [lex.ext]p6: The literal L is treated as a call of the form
2471 static Expr *BuildFloatingLiteral(Sema &S, NumericLiteralParser &Literal,
2478 APFloat::opStatus result = Literal.GetFloatValue(Val);
2522 NumericLiteralParser Literal(ThisTokBegin, ThisTokBegin+ActualLength,
2524 if (Literal.hadError)
2527 if (Literal.hasUDSuffix()) {
2528 // We're building a user-defined literal.
2529 IdentifierInfo *UDSuffix = &Context.Idents.get(Literal.getUDSuffix());
2531 getUDSuffixLoc(*this, Tok.getLocation(), Literal.getUDSuffixOffset());
2538 if (Literal.isFloatingLiteral()) {
2539 // C++11 [lex.ext]p4: If S contains a literal operator with parameter type
2540 // long double, the literal is treated as a call of the form
2544 // C++11 [lex.ext]p3: If S contains a literal operator with parameter type
2545 // unsigned long long, the literal is treated as a call of the form
2555 // Perform literal operator lookup to determine if we're building a raw
2556 // literal or a cooked one.
2565 if (Literal.isFloatingLiteral()) {
2566 Lit = BuildFloatingLiteral(*this, Literal, CookedTy, Tok.getLocation());
2569 if (Literal.GetIntegerValue(ResultVal))
2580 // C++11 [lit.ext]p3, p4: If S contains a raw literal operator, the
2581 // literal is treated as a call of the form
2584 unsigned Length = Literal.getUDSuffixOffset();
2596 // C++11 [lit.ext]p3, p4: Otherwise (S contains a literal operator
2604 for (unsigned I = 0, N = Literal.getUDSuffixOffset(); I != N; ++I) {
2614 llvm_unreachable("unexpected literal operator lookup result");
2619 if (Literal.isFloatingLiteral()) {
2621 if (Literal.isFloat)
2623 else if (!Literal.isLong)
2628 Res = BuildFloatingLiteral(*this, Literal, Ty, Tok.getLocation());
2638 } else if (!Literal.isIntegerLiteral()) {
2644 if (!getLangOpts().C99 && Literal.isLongLong)
2652 if (Literal.GetIntegerValue(ResultVal)) {
2664 bool AllowUnsigned = Literal.isUnsigned || Literal.getRadix() != 10;
2668 if (!Literal.isLong && !Literal.isLongLong) {
2675 if (!Literal.isUnsigned && ResultVal[IntSize-1] == 0)
2684 if (Ty.isNull() && !Literal.isLongLong) {
2690 if (!Literal.isUnsigned && ResultVal[LongSize-1] == 0)
2707 if (!Literal.isUnsigned && (ResultVal[LongLongSize-1] == 0 ||
2708 (getLangOpts().MicrosoftExt && Literal.isLongLong)))
2730 // If this is an imaginary literal, create the ImaginaryLiteral wrapper.
2731 if (Literal.isImaginary)
4301 // Check for an altivec or OpenCL literal,
4372 ExprResult Literal = DefaultLvalueConversion(exprs[0]);
4373 if (Literal.isInvalid())
4375 Literal = ImpCastExprToType(Literal.take(), ElemTy,
4376 PrepareScalarCast(Literal, ElemTy));
4377 return BuildCStyleCastExpr(LParenLoc, TInfo, RParenLoc, Literal.take());
4394 ExprResult Literal = DefaultLvalueConversion(exprs[0]);
4395 if (Literal.isInvalid())
4397 Literal = ImpCastExprToType(Literal.take(), ElemTy,
4398 PrepareScalarCast(Literal, ElemTy));
4399 return BuildCStyleCastExpr(LParenLoc, TInfo, RParenLoc, Literal.take());
5647 // Build a compound literal constructing a value of the transparent
6141 /// literal.
6206 // Diagnose "string literal" '+' int.
6393 Result.toString(HexResult, 16, /*Signed =*/false, /*Literal =*/true);
8878 /// ActOnBlockStart - This callback is invoked when a block literal is started.
8904 // literal signature. Furthermore, it is always a FunctionProtoType
9027 /// literal was successfully completed. ^(int x){...}
9342 // (deprecated) C++ conversion from a string literal to a char*
9450 // If an expression of literal class type is used in a context where an