diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-24 06:25:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-24 06:25:27 +0000 |
commit | 1e5665e6be5b00219581c1b951e0e5721c8b64e0 (patch) | |
tree | b67f3b9be0871c3ff9bb37414bb3fe7723bd1156 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | f3d3faeca60a7fab63ee03bf2b04d65d8640374e (diff) | |
download | bcm5719-llvm-1e5665e6be5b00219581c1b951e0e5721c8b64e0.tar.gz bcm5719-llvm-1e5665e6be5b00219581c1b951e0e5721c8b64e0.zip |
Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first. This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.
llvm-svn: 59948
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index f5f05f243cf..3633da89bc0 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -126,7 +126,7 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep, // if (!RT->getDecl()->isDefinition()) return Diag(TyBeginLoc, diag::err_invalid_incomplete_type_use) - << Ty.getAsString() << FullRange; + << Ty << FullRange; unsigned DiagID = PP.getDiagnostics().getCustomDiagID(Diagnostic::Error, "class constructors are not supported yet"); @@ -164,7 +164,7 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep, return Diag(TyBeginLoc, diag::err_value_init_for_array_type) << FullRange; if (Ty->isIncompleteType() && !Ty->isVoidType()) return Diag(TyBeginLoc, diag::err_invalid_incomplete_type_use) - << Ty.getAsString() << FullRange; + << Ty << FullRange; return new CXXZeroInitValueExpr(Ty, TyBeginLoc, RParenLoc); } @@ -302,7 +302,7 @@ bool Sema::CheckAllocatedType(QualType AllocType, SourceLocation StartLoc, assert(false && "Unexpected type class"); return true; } - Diag(StartLoc, msg) << AllocType.getAsString() << TyR; + Diag(StartLoc, msg) << AllocType << TyR; return true; } @@ -340,18 +340,17 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal, } if (!Type->isPointerType()) { - Diag(StartLoc, diag::err_delete_operand) - << Type.getAsString() << Ex->getSourceRange(); + Diag(StartLoc, diag::err_delete_operand) << Type << Ex->getSourceRange(); return true; } QualType Pointee = Type->getAsPointerType()->getPointeeType(); if (Pointee->isIncompleteType() && !Pointee->isVoidType()) Diag(StartLoc, diag::warn_delete_incomplete) - << Pointee.getAsString() << Ex->getSourceRange(); + << Pointee << Ex->getSourceRange(); else if (!Pointee->isObjectType()) { Diag(StartLoc, diag::err_delete_operand) - << Type.getAsString() << Ex->getSourceRange(); + << Type << Ex->getSourceRange(); return true; } @@ -428,7 +427,7 @@ bool Sema::CheckCXXBooleanCondition(Expr *&CondExpr) { ConvTy = CheckSingleAssignmentConstraints(Context.BoolTy, CondExpr); if (ConvTy == Incompatible) return Diag(CondExpr->getLocStart(), diag::err_typecheck_bool_condition) - << Ty.getAsString() << CondExpr->getSourceRange(); + << Ty << CondExpr->getSourceRange(); return false; } |