diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 2b0ebad3088e79..cfd9950066bb52 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -684,18 +684,18 @@ class CodeGenFunction : public CodeGenTypeCache { /// Manages parent directive for scan directives. class ParentLoopDirectiveForScanRegion { CodeGenFunction &CGF; - const OMPExecutableDirective &ParentLoopDirectiveForScan; + const OMPExecutableDirective *ParentLoopDirectiveForScan; public: ParentLoopDirectiveForScanRegion( CodeGenFunction &CGF, const OMPExecutableDirective &ParentLoopDirectiveForScan) : CGF(CGF), - ParentLoopDirectiveForScan(*CGF.OMPParentLoopDirectiveForScan) { + ParentLoopDirectiveForScan(CGF.OMPParentLoopDirectiveForScan) { CGF.OMPParentLoopDirectiveForScan = &ParentLoopDirectiveForScan; } ~ParentLoopDirectiveForScanRegion() { - CGF.OMPParentLoopDirectiveForScan = &ParentLoopDirectiveForScan; + CGF.OMPParentLoopDirectiveForScan = ParentLoopDirectiveForScan; } };