From 52ef55864f50077072e083c5582d23a9ec494142 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 11 Apr 2025 11:30:43 -0700 Subject: [PATCH] [OpenACC] Fix source-location on a handful of CIR Directives Apparently we used the 'end location' instead of 'start' in a few places. --- clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp b/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp index 5e3f826e2fa8..152f996ed0fe 100644 --- a/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp @@ -200,7 +200,7 @@ mlir::LogicalResult CIRGenFunction::emitOpenACCOp( mlir::LogicalResult CIRGenFunction::emitOpenACCComputeConstruct(const OpenACCComputeConstruct &s) { - mlir::Location start = getLoc(s.getSourceRange().getEnd()); + mlir::Location start = getLoc(s.getSourceRange().getBegin()); mlir::Location end = getLoc(s.getSourceRange().getEnd()); switch (s.getDirectiveKind()) { @@ -223,7 +223,7 @@ CIRGenFunction::emitOpenACCComputeConstruct(const OpenACCComputeConstruct &s) { mlir::LogicalResult CIRGenFunction::emitOpenACCDataConstruct(const OpenACCDataConstruct &s) { - mlir::Location start = getLoc(s.getSourceRange().getEnd()); + mlir::Location start = getLoc(s.getSourceRange().getBegin()); mlir::Location end = getLoc(s.getSourceRange().getEnd()); return emitOpenACCOpAssociatedStmt( @@ -233,21 +233,21 @@ CIRGenFunction::emitOpenACCDataConstruct(const OpenACCDataConstruct &s) { mlir::LogicalResult CIRGenFunction::emitOpenACCInitConstruct(const OpenACCInitConstruct &s) { - mlir::Location start = getLoc(s.getSourceRange().getEnd()); + mlir::Location start = getLoc(s.getSourceRange().getBegin()); return emitOpenACCOp(start, s.getDirectiveKind(), s.getDirectiveLoc(), s.clauses()); } mlir::LogicalResult CIRGenFunction::emitOpenACCSetConstruct(const OpenACCSetConstruct &s) { - mlir::Location start = getLoc(s.getSourceRange().getEnd()); + mlir::Location start = getLoc(s.getSourceRange().getBegin()); return emitOpenACCOp(start, s.getDirectiveKind(), s.getDirectiveLoc(), s.clauses()); } mlir::LogicalResult CIRGenFunction::emitOpenACCShutdownConstruct( const OpenACCShutdownConstruct &s) { - mlir::Location start = getLoc(s.getSourceRange().getEnd()); + mlir::Location start = getLoc(s.getSourceRange().getBegin()); return emitOpenACCOp(start, s.getDirectiveKind(), s.getDirectiveLoc(), s.clauses()); }