aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-24 06:25:27 +0000
committerChris Lattner <sabre@nondot.org>2008-11-24 06:25:27 +0000
commitd162584991885ab004a02573a73ce06422b921fc (patch)
tree0d8c56d85205a22c6c06b712a468afcd10429c4b /lib/Sema/SemaStmt.cpp
parentd9d22dd9c94618490dbffb0e2caf222530ca39d3 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 8cd223fc39..99fdbdb022 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -223,7 +223,7 @@ Sema::ActOnIfStmt(SourceLocation IfLoc, ExprTy *CondVal,
return true;
} else if (!condType->isScalarType()) // C99 6.8.4.1p1
return Diag(IfLoc, diag::err_typecheck_statement_requires_scalar)
- << condType.getAsString() << condExpr->getSourceRange();
+ << condType << condExpr->getSourceRange();
// Warn if the if block has a null body without an else value.
// this helps prevent bugs due to typos, such as
@@ -362,7 +362,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch,
if (!CondType->isIntegerType()) { // C99 6.8.4.2p1
Diag(SwitchLoc, diag::err_typecheck_statement_requires_integer)
- << CondType.getAsString() << CondExpr->getSourceRange();
+ << CondType << CondExpr->getSourceRange();
return true;
}
@@ -549,7 +549,7 @@ Sema::ActOnWhileStmt(SourceLocation WhileLoc, ExprTy *Cond, StmtTy *Body) {
return true;
} else if (!condType->isScalarType()) // C99 6.8.5p2
return Diag(WhileLoc, diag::err_typecheck_statement_requires_scalar)
- << condType.getAsString() << condExpr->getSourceRange();
+ << condType << condExpr->getSourceRange();
return new WhileStmt(condExpr, (Stmt*)Body, WhileLoc);
}
@@ -568,7 +568,7 @@ Sema::ActOnDoStmt(SourceLocation DoLoc, StmtTy *Body,
return true;
} else if (!condType->isScalarType()) // C99 6.8.5p2
return Diag(DoLoc, diag::err_typecheck_statement_requires_scalar)
- << condType.getAsString() << condExpr->getSourceRange();
+ << condType << condExpr->getSourceRange();
return new DoStmt((Stmt*)Body, condExpr, DoLoc);
}
@@ -607,7 +607,7 @@ Sema::ActOnForStmt(SourceLocation ForLoc, SourceLocation LParenLoc,
return true;
} else if (!SecondType->isScalarType()) // C99 6.8.5p2
return Diag(ForLoc, diag::err_typecheck_statement_requires_scalar)
- << SecondType.getAsString() << Second->getSourceRange();
+ << SecondType << Second->getSourceRange();
}
return new ForStmt(First, Second, Third, Body, ForLoc);
}
@@ -646,14 +646,14 @@ Sema::ActOnObjCForCollectionStmt(SourceLocation ForLoc,
}
if (!Context.isObjCObjectPointerType(FirstType))
Diag(ForLoc, diag::err_selector_element_type)
- << FirstType.getAsString() << First->getSourceRange();
+ << FirstType << First->getSourceRange();
}
if (Second) {
DefaultFunctionArrayConversion(Second);
QualType SecondType = Second->getType();
if (!Context.isObjCObjectPointerType(SecondType))
Diag(ForLoc, diag::err_collection_expr_type)
- << SecondType.getAsString() << Second->getSourceRange();
+ << SecondType << Second->getSourceRange();
}
return new ObjCForCollectionStmt(First, Second, Body, ForLoc, RParenLoc);
}
@@ -888,7 +888,7 @@ Sema::StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc,
// FIXME: We currently leak memory here.
return Diag(InputExpr->getSubExpr()->getLocStart(),
diag::err_asm_invalid_type_in_input)
- << InputExpr->getType().getAsString() << InputConstraint
+ << InputExpr->getType() << InputConstraint
<< InputExpr->getSubExpr()->getSourceRange();
}
}