|
@@ -1486,6 +1486,7 @@ void SPIRVEmitter::doDoStmt(const DoStmt *theDoStmt,
|
|
theBuilder.setInsertPoint(continueBB);
|
|
theBuilder.setInsertPoint(continueBB);
|
|
uint32_t condition = 0;
|
|
uint32_t condition = 0;
|
|
if (const Expr *check = theDoStmt->getCond()) {
|
|
if (const Expr *check = theDoStmt->getCond()) {
|
|
|
|
+ emitDebugLine(check->getLocStart());
|
|
condition = doExpr(check);
|
|
condition = doExpr(check);
|
|
} else {
|
|
} else {
|
|
condition = theBuilder.getConstantBool(true);
|
|
condition = theBuilder.getConstantBool(true);
|
|
@@ -1585,6 +1586,7 @@ void SPIRVEmitter::doWhileStmt(const WhileStmt *whileStmt,
|
|
|
|
|
|
uint32_t condition = 0;
|
|
uint32_t condition = 0;
|
|
if (const Expr *check = whileStmt->getCond()) {
|
|
if (const Expr *check = whileStmt->getCond()) {
|
|
|
|
+ emitDebugLine(check->getLocStart());
|
|
condition = doExpr(check);
|
|
condition = doExpr(check);
|
|
} else {
|
|
} else {
|
|
condition = theBuilder.getConstantBool(true);
|
|
condition = theBuilder.getConstantBool(true);
|
|
@@ -1676,6 +1678,7 @@ void SPIRVEmitter::doForStmt(const ForStmt *forStmt,
|
|
|
|
|
|
// Process the <init> block
|
|
// Process the <init> block
|
|
if (const Stmt *initStmt = forStmt->getInit()) {
|
|
if (const Stmt *initStmt = forStmt->getInit()) {
|
|
|
|
+ emitDebugLine(initStmt->getLocStart());
|
|
doStmt(initStmt);
|
|
doStmt(initStmt);
|
|
}
|
|
}
|
|
theBuilder.createBranch(checkBB);
|
|
theBuilder.createBranch(checkBB);
|
|
@@ -1685,6 +1688,7 @@ void SPIRVEmitter::doForStmt(const ForStmt *forStmt,
|
|
theBuilder.setInsertPoint(checkBB);
|
|
theBuilder.setInsertPoint(checkBB);
|
|
uint32_t condition;
|
|
uint32_t condition;
|
|
if (const Expr *check = forStmt->getCond()) {
|
|
if (const Expr *check = forStmt->getCond()) {
|
|
|
|
+ emitDebugLine(check->getLocStart());
|
|
condition = doExpr(check);
|
|
condition = doExpr(check);
|
|
} else {
|
|
} else {
|
|
condition = theBuilder.getConstantBool(true);
|
|
condition = theBuilder.getConstantBool(true);
|
|
@@ -1713,6 +1717,7 @@ void SPIRVEmitter::doForStmt(const ForStmt *forStmt,
|
|
// Process the <continue> block
|
|
// Process the <continue> block
|
|
theBuilder.setInsertPoint(continueBB);
|
|
theBuilder.setInsertPoint(continueBB);
|
|
if (const Expr *cont = forStmt->getInc()) {
|
|
if (const Expr *cont = forStmt->getInc()) {
|
|
|
|
+ emitDebugLine(cont->getLocStart());
|
|
doExpr(cont);
|
|
doExpr(cont);
|
|
}
|
|
}
|
|
theBuilder.createBranch(checkBB); // <continue> should jump back to header
|
|
theBuilder.createBranch(checkBB); // <continue> should jump back to header
|
|
@@ -1786,6 +1791,7 @@ void SPIRVEmitter::doIfStmt(const IfStmt *ifStmt,
|
|
if (const auto *declStmt = ifStmt->getConditionVariableDeclStmt())
|
|
if (const auto *declStmt = ifStmt->getConditionVariableDeclStmt())
|
|
doDeclStmt(declStmt);
|
|
doDeclStmt(declStmt);
|
|
|
|
|
|
|
|
+ emitDebugLine(ifStmt->getCond()->getLocStart());
|
|
// First emit the instruction for evaluating the condition.
|
|
// First emit the instruction for evaluating the condition.
|
|
const uint32_t condition = doExpr(ifStmt->getCond());
|
|
const uint32_t condition = doExpr(ifStmt->getCond());
|
|
|
|
|