diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-02 00:18:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-02 00:18:52 +0000 |
commit | bcfd1f55bfbb3e5944cd5e03d07b343e280838c4 (patch) | |
tree | 838fe1b34f86ca6cbebba50b771d5f6556988440 /lib/Sema/SemaExpr.cpp | |
parent | 998b3d3e8528ebd9d2c5d78d3a82edd90a8953a4 (diff) |
Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index f30606f9c4..875aefa931 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -2438,7 +2438,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok) { // cannot have a trigraph, escaped newline, radix prefix, or type suffix. if (Tok.getLength() == 1) { const char Val = PP.getSpellingOfSingleCharacterNumericConstant(Tok); - unsigned IntSize = Context.Target.getIntWidth(); + unsigned IntSize = Context.getTargetInfo().getIntWidth(); return Owned(IntegerLiteral::Create(Context, llvm::APInt(IntSize, Val-'0'), Context.IntTy, Tok.getLocation())); } @@ -2518,7 +2518,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok) { Diag(Tok.getLocation(), diag::ext_longlong); // Get the value in the widest-possible width. - llvm::APInt ResultVal(Context.Target.getIntMaxTWidth(), 0); + llvm::APInt ResultVal(Context.getTargetInfo().getIntMaxTWidth(), 0); if (Literal.GetIntegerValue(ResultVal)) { // If this value didn't fit into uintmax_t, warn and force to ull. @@ -2538,7 +2538,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok) { unsigned Width = 0; if (!Literal.isLong && !Literal.isLongLong) { // Are int/unsigned possibilities? - unsigned IntSize = Context.Target.getIntWidth(); + unsigned IntSize = Context.getTargetInfo().getIntWidth(); // Does it fit in a unsigned int? if (ResultVal.isIntN(IntSize)) { @@ -2553,7 +2553,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok) { // Are long/unsigned long possibilities? if (Ty.isNull() && !Literal.isLongLong) { - unsigned LongSize = Context.Target.getLongWidth(); + unsigned LongSize = Context.getTargetInfo().getLongWidth(); // Does it fit in a unsigned long? if (ResultVal.isIntN(LongSize)) { @@ -2568,7 +2568,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok) { // Finally, check long long if needed. if (Ty.isNull()) { - unsigned LongLongSize = Context.Target.getLongLongWidth(); + unsigned LongLongSize = Context.getTargetInfo().getLongLongWidth(); // Does it fit in a unsigned long long? if (ResultVal.isIntN(LongLongSize)) { @@ -2589,7 +2589,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok) { if (Ty.isNull()) { Diag(Tok.getLocation(), diag::warn_integer_too_large_for_signed); Ty = Context.UnsignedLongLongTy; - Width = Context.Target.getLongLongWidth(); + Width = Context.getTargetInfo().getLongLongWidth(); } if (ResultVal.getBitWidth() != Width) @@ -8713,12 +8713,12 @@ ExprResult Sema::ActOnGNUNullExpr(SourceLocation TokenLoc) { // The type of __null will be int or long, depending on the size of // pointers on the target. QualType Ty; - unsigned pw = Context.Target.getPointerWidth(0); - if (pw == Context.Target.getIntWidth()) + unsigned pw = Context.getTargetInfo().getPointerWidth(0); + if (pw == Context.getTargetInfo().getIntWidth()) Ty = Context.IntTy; - else if (pw == Context.Target.getLongWidth()) + else if (pw == Context.getTargetInfo().getLongWidth()) Ty = Context.LongTy; - else if (pw == Context.Target.getLongLongWidth()) + else if (pw == Context.getTargetInfo().getLongLongWidth()) Ty = Context.LongLongTy; else { assert(!"I don't know size of pointer!"); |