summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-11-19 12:07:54 -0500
committerAlexey Bataev <a.bataev@hotmail.com>2019-11-19 15:58:19 -0500
commitd08c056695a59fb1cfc7ccc9a2784bb9a6514551 (patch)
tree527623ad4aac96e8ea0e393c4f126b1bf90705f1 /clang/lib/CodeGen/CodeGenFunction.h
parent0d4211f4e753057feec32938e596d037d4f5a6aa (diff)
downloadbcm5719-llvm-d08c056695a59fb1cfc7ccc9a2784bb9a6514551.tar.gz
bcm5719-llvm-d08c056695a59fb1cfc7ccc9a2784bb9a6514551.zip
[OPENMP50]Add if clause in simd directive.
According to OpenMP 5.0, if clause can be used in simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 5c3d1764fad..7a2627ccf58 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -947,6 +947,19 @@ public:
}
};
+ /// Save/restore original map of previously emitted local vars in case when we
+ /// need to duplicate emission of the same code several times in the same
+ /// function for OpenMP code.
+ class OMPLocalDeclMapRAII {
+ CodeGenFunction &CGF;
+ DeclMapTy SavedMap;
+
+ public:
+ OMPLocalDeclMapRAII(CodeGenFunction &CGF)
+ : CGF(CGF), SavedMap(CGF.LocalDeclMap) {}
+ ~OMPLocalDeclMapRAII() { SavedMap.swap(CGF.LocalDeclMap); }
+ };
+
/// Takes the old cleanup stack size and emits the cleanup blocks
/// that have been added.
void
OpenPOWER on IntegriCloud