Skip to content

Commit 52ef558

Browse files
committed
[OpenACC] Fix source-location on a handful of CIR Directives
Apparently we used the 'end location' instead of 'start' in a few places.
1 parent 6f5e993 commit 52ef558

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ mlir::LogicalResult CIRGenFunction::emitOpenACCOp(
200200

201201
mlir::LogicalResult
202202
CIRGenFunction::emitOpenACCComputeConstruct(const OpenACCComputeConstruct &s) {
203-
mlir::Location start = getLoc(s.getSourceRange().getEnd());
203+
mlir::Location start = getLoc(s.getSourceRange().getBegin());
204204
mlir::Location end = getLoc(s.getSourceRange().getEnd());
205205

206206
switch (s.getDirectiveKind()) {
@@ -223,7 +223,7 @@ CIRGenFunction::emitOpenACCComputeConstruct(const OpenACCComputeConstruct &s) {
223223

224224
mlir::LogicalResult
225225
CIRGenFunction::emitOpenACCDataConstruct(const OpenACCDataConstruct &s) {
226-
mlir::Location start = getLoc(s.getSourceRange().getEnd());
226+
mlir::Location start = getLoc(s.getSourceRange().getBegin());
227227
mlir::Location end = getLoc(s.getSourceRange().getEnd());
228228

229229
return emitOpenACCOpAssociatedStmt<DataOp, mlir::acc::TerminatorOp>(
@@ -233,21 +233,21 @@ CIRGenFunction::emitOpenACCDataConstruct(const OpenACCDataConstruct &s) {
233233

234234
mlir::LogicalResult
235235
CIRGenFunction::emitOpenACCInitConstruct(const OpenACCInitConstruct &s) {
236-
mlir::Location start = getLoc(s.getSourceRange().getEnd());
236+
mlir::Location start = getLoc(s.getSourceRange().getBegin());
237237
return emitOpenACCOp<InitOp>(start, s.getDirectiveKind(), s.getDirectiveLoc(),
238238
s.clauses());
239239
}
240240

241241
mlir::LogicalResult
242242
CIRGenFunction::emitOpenACCSetConstruct(const OpenACCSetConstruct &s) {
243-
mlir::Location start = getLoc(s.getSourceRange().getEnd());
243+
mlir::Location start = getLoc(s.getSourceRange().getBegin());
244244
return emitOpenACCOp<SetOp>(start, s.getDirectiveKind(), s.getDirectiveLoc(),
245245
s.clauses());
246246
}
247247

248248
mlir::LogicalResult CIRGenFunction::emitOpenACCShutdownConstruct(
249249
const OpenACCShutdownConstruct &s) {
250-
mlir::Location start = getLoc(s.getSourceRange().getEnd());
250+
mlir::Location start = getLoc(s.getSourceRange().getBegin());
251251
return emitOpenACCOp<ShutdownOp>(start, s.getDirectiveKind(),
252252
s.getDirectiveLoc(), s.clauses());
253253
}

0 commit comments

Comments
 (0)