@@ -200,7 +200,7 @@ mlir::LogicalResult CIRGenFunction::emitOpenACCOp(
200200
201201mlir::LogicalResult
202202CIRGenFunction::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
224224mlir::LogicalResult
225225CIRGenFunction::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
234234mlir::LogicalResult
235235CIRGenFunction::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
241241mlir::LogicalResult
242242CIRGenFunction::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
248248mlir::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