From 8adb99b76841d53da4366689a5bfdf6bdfa2f685 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Mon, 19 Mar 2012 11:28:34 -0700 Subject: [PATCH] Improve source locations reported with warnings. --- stmt.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stmt.cpp b/stmt.cpp index d634108e..c8293b5c 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -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); }