Improve source locations reported with warnings.

This commit is contained in:
Matt Pharr
2012-03-19 11:28:34 -07:00
parent 13c42412d2
commit 8adb99b768

View File

@@ -776,7 +776,8 @@ void DoStmt::EmitCode(FunctionEmitContext *ctx) const {
bool uniformTest = testExpr->GetType()->IsUniformType();
if (uniformTest && doCoherentCheck)
Warning(pos, "Uniform condition supplied to \"cdo\" statement.");
Warning(testExpr->pos, "Uniform condition supplied to \"cdo\" "
"statement.");
llvm::BasicBlock *bloop = ctx->CreateBasicBlock("do_loop");
llvm::BasicBlock *bexit = ctx->CreateBasicBlock("do_exit");
@@ -993,7 +994,8 @@ ForStmt::EmitCode(FunctionEmitContext *ctx) const {
// any of the mask values are true.
if (uniformTest) {
if (doCoherentCheck)
Warning(pos, "Uniform condition supplied to cfor/cwhile statement.");
Warning(test->pos, "Uniform condition supplied to cfor/cwhile "
"statement.");
Assert(ltest->getType() == LLVMTypes::BoolType);
ctx->BranchInst(bloop, bexit, ltest);
}